Show Posts
Pages: [1]
1  Using Arduino / Storage / Re: Corrupt TXT File Troubleshooting on: July 19, 2011, 02:44:17 am
Thanks for the offer, but as I said in the post I am programming an FPGA and my logic is instantiated using Verilog. I am not sure if posting Verilog code would be tolerated on this forum.
2  Using Arduino / Storage / Re: Corrupt TXT File Troubleshooting on: July 15, 2011, 02:08:41 pm
Thanks for the response and that's too bad. I have seen that there are some utilities that can repair corrupted files. Do you have any recommendations for which ones work well?
3  Using Arduino / Storage / Corrupt TXT File Troubleshooting on: July 15, 2011, 01:19:56 pm
Hello everyone. After experimenting with my Arduino board I programmed an FPGA to write data to a SD card. When I write a text file to the card and then over write the txt file I am able to open the text file with no problems. When I format the card and write a new txt file to the card windows give me an error message saying the file is corrupt. In both cases the card is receving the same data from the host so I am at a bit of a loss as to why one works and one does not.

What is the best way to determine why windows thinks the file is corrupt? I have used win hex to look at the bytes on the card and the file that windows can open and the file that windows says is corrupt look the same to me.

Thanks
4  Using Arduino / Storage / Re: SD card datalogging files library on: May 24, 2011, 09:22:35 am
thanks Carl, after looking at the datasheet clock / 128 is as slow as I can go.
5  Using Arduino / Storage / Re: SD card datalogging files library on: May 23, 2011, 01:59:26 pm
Thanks carl, I have aother question when you get a chance. How do I reduce the spi clock rate more than the x/128 and x/4 that you have for setup and data writing? I experimented with some values but none of them worked.  
6  Using Arduino / Storage / Re: SD card datalogging files library on: May 18, 2011, 02:18:35 pm
I have a simple question. Is the sd card chip select pin defined in the SDCARD.h library in these lines?:

#define selectSDCARD PORTB &= ~0x04;  //set the SS to 0 to select the sd card
#define deselectSDCARD PORTB |= 0x04;  //set the SS to 1 to deselect the sd card

It looks like CS is mapped to pin 4 right?

By the way, a big thanks to carl47 this is great!
7  Using Arduino / Storage / Re: SD Libraries on: May 06, 2011, 02:37:09 pm
thanks for your help Grag38. After looking at Sd2Card.ccp I figured out it is doing this:

1.Sets I/Os for card, MISO, MOSI, SCK, and chip SelectPin
2.Set CS high write 80 bit logic high MOSI (10 bytes 0xFF)
3.Set CS low
4.write CMD0
5.look for idle response R1 (0000_0001 8’b)
6.write CMD8 with argument 0x1AA
7.read last byte of the R7 response
8.if the last byte is 0xAA the card is SD_CARD_TYPE_SD2 (in our case it is)
9.Issue Acmd41 by first sending Cmd55
10.read last byte of the R7 response for both comands

This agrees with the SD physical layer spec document so that's great.

My next question is when the datalogger program executes the line:

File dataFile = SD.open("datalog.txt", FILE_WRITE);

I want to figure out what is going on in that level of detail. Which library or libraries should I look at to figure out how the text file is created, how the file name is assigned etc.

Thanks
8  Using Arduino / Storage / Re: SD Libraries on: May 05, 2011, 01:25:58 pm
this looks promissing, thanks
9  Using Arduino / Storage / Re: SD Libraries on: May 05, 2011, 01:07:07 pm
Sorry, I must have phrased my question incorrectly. I understand that the SD.h file defines the open command for example:

File open(char *filename, uint8_t mode = FILE_READ);

but what I want to figure out is what bytes are written to the MOSI pin when your c code in the data logger program has the values:

File dataFile = SD.open(“datalog.txt”, FILE_WRITE)

I am not a software ninja (I am an EE) so if I missed something in the SD.h or SD.cpp file I apologize. I imagine the bytes written to the mosi port would be something like:

58 hex for example (CMD24 or CMD25 write command), a response on MOSO, then the data block with the ascii code for d a t a l o g . t x t and some other stuff.   

What I want to know is where is this defined, any help with what line in the file it is defined in would be greatly appreciated.
10  Using Arduino / Storage / Re: SD Libraries on: May 05, 2011, 12:43:24 pm
thanks I'm going to take a look at them now
11  Using Arduino / Storage / SD Libraries on: May 05, 2011, 12:22:49 pm
Hello everyone, I am trying to figure out how the sample data logger program works in detail, specifically what commands and data are written to the SD MOSI port, what is read from the MOSO port. Referencing the library’s in the Arduino 0022 package which library files should I be looking at to see how the SD.begin(), SD.open(), println() and close() sends and receives data to the card’s spi port.


Thanks in advance 
Pages: [1]