Shop OBEX P1 Docs P2 Docs Learn Events
Prop C3 & SD — Parallax Forums

Prop C3 & SD

Wael_ElEgyptianWael_ElEgyptian Posts: 3
edited 2011-05-13 17:17 in Propeller 1
Hi Folks,

My question is very simple: what are the pin assignments for the SD on the C3 platform?
I have tried the C3_SD_Demo_010.spin and it works fine. However, I wanted to write to files on the SD so I tried the fsrw.spin , but I am having troubles , the propeller does not see the SD and the card does not get mounted. I have used the following code from a tutorial on the "Gadget Gangster" ,

Here is my code:

===========================================================
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000

DO = 0
CLK = 1
DI = 2
CS = 3

OBJ
sdfat : "fsrw"
pst : "Parallax Serial Terminal"

PUB demo | mount
pst.Start(115_200)
waitcnt(clkfreq*4 +cnt)

mount := \sdfat.mount_explicit(Do,CLK,DI,CS)

if mount < 0
pst.str(string(13,"Failed to mount",13))
abort

pst.str(string(13," SD Card was found and mounted fine",13))

sdfat.popen(string("Text.txt"),"w")
sdfat.pputs(string(" Hello World!!!!!!!!", 13, 10))
sdfat.pclose

sdfat.unmount

================================================

Comments

  • prof_brainoprof_braino Posts: 4,313
    edited 2011-05-12 06:12
    Hi Wael_ElEgyptian

    Could you edit you post and put the "code" tags around your code? "/code"

    It makes it easier to read the spin.

    If you replace the double quotes " " in the example line with square brackets [ ] it comes out like:

    Could you edit you post and put the
    tags around your code?
    
  • TharkunTharkun Posts: 67
    edited 2011-05-12 08:59
    the propeller does not see the SD

    On the C3 the SD pins are not directly connected to the prop, you have to initialize the hardware SPI interface I/O pins from propeller to card.

    Look here: C3_SD_DRV_010.SPIN, PUB SPI_Init(mode)
  • RsadeikaRsadeika Posts: 3,837
    edited 2011-05-12 11:41
    I think the question that he is asking is, what is the secret. I believe he is looking for something more specific, than "go look at some exiting examples". Soon I will have to venture down that road myself, so, if anybody has a more specific answer, that would help at least two people.

    Ray
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-12 11:48
    There's not a simple answer. Look at the C3 documentation here. In particular, look at "Unleashing the Prop C3", pages 21-24 and 36-38.
  • RsadeikaRsadeika Posts: 3,837
    edited 2011-05-12 13:11
    Wael, I guess you will have to fend for yourself. You may want to try the Gadget Gangster PP USB, that has an easier way of using the uSD card.

    Ray
  • JT CookJT Cook Posts: 487
    edited 2011-05-13 17:17
    We ran into this problem as well, so we modified some of the existing drivers (I think mostly done by David Betz) and I was able to use those consistently. Take a look at the programs here:
    ftp://ftp.propeller-chip.com/PropC3/Games/Jay_T_Cook/jtc_c3_bootloader_v002/jtc_c3_bootloader_v002/
Sign In or Register to comment.