µC ADC for audio - Page 1
Forum section: electronics / general

author: thekhakinator
author_rank: Contributor
timestamp: May 15, 2013, 10:08:55 am
content: I'm working on a basic audio project at the moment, doing some very basic DSP. I chose to go with a dsPIC33FJ64GP802, as it's got a 16-bit audio DAC built in, as well as 12-bit ADC. However, I'm having major issues. Building on protoboard, I've been able to get a nice clean output from the DAC fed with a ramp function, however, when I use the inbuilt ADC to sample audio for the DAC, I'm having significant noise issues. The audio is passed through clearly but with significant noise added; unfortunately I lack a spectrum analyser to further characterise the noise beyond "it sounds white".I've got a basic inverting op-amp stage to create some gain for the low-level signal from the magnetic pickups going into the ADC. However when this is driven straight into an amp, no noise is apparent. I eventually traced the source of the noise to the PIC's ADC itself - even when the ADC is held directly at a constant voltage (either the PIC's 3.3V supply or some split rail on a resistor divider) the ADC output is quite noisy. I'm not sure why this could be; I'm fairly confident I've set up the PIC correctly with all the necessary analog reference voltages, etc.I have heard a lot from experienced hands on forums about "splitting analog and digital ground". Is this relevant at all? How does one achieve that? What other sources of noise on an ADC could be causing these issues?

author: Rerouter
author_rank: Super Contributor
timestamp: May 15, 2013, 10:19:19 am
content: when you are getting into 12 bit accuracy, your probably bitten pretty hard with the datasheet to begin with,the analog ground should be separate and clean, compared to the digital ground, as even a few hundred uA current pulse from the micro is going to throw you off quite a few bits on your reading, then depending on how large the error, you can get into some quite fancy improvements, but still the adc's specs may be biting you in the backside here,

author: thekhakinator
author_rank: Contributor
timestamp: May 15, 2013, 10:28:29 am
content: Yeah, I've heard as much - digital circuits with their fast switching (my dsPIC runs at 40MHz) can create a lot of noise; but how does one "separate" the grounds? To read the incoming audio voltage the PIC must have a ground reference of some sort?

author: nctnico
author_rank: Super Contributor
timestamp: May 15, 2013, 05:49:48 pm
content: First rule: don't split grounds. Just connect them together in a better way (a solid plane for example). You can still run into problems but you can avoid those by putting all the analog circuitry together and make sure no big/noisy currents have to run across the part where the analog circuitry is located.

author: senso
author_rank: Frequent Contributor
timestamp: May 15, 2013, 07:08:53 pm
content: What reference are you using?Having the ADC oscillating with a dc signal can't be normal, are you using all the recommended decoupling caps, good capacitance in the power supply?Maybe using a good external reference might help and putting the micro in sleep mode when doing the adc conversions.

author: NiHaoMike
author_rank: Super Contributor
timestamp: May 17, 2013, 03:27:31 am
content: Run the ADC several times the sample rate, then average samples together.

author: thekhakinator
author_rank: Contributor
timestamp: May 19, 2013, 07:34:32 am
content: Thanks for the suggestions guys, unfortunately though none were the solution!Actually found the real, bigger problem. The noise is coming from the dspic33FJ64GP802 DAC. The chip has an on-board 16 bit audio DAC which, unfortunately, is not very good. We've set it up with the reference design op-amp output buffer. When the DAC output voltage is increased to a certain point, done by setting the DAC output buffer to a manual value in the code, noise becomes a significant part of the signal. This is very strange behaviour, setting the DAC output buffer above approx. 2000 (16-bit buffer max is 65535) gives noisy output when it should be holding a constant DC value.This is quite frustrating. Extensive Google research has found many a thread titled "dspic Audio DAC Noise" but no real solutions. :/

author: smashIt
author_rank: Contributor
timestamp: May 20, 2013, 02:05:43 pm
content: according to the datasheet the DACs will use a backup-value if you can't keep the buffer filledcould it be that what you are seeing is not noise but the alternating between your value and the backup-value?

author: thekhakinator
author_rank: Contributor
timestamp: May 21, 2013, 03:58:23 am
content: Yeah, checked into that. I set the value identical to the backup value, so no matter what the DAC would always be sitting at the same point and unfortunately no improvement.Cheers anyway. I've ordered some DAC chips and am currently experimenting with a super-ancient 1980s Burr Brown DAC-85, see how that goes. If I've still got this amount of noise then, then I'm gonna have to go back and think about what I'm doing with my life.

author: Rasz
author_rank: Super Contributor
timestamp: May 21, 2013, 05:18:08 am
content: Quote from: thekhakinator on May 15, 2013, 10:08:55 amAudacity + fft will at least give you a general idea

author: thekhakinator
author_rank: Contributor
timestamp: May 21, 2013, 08:20:38 am
content: Ah, good tip. I may try that.