-
This ADC makes weird noises
08/24/2016 at 19:33 • 4 commentsI have noticed for some time that the line-in signal from the codec (WM8731) can have some strange noise components. When the input is silent, like when it's left open or shorted to ground, I would have expected the signal to be pretty close to zero and have a flat noise floor when looked at in the frequency domain. I noticed that the noise components can be moved around, and sometimes made to almost disappear, by poking at the audio input in different ways or feeding it different signals. My guess was that there was something non-optimal about the power supply or the I2S clocking. But the weirdness reached a new level when I noticed that a new batch of chips (labelled "58AJMDN") made different noises than the old ones ("56ADMDN"). The old would have a soft band of noise around 2 kHz + harmonics, while the new ones had a sharper noise peak around 1 kHz. This prompted deeper investigations, and furrows upon my forehead.
After doing all the physical/analog things, like exchanging codecs between boards, adding decoupling capacitance and trying different weird clocking and PLL options, I started to go through the datasheet again and toggle configuration bits. There was something that made a clear difference — turning off the automatic high-pass (DC removal) in the ADC made most of the problem disappear. There was quite a large DC offset to be removed in software then, and that offset seems to be internal to the chip somehow.
The picture above is a spectrum captured with Baudline, over USB, of the line-in signal. The measurement was with the line-in connector essentially shorted (there was a pair of headphones connected). The DAC was fed with the incoming signal in the first two cases, then with a generated sine signal in the third case.
- Green — with automatic high-pass in WM8731
- Red — with DC correction in software instead
- Orange — automatic high-pass turned off, playing 1500 and 2000 Hz sine tones with DAC
All of those have some noise where it shouldn't be, but it's centred around different frequencies. The peaks at around 1050 Hz, with harmonics, can be audible and annoying at very low levels. Whiteish noise at the same low level isn't really audible, or at least it's very much easier to not care about. And a bit of crosstalk between output and input in an integrated codec chip is also pretty easy to forgive.
Everything I change gives slightly different weird results. Disabling the DAC and muting the DAC generates some artefacts. Letting the DAC output a constant DC signal of 100 (S16 samples) yields a pretty nice and flat noise floor from the ADC, but there are still some strange spikes here and there.
-
USB
08/20/2016 at 16:22 • 3 commentsIt turned out to be a bit tricky to get a stable and working USB connection, but I think I've got it now. There have been issues with interrupt priorities, device descriptors, buffer sizes, …
I have implemented an ACM "serial port", where log messages can be sent to the host, and an audio interface that essentially presents a stereo microphone to the host. This works well and stable when talking to a Linux computer, and I have had the chance to test the ACM serial port on MacOS (where it turns out to be hard to find a program that is happy to handle lines with a simple \n ending from a serial port).One tricky thing that I haven't solved yet is synchronisation between the two clock domains (USB host and audio sampling clock), which shows up as glitches in the audio stream at regular intervals.
Code at GitHub, as usual.
-
Thermals
08/01/2016 at 06:57 • 0 commentsI recently borrowed a thermal camera to figure out how hot the board gets, especially when powered from the higher end of the expected supply voltage range.
This is an image of the board taken with a thermal imaging camera. The shot was taken after feeding the board with a 10V supply for an hour or so. The LDO—where the voltage is dropped to 3.3V—obviously shows up as hottest, peaking at about 74°C. Supply current is around 80 mA here, meaning that the LDO and the diode before it have to dump about half a Watt into the air and board.
The conclusion is that it's wise to feed the board with a lower voltage to keep losses down. No surprises there :-)
-
Got my boards today
10/20/2015 at 16:57 • 0 commentsA package arrived in the mail today with a new run of PCBs from ITEAD Studio. Two weeks from order to delivered goods is quite impressive!
I'm amused by their imprecise approach to doing business. The order was for ten boards but I got 17 plus some other random stuff from the warehouse floor — 10mH inductors, a bag of diodes and some random board.
Time to heat up the soldering iron…
-
rev.B board design finished
10/06/2015 at 05:49 • 0 commentsI sent off the Gerber files for the rev.B iteration of the board to production yesterday. This second revision contains basically the same parts, but the placement and routing has been refactored and I've added more test points and stuff.
This time I'm using ITEAD studio (itead.cc) for making PCB prototypes — the rev.A PCB run was made by OSH Park. OSH Park's PCBs are really beautiful and manufactured to a very high standard and the delivery time is not atrociously long. ITEAD studio is none of the above, but quite a bit cheaper for non-tiny boards if I'm actually going to use all the 12 that they promise to produce.
So I guess I'll have something to do this Christmas.