writing on sdcard in sparkfun microsd shield for arduino

Hi,

I’m trying to read/write from/to a sdcard inserted in a sparkfun microsd shield for arduino

I’m programming in avr assembler (not with the arduino environment)

I can read without any problem, but when I want to write, if I select a slow speed

and interleave read/write sequences it works most of the time (one error from time to time)

when I want to “chain” write it fail. (the first write always works)

when I check the data response, after having sent data + crc I get $08 instead of $05

when the spi is at a higher speed the problem seems to be worse.

in case of error I send CMD13 (SEND_STATUS) but I receive $0000 as status

I developed this code with this document: http://www.flashgenie.net/img/productma … 2final.pdf

I’ve checked my code with examples in several application notes, but it looks ok

any idea ?

thanks

problem solved…

busy state detection problem, the first write worked not the following one.

now works without any problem