Help - LPC1768 - Interfacing

Hello everyone , My name is Sriram. I am a engineering student. I have been wanting to interface a Micro SD card using LPC1768 micro-controller , I have tried learning to use SPI protocol but wasn't able to. If anybody could provide me any suggestions or any material on how to go forward with following would be very helpful for me:

  1. Using Spi Protocol in brief with an example
  2. Interfacing a SD card using LPC 1768
  3. Take a image file from the SD card and view it on your TFT.

Thank you very much for passing by, If you could please ask someone and let me know would be very much appreciated.

Thank You

--------------------------------------- Posted through

formatting link

Reply to
sriram16
Loading thread data ...

Take a look at the CMSIS library code and examples. There should be a link to it somewhere on the NXP web site. It may not have much specific to the SD card, but it has lots of material regarding the care and feeding of an SPI interface.

Reply to
Frank Miles

On 2015-12-17 sriram16 wrote in comp.arch.embedded:

Which peripheral are you using? There is a legacy SPI peripheral in the 1768 that can do the job, but is very limited. If available, it may be better to use the SSP. From the user manual:

"Remark: SSP0 is intended to be used as an alternative for the SPI interface. SPI is included as a legacy peripheral."

But you should be able to get SPI working with the SPI peripheral. The SPI peripheral does not control the chip select signal in master mode. So set the \CS pin as GPIO and let your code handle this. I also found the read/write code from the LPCXpresso chip library not that user friendly and as they also claim to read/write 'the FIFO' (which is not present on the 1768 SPI), I decided to handle the read/write in my own code, but I still use the 'low level' setup and read/write register functions.

Which development environment are you using?

The LPCXpresso (eclipse) environment includes all the CMCIS examples mentioned by another poster. You can find that here:

formatting link

formatting link

And one thing I remember about SD card reading using SPI: Make sure to have enough clock pulses around \CS changes to let the card handle those changes. See card dataheets and SD specifications.

--
Stef    (remove caps, dashes and .invalid from e-mail address to reply by mail) 

The qotc (quote of the con) was Liz's: 
	"My brain is paged out to my liver."
Reply to
Stef

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.