SPI interface with NOR Flash MX25L4006E

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

SPI interface with NOR Flash MX25L4006E

4,259 Views
farid_mabrouk
Contributor II

I am trying to interface with this LPSPI flash: https://static6.arrow.com/aropdfconversion/74f71a4d24defb900f21183aac8a0329d8ea28d0/mx25l4006e203v20...

 

using LPSPI on IMX RT1062. I need to send 256 bytes of data plus 4 bytes of command ( as per page 41 figure 22 of the datasheet). I figured I need to have 2080 bits per frame ( 2080 spi clock cycles): masterConfig->bitsPerFrame = 2080.

 

but this does not seem to work. When I look at the data I want to send on the scope, it appears it somehow changed: not correct

Is it even possible to send a total of 260 bytes in a single transfer? if so please advise how?

 

https://static6.arrow.com/aropdfconversion/74f71a4d24defb900f21183aac8a0329d8ea28d0/mx25l4006e203v20...

 

Thank you

0 Kudos
Reply
7 Replies

4,245 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
To provide the fastest possible support, I'd highly recommend you refer to the LSPI demo in the SDK library to do that.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

4,232 Views
farid_mabrouk
Contributor II

Thanks for your reply.

I looked at the example code you have for LPSPI and I even implemented SPI interfaces for 4 bytes transfer in the past, I want to know how you send 64 bytes in a single transfer. can you send some psuedo code?

 

0 Kudos
Reply

4,223 Views
fmabrouk
Contributor III

Please see attached screen shot:

 

I am trying to send a sequence of bytes from 0x00 to 0x09. It looks like the SPI driver takes the first 4 bytes and send them starting from the MSB byte and then takes the next 4 bytes and so on..

I need to send Byte by Bytes starting either from the MSB byte or LSB bytes in the array. How do I need to set up my SPI to get what I want.

Your help is urgently needed!

0 Kudos
Reply

4,211 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
According to your statement, you want to continue to transfer a series of data while keeping PCS asserted, isn't my understand right?
If yes, the LPSPI supports this continuous transfer feature, the below figure shows the continuous transfer state, it indicates the dynamic signals when the MCU run the lpspi_edma_b2b_transfer_master demo.

jeremyzhou_0-1608629411531.png

 


Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

4,205 Views
fmabrouk
Contributor III

Great! I fixed my issue.

 

what is the maximum clock frequency this LPSP peripheral support?

Regards,

Farid

0 Kudos
Reply

4,200 Views
jeremyzhou
NXP Employee
NXP Employee

Hi,
Thanks for your reply.
1) What is the maximum clock frequency this LPSP peripheral support?
-- The maximum clock frequency of LPSPI is 30 MHz, it mustn't exceed this frequency.
Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 Kudos
Reply

4,160 Views
fmabrouk
Contributor III

Thank you for your help!

0 Kudos
Reply