DUE ADCS for audio

I am playing around with the pedalshield - open source arduino DUE guitar pedal.
The problem with this pedal is that its extremely noisy.
One reason for this is said to be the 12 bit ADCs of the DUE.

So i think of using a high quality external ADC to feed the DUe with clean digital input.
So what do i choose for my ADC specs? The 12 bit adcs are inadequiate. how many bits should my ADCs be so that its not noisy? And other factors ot take itno consideration?

If you want to know the noise your ADC ouptuts, I suggets you read this article:

The Due DAC and ADC are poor performers, the effective number of bits is less than 12.

For HiFi any I2S ADC will be fine, they are 16 to 24 bit typically and stereo - and the Due has I2S capable
hardware but I'm not sure if there's a library to drive it - could be a complex and involved project if not.

Faliing that go for a 14 bit minimum SPI ADC with 50kSPS or more, that should give 80dB S/N or so.

This thread may explain how bad the Due analog stuff is: Horrific DAC noise on DUE board - Arduino Due - Arduino Forum
(It talks about the DAC, but the ADC has issues too, I think related to the process used for
the SAM chip being unsuitable for quality analog circuitry, or perhaps the digital noise on
the chip being far too high to allow analog circuitry to work)

A few thoughts for the ones interested by using the (not perfect) embedded ADC and DAC controllers :slight_smile: :

The ADC controller is a cyclic pipeline 12-bit 1 msps ADC with differential input mode and programmable gain stage (datasheet page 1318). As stated in the article of reply # 1, this ADC controller is not a perfect one, however a technique to correct for some errors is to calibrate with an appropriate method. Offset and gain error parameters of this ADC can be improved by calibration, this Atmel Application Note gives all details:
http://www.atmel.com/Images/doc11106.pdf

In free running mode, the maximum of 1 msps gives some room to operate calibration and averaging. The MLA assembler instruction (Multiply with Accumulate, 32-bit result, 2 clock cycles) is well suited for that purpose.

On the other side, the DAC controller is well known to output a voltage between 1/63.3 and 5/63.3. However there is a remedy for this and with a gain G = 1.5, the output of this circuit has the desired range from 0 to 3.3V:
https://create.arduino.cc/projecthub/ArduPic/how-to-modify-analog-output-range-of-arduino-due-6edfb5?f=1

BTW for those interested by a bipolar analog I/O with a DUE, you might be interested by this:
http://ardupiclab.blogspot.fr/2015/10/

Mark thanks! I already read that article!

Well here is the deal. There is a sinewave program on my peadal that works fine! That means the DACs are ok!

The problem is only (i guess) the ADCs.

So i was considering replacing with an external. To have quality sound of my guitar from the output of my amp, do i need 16 bits? Or maybe 16 bits its too little? Also, bear in mind that the DUe has about 86k RAM. I have a big array (uint16_t sDelayBuffer0[40000]:wink: but now i am using the 12 bits ADCs. If i use more bits (say 16) then the arraay will be filled more quickly right? And so effects like delay will be shortened in their duration, am i correct?

Ard_Newbie thanks so much for these article! Do you think it might be possible to completely remove the noise with these techniques? I will have to study them extensively and start coding!

You might want to read this, Enhancing ADC resolution by oversampling:
http://www.atmel.com/images/doc8003.pdf

http://www.analog.com/en/analog-dialogue/articles/adc-input-noise.html

Adding 1 LSB of white noise to the analog input enhances the AD conversion. The DUE has a True Random Number Generator (TRNG) which passes the American NIST Special Publication 800-22 and Diehard Random Tests Suites.

The TRNG is able to provide a white noise (with a Gaussian characteristic) thru a DAC.

And there is a Library for the Arduino DUE SSC in I2S mode, ArduinoDueHifi:

Thank you so much!
Sorry for the late reply but i had a ton of stuff to absorb and learn!

These are what i got:
*Oversampling. You need (4^n * Fniquist), where n = number of bits. For the Due ADC this is 12. That is a lot of samples. Even if i did that, the buffer that holds my values would be filled very quickly. In practice, this means that guitar sound stored in buffer would be extremely small, making effects like delay useless. So it is out of the question.

*This article (http://www.djerickson.com/arduino/due_adc.html) was awesome! Especially the AREF method and reducing ADC time via changes in the settings code. I will read more into this!

*Calibration and averaging. These methods seem ok in general though i don't understand them completely. I think the correction margin i get will be small (i have TONS of noise)

*The meat of the info you sent me was this library: https://github.com/delsauce/ArduinoDueHiFi
This was so awesome because it uses the ADC of the codec. Though i have some questions about using codecs.
The way i do things in my code, i get the ADC values (the audio in from my guitar) and store it into a buffer.

uint16_t sDelayBuffer0[40000];

This buffer alone almost flls up my entire DUE memory. I t can hold a maximum delay to a little less than 3 seconds.

So after the guitar input is stored, effects are applied to it and then it is sent to the DACs.

How do i implement effects with an external codec? Can the codec "send" me the quantized values so i can store them inside my DUE's RAM so i can apply the effects? Can this library help me with getting the info from the codec to store inside my uint16_t buffer?

The documentation is rather poor, but i think this lib has what i want to finish my project! I think 24 bit values are too much, i will use 16 bit ADCs. And if i can store them from the codec, i will figure out a way to deal with their size. Maybe use an external memory. It needs 100 us to access 32 bytes... This seems satisfying. If i can get data from the codec to my DUE i will see what i can do with memory