Powered by Invision Power Board


Forum Rules Forum Rules (Please read before posting)
  Reply to this topicStart new topicStart Poll

> Writing To A Sd Card Using Spi
David Stephenson
Posted: June 01, 2015 07:04 pm
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 165
Member No.: 2,918
Joined: July 25, 2005




Has anybody here tried this? I've spent a long time going through SD card specs.

I've got to the stage that the card I have initialized the card using CMD0 followed by CMD55/ACMD41.
I set the block size (CMD16) then a block write (CMD24) and I get back the expected data accepted byte containing 010 in bit positions 1,2 and 3.

Problem is I've tried it on 4 cards (64 MB, two 1GB and a 4GB) only the lower capacity card has had a data block written to it despite all commands for all cards getting correct responses.

Setting the HCS bit in ACMD41 does not help, and prevents the 64 MB card from working
PMEmail Poster
Top
Colt45
Posted: June 01, 2015 08:09 pm
Reply to this postQuote Post


Forum Addict ++
*******

Group: Trusted Members
Posts: 4,399
Member No.: 1,333
Joined: October 02, 2004




Maybe you're not addressing it right? some are addressed by block of 512B, other older cards only by byte. I ran into trouble with that once.


--------------------
>]:::|-
PMEmail PosterICQ
Top
David Stephenson
Posted: June 02, 2015 11:54 am
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 165
Member No.: 2,918
Joined: July 25, 2005




Yes the 64 MB is using byte addresses.
The larger ones I don't know as no data seems to be going on to them.
I am testing by putting in address 512 the data should either show up at byte 512 or block 512 - it doesn't.
PMEmail Poster
Top
David Stephenson
Posted: June 24, 2015 03:33 pm
Reply to this postQuote Post


Member
****

Group: Trusted Members
Posts: 165
Member No.: 2,918
Joined: July 25, 2005




I've finally managed to write to the larger capacity cards. There is still something strange happening though.
The 64 MB card putting in CMD24 with the address 0,2,0,0 puts the data in block 256 as expected. (block = 2*65536/512)
The 1GB card with CMD24 and address 0,2,0,0 puts the data in block 7 and 0,3,0,0 puts the data in block 135. Seems to be no logic to this
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 


:: support us ::




ElectronicsSkin by DutchDork & The-Force