We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I'm using an STR710fz2 ARM7 processor, and I need to interface with the external memory bus. The datasheet discusses timing and wait states, but I haven't seen any software application examples that actually show how to implement this interface. Does anyone have any example code?
Thanks, Andy
GPIO_Config(GPIO2, 3, GPIO_AF_PP) EMI->BCON0 = 0x800D; EMI->BCON1 = 0x800D;
Will enable external memory interface banks 0 and 1, 16-bit wide interface and set them to 3 wait state access time. After this, ny memory access in the 0x60000000 (bank 0) or 0x62000000 (bank 1) will select the apporopriate Chip select lines, address lines and RD/WR lines (and use the data lines either in or out)
So having done this I can do the following?
{
short *dataPtr = 0x60000020;
short data = 0x50FA;
// write a byte to external memory
*dataPtr = data;
// read a byte
data = *dataPtr; }
Will this write and read a 0x50FA word at location 0x20 on bank 0?
Yes, if you have external memory connected to bank 0 (address lines, data line, CS0 and RD/WR) and it works with 3 wait states or less.
You can also create a region of memory called something like EXT0 that the compiler and linker know of and have variables assigned to this region, possibly even all of your variables.
Thanks. That's easier than I expected.
I'm actually not using it for memory, but the external UART I'll be using uses the bus interface.