Keil Logo Arm Logo

Discussion Forum

External memory interface

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Details Message
Read-Only
Author
Andrew Messier
Posted
7-May-2007 20:22 GMT
Toolset
ARM
New! External memory interface

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

Read-Only
Author
Robert McNamara
Posted
7-May-2007 21:45 GMT
Toolset
ARM
New! RE: External memory interface

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)

Read-Only
Author
Andrew Messier
Posted
7-May-2007 22:11 GMT
Toolset
ARM
New! RE: External memory interface

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?

Read-Only
Author
Robert McNamara
Posted
8-May-2007 02:02 GMT
Toolset
ARM
New! RE: External memory interface

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.

Read-Only
Author
Andrew Messier
Posted
8-May-2007 03:03 GMT
Toolset
ARM
New! RE: External memory interface

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.

Next Thread | Thread List | Previous Thread Start a Thread | Settings

Keil logo

Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.