Go Down

Topic: Arduino Mega 2560 - troubles with LC Studio card reader (Read 1 time) previous topic - next topic

olegigst

Aug 11, 2012, 02:22 pm Last Edit: Aug 11, 2012, 02:26 pm by olegigst Reason: 1
Hi everybody!

I'm using SdFat lib, Arduino Mega 2560 and such a SD card reader:
  http://img.alibaba.com/img/pb/914/939/371/371939914_193.jpg

I've connected pins like it's written in Arduino Mega datasheet:
   MOSI - pin 51
   MISO - 50
   SCK - 52
   
CS from card reader is connected to pin 53, and I specify chipSelect as 53 when calling SdFat::init. Card is initializing without errors and I can read files.

But I have troubles with writing files. I can't open file with a trunc flag - I get 0x13 error; also I can't change it's size, e.g. if file is of X bytes, then having opened it in write mode, I can't write more than X bytes and expand it. Also I can't delete file. (card isn't locked, of course, I've checked it ). I tried to supply card reader either  with 3.3V and 5V, results are the same. I was advised to slow down SPI speed, I also tried it, but it didn't work even with one sexteenth of clock speed.
I have no idea what to do with it.

I used that same card reader and SdFat with Uno, and all worked fine.


LibertyCareche

Quidquid agis, prudenter agas, et respice finem !

h_vestbo

I also have problems with this.
Everythings seems to work fine, Cardinfo is showing....

But Im not able to write to a file..
Would apreciate if anyone knew whats causing this problem....

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy