Shop OBEX P1 Docs P2 Docs Learn Events
SD Card questions — Parallax Forums

SD Card questions

TCP71TCP71 Posts: 38
edited 2011-06-13 15:03 in Propeller 1
Hello,
I am trying to interface a microSD card to the propeller to store a number of text files. The files would be written at random intervals(every few minutes) and be available as backup information if data were lost elsewhere. I have the card wired up like this:

Prop(p24) - 1k(resistor) - SD(pin2 - chip select)
Prop(p25) - 1k(resistor) - SD(pin3 - DI)
Prop(p26) - 1k(resistor) - SD(pin5 - CLK)
Prop(p27) - 1k(resistor) - SD(pin7 - DO)

with SD(pin5 at 3.3V) and SD(pin7 at GND) and SD(pin9 at GND)

I am trying to run this in SPI mode using SD3.01 FATEngine code and basically starting the SD card at boot, then as data arrives, creating the appropriate file, dumping the data in (250bytes/file or so), then closing the file and waiting for the next data. Files could well be arranged in simple increasing numerical format. Find the highest number already on the card and add 1 to create the newest file.

A few questions:

On boot, I run the following:

CON

_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

CardCS = 24 'SDcard Chip Select pin
CardSDI = 25 'SDcard Data In pin
CardCLK = 26 'SDcard Clock pin
CardSDO = 27 'SDcard Data Out pin


OBJ

CARD : "SD3.01_FATEngine"

Pub Main

CARD.FATEngineStart(CardSDO, CardCLK, CardSDI, CardCS, -1, -1, -1, -1, -1) 'Set up Card functions

After that, what do I need to do to make the card "work". Mount the partition? What partition would that be on a blank card? Do I need to CD to the root directory? Does it default to the root DIR? I've tried looking at the FATdemo but it isn't really helping. As you can tell, programming is not my Forte. Any and all help appreciated. Be gentle.

Comments

Sign In or Register to comment.