SD card interface to LPC1114

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

SD card interface to LPC1114

2,370 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Sharadanand on Thu Dec 15 23:23:26 MST 2011
I am new to SD card interfacing. I am planning to interface SD card to SPI port 0 of LPC1114. Where can I get sample codes or application notes for SD card interfacing to LPC1114?
0 Kudos
Reply
7 Replies

2,159 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Sharadanand on Sun Dec 25 23:18:23 MST 2011
I am getting spikes  on MOSI line.... hence process cold not interface the card:(
0 Kudos
Reply

2,159 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ktownsend on Thu Dec 22 03:50:04 MST 2011
Rob:

There is still a problem with the SD card interface on the board.  Having the FET on VCC made a big difference, but I found that the SD card was still drawing current through the SPI lines when I put it in deep sleep mode (I think a couple hundred uA).  The solution was to switch the SPI pins to GPIO and low (which you should probably do anyway) before entering deep sleep, but a HW solution might have been cleaner from a firmware point of view.

If I redesigned those boards again I'd gate off the SPI pins as well.

Obviously it depends on what you want though ... you can have a smaller PCB doing it in SW, or easier wakeup/sleep code doing it in HW (at the expense of an extra $0.50 in parts and more PCB space).

But to get back to the original question ... hooking up an SD card is super-simple ... just four lines and probably a pullup on the select pin, plus power.  The SW is where all the work is in this case.

Kevin
0 Kudos
Reply

2,159 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed Dec 21 15:28:54 MST 2011
Kevin,

thanks - some nice design ideas for my new board.
For low power application you definitely want the FET in the power line to the SD card - I've seen my SD card draw a steady 4 mA (my board, including LCD module) takes about 13 mA so +4 mA for just the SD card is a lot...

I also should to the FET for the VCC measurements, I now use 1 Mohm resistors but that introduces too much noise (I only need to measure once every minute or so to monitor the LiPo batteries charge state).

I've still got 5 pins left on my lpc1754 - better give them something to do :D

Cheers,[INDENT]Rob
[/INDENT]
0 Kudos
Reply

2,159 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by ktownsend on Wed Dec 21 14:35:02 MST 2011
It's pretty simple ... it's just a standard SPI connection plus a GPIO pin if you need/want to detect if a card is present (depending on the connector).  Here is another schematic showing this ... just drop all the extra stuff on the VDD pin ... it's just there to keep the power consumption as low as possible when going into deep sleep mode.  Just connect VDD to 3.3V if you don't care about sleep modes, etc.

http://www.microbuilder.eu/Projects/LPC1114_AT86RF212.aspx
0 Kudos
Reply

2,159 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Sun Dec 18 23:15:21 MST 2011
I could not find schematics for the lpc1114 with SD card but I know there is a very nice reference design at microbuilder.eu. Look here for the lpc1343 reference design, the differences between lpc1343 and 1114 are - from a hardware I/O pin point of view - not that big.
You should be able to connect your SD card to the lpc1114 using the schematics found there.

Rob
0 Kudos
Reply

2,159 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Sharadanand on Sun Dec 18 22:21:17 MST 2011
Where can I find the circuit diagram for interfacing SD card to LPC1114
0 Kudos
Reply

2,159 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Fri Dec 16 00:13:46 MST 2011
Sharadanand,

use FatFS that is a complete SD card module with an SPI interface.
There is an NXP Application Note for the lpc17xx series, you will need to change some low level stuff but the implementation is close enough.

There is a complete working implementation for the lpc1114 on microbuilder.eu. I never used this but I created my own test application containing FatFS and a simple interface to test the SD card.
Check out this page, there is my test app as a complete project.zip archive that you can import - you do need to add the CMSIS for the lpc11xx and change all references from lpc17xx to 11xx.
The only thing here that is really biting you might be the clocking.c file in the mcu project. I've never tested this on the lpc1114 so it might be best to strip this part from your project.

Regards,[INDENT]Rob
[/INDENT]
0 Kudos
Reply