Mod54415 Multiple Chip Select
Posted: Thu Jun 05, 2014 7:59 am
Hi all,
I hooked up some 573 and 574 to add some GPIO to the system. In all I need something like 32 Inputs and 32 Outputs and another 32 mixed GPIO. Since this monster is 32 bits and has 3 chip selects that I can use, I figured I could do it. So I started with the inputs everything went well and is working perfectly (well haven't tried to connect all 32 bits but the first 8 bits are working fine). I used 0x1000000 as base address for CS1(inputs). After that I tried the outputs. And this is where I noticed something strange. I used 0x11000000 as base address CS4(outputs). Both csmr are set to 0x00000001 so, from what I understand of the documentationof the coldfire core, the address range for the inputs is supposed to be 0x10000000 to 0x1000FFFF and the range for the outputs is supposed to be 0x11000000 to 0x1100FFFF. However, everytime read from any address reserved for the chipselect, all chip select are asserted at the same time. So if I have only the inputs if works... if I have only the outputs it works but as soon as both are connected the input overwrites the outputs.
I based my code from the Databus-IO-Expansion Application note:
http://www.netburner.com/support/docume ... ion-5/file
Thing is the example for the code is made for 5234 5270 and 5282 modules. So I had to adapt it the the 54415. But since I didn't find much example about how to do it with this particular module, I Wonder if there is something to know about the chip selects or about how to get data from external parallele devices.
when I write to the port I use:
*(unsigned int *)(ADDR_IO_OUTPUTS) = Value;
when I read to the port I use:
return *(unsigned int *) (ADDR_IO_INPUTS);
Is there another way to do it with the MOD54415 that would make the chip select work as they should?
Just for more information, I use 7 serial ports, ethernet and the EFFS FAT file system on this module. So far everything runs smoothly except the GPIO expention that I'm trying to implement.
CS1 is configured as follow:
csar = 0x10000000
cscr = 0x00000010
csmr = 0x00000001
CS4 is configured as follow:
csar = 0x11000000
cscr = 0x00000010
csmr = 0x00000001
I know that in the example they are shifting the address to the right 16 bits... but from what I read of the doc AND from what I've tester so far... for the 54415 this register is 32bits so no shifting
Thanks in advance for your help!
I hooked up some 573 and 574 to add some GPIO to the system. In all I need something like 32 Inputs and 32 Outputs and another 32 mixed GPIO. Since this monster is 32 bits and has 3 chip selects that I can use, I figured I could do it. So I started with the inputs everything went well and is working perfectly (well haven't tried to connect all 32 bits but the first 8 bits are working fine). I used 0x1000000 as base address for CS1(inputs). After that I tried the outputs. And this is where I noticed something strange. I used 0x11000000 as base address CS4(outputs). Both csmr are set to 0x00000001 so, from what I understand of the documentationof the coldfire core, the address range for the inputs is supposed to be 0x10000000 to 0x1000FFFF and the range for the outputs is supposed to be 0x11000000 to 0x1100FFFF. However, everytime read from any address reserved for the chipselect, all chip select are asserted at the same time. So if I have only the inputs if works... if I have only the outputs it works but as soon as both are connected the input overwrites the outputs.
I based my code from the Databus-IO-Expansion Application note:
http://www.netburner.com/support/docume ... ion-5/file
Thing is the example for the code is made for 5234 5270 and 5282 modules. So I had to adapt it the the 54415. But since I didn't find much example about how to do it with this particular module, I Wonder if there is something to know about the chip selects or about how to get data from external parallele devices.
when I write to the port I use:
*(unsigned int *)(ADDR_IO_OUTPUTS) = Value;
when I read to the port I use:
return *(unsigned int *) (ADDR_IO_INPUTS);
Is there another way to do it with the MOD54415 that would make the chip select work as they should?
Just for more information, I use 7 serial ports, ethernet and the EFFS FAT file system on this module. So far everything runs smoothly except the GPIO expention that I'm trying to implement.
CS1 is configured as follow:
csar = 0x10000000
cscr = 0x00000010
csmr = 0x00000001
CS4 is configured as follow:
csar = 0x11000000
cscr = 0x00000010
csmr = 0x00000001
I know that in the example they are shifting the address to the right 16 bits... but from what I read of the doc AND from what I've tester so far... for the 54415 this register is 32bits so no shifting
Thanks in advance for your help!