Store ADC adc output on SD

Hi there.

I wont to store the Arduino due adc output on a SD. How can i do that? Do i need a SRAM twin buffer? Can the SD library help me?

Thanks in advance!

The DAC output is a voltage between 1/6 * 3.3V and 5/6*3.3V, so I guess you mean " I want to store the values I write in my DAC (DAC->DAC_CDR = your_value;) " ?

The most appropriate media to store your buffered values depends on:

1/ size of buffer, 2/ time to keep the values, 3/ frequency of writings.

You can store in SRAM and the board will keep the values as long as the board is powered ( 64K + 32 K contiguous SRAM + 4K non contiguous SRAM ), or in Flash (see DueFlashStorage.h library, 512 K Flash) or on an external SD card (see SdFat.h library).

Warning: Flash tends not be good for too many write cycles (perhaps 100k).

If you need to write frequently a hugh buffer then you should get an I2C connected EEPROM chip.

Sorry, I wonted write Adc and not Dac

DC-9818:
Sorry, I wonted write Adc and not Dac

So, you want to read a value from the ADC, using analogRead() and write it to a file using the print() method. What is the problem?

hi,

There are two steps to store data into SD card. Before that you need a SD card look here (http://www.amazon.in/Reader-Writer-Module-Socket-Arduino/dp/B008B52QQC?tag=googinhydr18418-21).

After setting up the connection, you need to initialise the SD card in the setup funtion,

I use the following code for that,

void initializeSD() { while (!Serial) { // wait for serial port to connect. Needed for native USB port only } Serial.print("Initializing SD card...");

// see if the card is present and can be initialized: if (!SD.begin(xx)) //Use the pin from where you have connected your SD crd { Serial.println("Card failed, or not present"); // don't do anything more: return; } Serial.println("card initialized."); }

ANd then create a text file and write using - "dataFile.println(xxx)"

Thanks for the quick response.

My problem is that i want to store an audio signal (44khz if is it possible) on a SD and i don't know if the function print() is enough fast, and another problem is that i would like to save the file in . WAV. I have bought an Arduino Due because is more fast (84Mhz), can it do that? I have already bought the micro SD adapter and connect the SD, but now i don't what i have to do.

Thanks in advance.