Aux I/O Bus

I’m working with the RCM5700 Mini Core

First time to use the External IO Aux Bus feature on the Rabbits…
This seems this is an illusive topic…

So I’m posting a sample from the Rabbit folks and have modified and
added my comments to help those looking for the same
type of information.

Hope this is use to some users :slight_smile:

PS … you should be familiar with bus and address configurations
as well as using IOWR / IORD / CS signals to enable your
external IO interface designs…

//*************************
//RCM57_extern_IO.C PE7 used as strobe, write enabled
//
//Port A used as external I/O data bus,
//Port B as external I/O address bus.
//Use IOWR IORD to interact with your hardware addressing
//
//PB[7…2] correspond to external address bits 5 through 0.
// note: you can use the entire PB[7…0] if desired
// by modifying the SPCR criteria below
//*************************

// this is a typical READ and WRITE to an External Data port

main()
{
int var1;

    // SlavePortControlregister

WrPortI(SPCR, &SPCRShadow, 0x8C);
// I/O Bank Control Reg
WrPortI(IB7CR,&IB7CRShadow, 0x08);// 15 ws io/cs active low cs

   // set PE7 to be used as the CS pin

BitWrPortI(PEDDR, &PEDDRShadow,1,7); // PE7 set to an output
BitWrPortI(PEAHR, &PEAHRShadow,0,7); // PE7 = I7 pg117 RCM5000 man
BitWrPortI(PEFR, &PEFRShadow,1,7); // PE7 alternate function
WrPortI(PBDDR, &PBDDRShadow,0xFF); // probably not needed.

while(1)
{
WrPortE(0xE001, NULL, 0xAA); // write 0xaa to 0xE001
// keep in mind that the 0xExxx is dictated by the CS pin
// see pg 304 RCM5000 manual 27.1.2 I/O Strobes
// this shows the ranges using the different IBxCR strobes
// typically, for general I/O you would only use one strobe
// and map any I/O hardware you have to this range…
// I used 0xE001 as a write address but it has the range
// xE000 - xEFFF. (same for the READ below )

        	waitfor(DelayMs(10));   // just a delay here



         var1 = RdPortE( 0xE002 );   // reading a byte is the same as above
           // with regards to the address range, it uses CS7  


        	waitfor(DelayMs(10));   // just a delay here

}
}

Thanks for posting this, it is exactly what I was looking for, connected up the scope and worked just fine. :smiley:

I am going to start to interface things and as I get them working and things finalized I too will post my results here so others can get started quickly.

Its a shame Rabbit did not make any External I/O examples. Think there slacking a bit in the example department.

I know that there are many other Rabbit users that face
the same questions…and since I ran around like a rabbit for
a few day’s trying to figure this out, I thought it was best
to share…hope others do the same, this forum is our best
source for info, since we are the experts…:smiley:

Has anyone here been able to get B0 & B1 work for the adress bus ?
i have B2-B7 working, yet when i set the SPCR register to 0x9C it still does not allow B0-B1 to work.

UPDATE: i got it, it was working… I just assumed that B0 & B1 would be the lower order address bus pins. BOY was i wrong. it turns out that if you enable the use of B0-B1 as address pins they turn into the two highest order address pins!!! whatch out for that when laying out a board.

Glad you got things working…
Rabbit took a non-conventional path to the Address lines…
I suspect this was due to early CPU designs of the RCM2000 processor…

Chuck

ya, i just with i would have caught it before i made my board :rolleyes: