FLEXBUS 16 bit data path, write to 8 bits only.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FLEXBUS 16 bit data path, write to 8 bits only.

958 Views
denniskelley
Contributor I

I am using a K64's Flexbus to access a 2Mx16 SRAM and a 2Mx16 NandFlash part. I set it up for 16 bit data and a non-multiplexed address bus of 21 bits. What will happen if my code tries to access a variable that is only 8 bits, or a 16 or 32 bit variable that is not aligned to the 16 bit address? Do I have to use an SRAM that has the BHE and BLE inputs to be abe to do a write to a byte variable without affecting the other byte in the 16 bit memory location?

0 Kudos
Reply
3 Replies

785 Views
denniskelley
Contributor I

OK, but why do I start with FB_AD1 and not FB_AD0 ?  Or is that just how the Flex_Bus works when you want to use the BHE and BLE to access bytes when needed?  How does the processor know when to do an 8 bit write using BHE or BLE instead of using both to do a 16 bit write?

0 Kudos
Reply

785 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,  Dennis,

As you know that the Kinetis is byte access, if you use 8 bits data width, you should start with FB_A0, If you use 16 bits data width, you should start with FB_A1, if you use 32 bits data width, you should start with FB_A2. in the above case, you can use FB_BEn to select the respsective byte.

Hope it can help you

BR

Xiangjun rong

0 Kudos
Reply

785 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Dennis,

First of all, let's discuss the SRAM connection, you connect the 2M*16bits SRAM with nonmultiplexed mode, you can connect the address FB_AD_16~FB_AD31 to the SRAM data bus, connect the FB_AD1~15,FB_A16~FB_A21 to the A0~A20 of the SRAM address, in order to access in byte mode, you have to connect the BHE and BLE pin of SRAM to  FB_BE_31_24 and FB_BE_23_16 pin, connect the WR and RD to FB_R/W and FB_OE, it is okay.

Hope it can help you

BR

Xiangjun Rong

0 Kudos
Reply