NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Microcontroller Programming » Storing data on a flash drive

May 05, 2011
by raaustin
raaustin's Avatar

I have an application where are I am continuously reading the ADC of the 328P, binning the data into a histogram and, every ten seconds, writing the contents of the histogram to the com port, where it is read by a visual basic program running on my PC. Instead of this, I would love to have a standalone device that is dumping the histogram contents onto a USB flash drive, which can later be plugged into my PC for further analysis. Can anybody help me to figure out how to do this?

Thanks in advance, Robert

May 05, 2011
by Rick_S
Rick_S's Avatar

An SD memory card would be an easier option. There are libraries to help with that. To do a USB flash drive would require host software on the AVR that would be quite a bit more complex.

May 14, 2011
by Linkster
Linkster's Avatar

raaustin , Great ideal. I was thinking the same thing but no ideal as how to approach this project. Keep posting here on this thread if you should come up with something and I'll do the same.
I'm also thinking of time stamping onto some type of memory device for later retreival. Just don't know where to begin. The magic will be in the flash drive programming.
Why would an SD card be easier rick?
Gary

May 14, 2011
by Rick_S
Rick_S's Avatar

Because an SD card uses the spi bus. USB has a lot of communication/validation required to make it work.

May 14, 2011
by Linkster
Linkster's Avatar

Thanks Rick,
Are there any examples or posts on the NK forum using a SD card that you can recall? I would love to read up on this.
Gary

May 14, 2011
by bretm
bretm's Avatar

Here's someone who did an SD card reader to play music, and added code for SD card writing as well. I haven't tried it out.

It would probably be easiest just to run the MCU at 3.3V instead of trying to shift all the signal levels. So you may need one of these.

Post a Reply

Please log in to post a reply.

Did you know that you need to think about wires differently when you're transmitting signals more than a few inches? Learn more...