I am using the 16 bit audio DAC from dsPIC33FJ128GP802 and I am having a lot of noise, even if the output value is held constant.
I have obtained better results in the past using 8 bit PWM from an ATmega328. I have already checked that the power supply is properly filtered, also that the analog circuitry is properly working without adding any noise. Also the PCB was carefully designed and routed. All tests I have made indicate that the noise is coming from the DAC.
Searching on Microchip's forum I found that many people had the same problem in the past, see this link and links therein. I have found no one saying "this was the problem, it is solved". So I came to think that this DAC, although 16 bit, is not useful for audio applications.
Has any one here have used it without getting tons of noise?
Here is the schematic.
Here is the layout (bottom layer). The top layer is a GND plane.
Some tests I have made:
- Set the DAC output register to a constant value. There is no audio going out, but the noise remains exactly the same.
- Turn off the DAC module. Noise disappears.
- Connect things as in this link (while keeping DAC module on), I get good audio quality and noise disappears.
The noise sounds white. Unfortunately I have no instruments to characterize it further. I have an old analog oscilloscope and an audio amplifier.
Here there is the waveform, the spectrogram and the FFT of the background noise with and without the audio passing through the MCU. This was recorded using a cellphone recording the line input electrically connected to the output of my circuit.
Here is an audio sample of what I am getting. The first half is with the signal passing through the microcontroller, the second half (after the "clak") is without the microcontroller.