Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Exhibition / Re: SD card read/write with Arduino on: May 07, 2010, 01:00:02 pm
Hi Nnk,

I found a pattern while comparing the data in your file and the data that is displayed in the monitor window. If you break the file data in blocks of 7 characters (the last caracter of a line, break line, counts as a caracter), and you keep only the last caracter of each block, then you can reconstruct what you are seeing in the monitor window. The problem must be in the example code you use to display the caracters, but I do not see it. I suspect that by reading a single byte at a time (using uint8_t buf[1] instead of uint8_t buf[7]) it should correct the problem, but that doesnt not explain it.

I suggest that you debug the code step by step by displaying the value of 'n' and other variables to verify that the program is doing what it should.

Also, I think that going throught the 'char' intermediate step is not necessary, because the formats 'uint8_t' and 'char' are very similar. I think uint8_t is equivalent to the format 'byte', which is 8 bits unsigned, and char is 8 bits signed. But since the caracters in ASCII are encoded on a range from 0 to 127, signed or unsigned bytes make no difference.

I hope that you find the solution to your problem quickly!

Good luck,

2  Forum 2005-2010 (read only) / Exhibition / Re: SD card read/write with Arduino on: May 04, 2010, 01:33:30 pm

Do you think you could post here what is the content of the file you are reading and what you are seeing in the serial window? I'm not sure if I can help you out, but I think that information would be helpful.

Good luck!

3  Forum 2005-2010 (read only) / Exhibition / Re: SD card read/write with Arduino on: February 08, 2010, 02:38:20 am
To Nnk:

I've had problems initializing a card also, it turned out I had a bad contact between my card reader board and the header it was sitting upon. I soldered everything and it works perfectly now. You might want to verify all the electrical contacts, just to be sure.

Good luck!

Note: I use the very same circuit that you are using, except for 2 additional 100nF and 47uF capacitors between the 3.3V and GND pins next to the card (it probably works without that). I use a 2GB SD San Disk card.
Pages: [1]