LPC SPI

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

LPC SPI

1,191 Views
sveer9211
Contributor I

Dear Sir,

 I am currently working on the  LPC1549 SPI protocol . i want to interface  a SPI flash to the  LPC1549 

i am able to read the Manufacture ID and  JEDEC ID but reading and writing of bytes or pages in not possible .

kindly give me some direction to proceed 

Labels (1)
0 Kudos
Reply
3 Replies

846 Views
sveer9211
Contributor I

thanks all for the reply i got SPI in working condition  again thanks to all who responce in mean time .

0 Kudos
Reply

846 Views
ianbenton
Senior Contributor I

The usual trap for the unwary is the "write enable" command. This has to be sent before EVERY write instruction.

CS low - send 0x06 - CS high.

Then send the write command:

CS low  - send 0x02, send the address, send the data - CS high.

Also, there is generally a limit on how much data you can send it one go.

And on SOME devices, pin 3 (Write protect) has a pull up, so you can leave it floating, and on OTHER devices it doesn't, so it won't write unless it is connected to V+.

Read isn't usually a problem, it will read 0xFF if it is new.

0 Kudos
Reply

846 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Lakhbir Singh,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
I'd highly recommend you to visualize the SPI wave via the oscilloscope or logic analyzer when writing or reading SPI flash, then comparing with the standard process which is illustrated in SPI flash's datasheet, it will help you to figure the root cause out.
Have a great day,
TIC

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

0 Kudos
Reply