How to read/write external memory using EBI module

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to read/write external memory using EBI module

1,396件の閲覧回数
jagadeeshalaksh
Contributor II


Hi Team,

 

I am new to MPC5566, trying to interface MR4A16B SRAM to MPC5566 using EBI module.

- I configured EBI register

- Configured corresponding SIU_PCR register to select the requried functionality.

 

Now, my doubt is how to Read/Write address/data... which register i need to use to write/read.

eg: CS[0] functionality is choosen from SIU_PCR register. if i want to make CS[0] line HIGH or LOW how to drive?

 

PLease help in understandig this and to solve.

 

 

Regards

Jagadeesha

ラベル(1)
1 返信

1,003件の閲覧回数
davidtosenovjan
NXP TechSupport
NXP TechSupport

CW stationery contains initialization for the external memory that is present on EVB. See file MPC5566_HWInit.c, function INIT_ExternalBusAndMemory.

Internal address space is defined fixed within range 0x2000_0000-0x3FFF_FFFF. That’s fixed.

For particular chip selects you can select ranges (that must be within EBI range above and not overlapped) using base address EBI_BRn[BA] and address mask EBI_ORn[AM]. Address mask actually specifies size of address space addressed by particular chip select.

Base address and mask are both in format: 0b111x_xxxx_xxxx_xxxx_x000_0000_0000_0000

Ones from left side are taken from EBI fixed address range and zeros from right side specifies address granularity that is minimum CS addressable area (2^15 = 32kB).

CS lines are automatically driven during access to the particular CS area, for instance see following read and write considering basese address is set for 0x20000000:

vuint32_t longword0 = 0;

/* test write */

*(vuint32_t*)(0x20000000) = 0xBABADEDA;

/* test read */

longword0 = *(vuint32_t*)(0x20000000);

Note that also MMU table entry must be set properly to allow access to external bus space (function INIT_ExternalBusAndMemory handles it as well).