Author Topic: how to route codec (ADC/DAC), analog pins not all on one side  (Read 4695 times)

0 Members and 1 Guest are viewing this topic.

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #25 on: October 24, 2019, 07:00:02 am »
The inputs need to be high impedance. I've got for an op amp with low current noise (though this seems really hard to work out from some data sheets... ) If I ran into the op amp + input and used dual supply voltages would that mean lower noise? The op amp is 0.6  fA/√Hz and the Johnson noise would be 127 nV / √Hz for the resistor I think? I think that means that the resistor noise would dominate?   
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #26 on: October 24, 2019, 07:27:30 am »
If the resistor is n series with the input and dominaters the node impedance, yes, I'd agree.
Anyway, high impedance input doesn't neccessarily mean there must be a high value resistor placed in series with the signal input, it's the node impedance connected to that input that is relevant.

It's a bit fishing in the dark without schematic and application relevant information (e.g. what is the signal source and its requirements / properties). Can't tell if dual supply helps without context.
Many applications have been successfully solved before, and once you've found such often it's adviseable to follow that path.
Safety devices hinder evolution
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #27 on: October 24, 2019, 07:31:51 am »
The resistor isn't in series.  It's biasing from the VCOM. I simulated it LT spice and the noise contribution from the resistor  appears quite low. 
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #28 on: October 24, 2019, 07:33:38 am »
For analysis of the root cause of the noise, it might be helpful if you're able to feed the ADC output samples into all kind of visual display (long and short term waveform display,  spectrum display / FFT). This could help you to judge if the noise originates from a white noise source, or is rather correlated to digital noise of your system.

Quote
The resistor isn't in series.  It's biasing from the VCOM. I simulated it LT spice and the noise contribution from the resistor  appears quite low. 
Should be OK then.
Safety devices hinder evolution
 

Offline thm_w

  • Super Contributor
  • ***
  • Posts: 7521
  • Country: ca
  • Non-expert
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #29 on: October 25, 2019, 12:55:28 am »
Do you mean the acid traps stuff doesn't matter? I've seen a few people say it hasn't  been an issue for a decade or two.

What would be ideal for the 3v3 cap wise?  Oh and there are planes where ever there are power traces so I've made that trace big now to make that more obvious, as @capt bullshot suggested.

I'm not sure if I need to use anything more snazzy than an LM358 to buffer VCOM. I given it's buffering the reference any noise in there will couple directly but I'm not sure if the level with no gain is an issue.

Sorry for being confusing:
- Yes acid traps stuff does not matter, at all.
- 3 3v3 caps is fine, I was responding to single via that mrjoda pointed out is not "ideal", but probably going to be OK.

VCOM, I don't know enough to comment.
Profile -> Modify profile -> Look and Layout ->  Don't show users' signatures
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #30 on: November 04, 2019, 03:40:16 am »
So I've got the 4 layer version, assembled it and tested it!

It's worse. Much worse.  The 2 layer board with the big splits in the ground planes and the weird routing outperforms it on noise considerably. I was really hoping the 4 layer board would be better but it has not. I'm attempting to work out why it's worse. The output stage is noisy, even though schematic wise that part of the design has not changed. The differences are, it's 4 layers and doesn't have any splits / slots in the ground plane.  The previous design had a slot in the ground plane separating the analog side from the digital.
 
The following users thanked this post: thm_w

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #31 on: November 04, 2019, 06:30:55 am »
Sorry for pointing you into this direction (non-split GND plane), I didn't expect things to get worse. I'm still interested in the root cause.
Safety devices hinder evolution
 
The following users thanked this post: loki42

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #32 on: November 04, 2019, 07:42:09 am »
all good, it was interesting to try! Though I've got no idea how to improve it, given I don't really understand what's going on.

Basically the process was: I wanted to change how on/off switching worked (bypass). Before it was done with relays which are big and expensive, have annoying switching noise and very high current usage. I switched to CMOS switching. It works well, but to do so I moved a bunch of stuff around. The new layout was much noisier than the relay based one, though all I'd done was add the CMOS switches, and move the op amps lower on the PCB (changing their return paths to be closer to the oscillator).

Obviously I assumed the CMOS switch was the problem and bypassed that, replacing it with bus wires. No improvement. When the switch was there, no noise in bypass mode when signal is still going through the CMOS but not the op amps. The CMOS in/out is biased with VCOM so maybe the additional current there is degrading the buffer performance. Otherwise I think it has to be the different op amp location, though I'm not sure how easily It'll be for me to change that and fit everything in.

I then asked here and got the layout advice, so changed that to 4 layer, redid all the codec routing etc, no slots etc. That made the 4 layer board the worst of the 3, much to my disappointment. I've tried different (much lower noise) op amps for the VCOM buffer with no noticeable change in performance. 

Noise is about 130 mV p to p. Relay version was 75 mV and my target would be 50 mV. I understands the number will change quite a bit depending on oscilloscope settings / bandwidth etc, but for a rough idea. I've attached the schematics for the switch and output buffer section in case the problem isn't purely layout as well as the whole layout. This is the 4 layer version, digital on the south west, analog north east.  Previously there was a slot in the hatched red area between the codec and digital stuff.

The cyan lines show my thoughts on what the dominant low frequency return paths for currents are. The PCB is for audio so noise below 20 khz is the main worry. Op amps used to be where the switches are now, and relays were near where op amps are.
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #33 on: November 04, 2019, 08:57:40 am »
First thoughts:

Did you try decoupling the VCOMAD and VCOMDA rails using a large (10uF ballpark) capacitor?
For a 5V single supply analog circuitry design, I'd establish one single virtual GND at VCC/2, heavily bypassed to GND and VCC, and use this for everything (like the GND in a dual supply design).

What happens to the noise level if you "disable" (maybe pull reset or vhatever does the) your digital stuff?

The MCP6004 doesn't look exactly like a typical audio OpAmp to me, but I think that's the least thing to be concerned of now, regarding the quite high pp noise level.
« Last Edit: November 04, 2019, 09:00:25 am by capt bullshot »
Safety devices hinder evolution
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #34 on: November 04, 2019, 02:50:57 pm »
I was using TL074 as well, i've tried both. I tried the MCP6004 for the lower current noise, but I might have misread the datasheet... :) It looks like it's got much lower current noise, and the the impedance I'm running at that should dominate over the voltage noise, I think?  Either way it doesn't seem to be the main issue.

With the virtual ground how do you then bias for the codec? The inputs need to be biased to VCOMAD right?

I can try more decoupling on the VCOMAD / VCOMDA rails. They both have 10 uF caps on them then smaller caps near where they are used. The 10 uF are ceramic. 

 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #35 on: November 04, 2019, 04:24:30 pm »
I was using TL074 as well, i've tried both. I tried the MCP6004 for the lower current noise, but I might have misread the datasheet... :) It looks like it's got much lower current noise, and the the impedance I'm running at that should dominate over the voltage noise, I think?  Either way it doesn't seem to be the main issue.
Agree, I believe it's not the main issue now. Don't look at the input noise specs alone, check CMRR / PSRR and your supply rail too. A noisy supply voltage can spoil your amps performance. 50mV peak-to-peak noise looks pretty hefty for audio stuff, should be way lower, so I believe there's more issues to your circuit than the layout and the choice of OpAmp alone.

Quote
With the virtual ground how do you then bias for the codec? The inputs need to be biased to VCOMAD right?
The codec has differential inputs, the typical bias required is VCC/2 when DC coupling is used. So any voltage near enough to VCC/2 can be used to bias the inputs and the OpAmp circuits.

Quote
I can try more decoupling on the VCOMAD / VCOMDA rails. They both have 10 uF caps on them then smaller caps near where they are used. The 10 uF are ceramic. 
The datasheet suggests to use electrolytics. That may have two reasons:
- In 2008, 10uF ceramics weren't that commonly available, so they just specified electrolytic
- The circuit needs some ESR here, the ESR of a ceramic cap is too small and causes oscillation

Regarding your ouput amplifier circuit: The input impedance is lower than the minimum allowed value regarding the datasheet - this might be an issue, though I don't think of a noise issue, rather limiting the max. amplitude.

There's no CMRR or PSRR specified for the codec, so you want really clean power supply rails - did you check the analog VCC rail for noise, and does this noise correlate with the output noise?

More ideas:
What is the output noise if the output is digitally muted (digital processing outputs a continuous stream of zeros, not the processed input)?
Remove the codec from the PCB, and replace it by bridge wires (codec input to codec output), then check the noise of the analog circuitry alone.
Safety devices hinder evolution
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #36 on: November 05, 2019, 06:11:57 am »
MCP6004 PSRR 86 CMRR 76 Noise current 0.6 fA noise voltage 28 nV
TL074 PSRR 86 CMRR 86 Noise current 0.01pA noise voltage 15 nV

SO the CMRR could be an issue, but i've tested with the TL074 as well.

What's the utility of using VCOM vs just a VCC/2 then for bias? No need for the extra resistors? If it's saving some resistors but needs an extra dual op amp as a buffer that sounds like I'm doing it wrong.

Output noise is identical when muted. The relay based circuit had very low output noise.

I'll try electrolytics there, I didn't think of ESR and wanted to save space.

The VCC rail is going through an LDO and ferrite bead. The ferrite might not be filtering right as I do find using beads correctly a bit confusing. The power section is identical for the previous relay based version though, that didn't have the output noise issues. the VCC rails do have quite a bit of noise on them though. I'm not sure how much is too much, but it's around 85mv p p & RMS of 27mv. Maybe the new type of switching is causing the LDO to work harder? Previously the relay was running of the 3v3 supply and the CMOS switches are on the 5V.

The codec is a bit fiddly to desolder and solder back on so I'll try the other options first...
 
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #37 on: November 05, 2019, 06:58:22 am »
MCP6004 PSRR 86 CMRR 76 Noise current 0.6 fA noise voltage 28 nV
TL074 PSRR 86 CMRR 86 Noise current 0.01pA noise voltage 15 nV

SO the CMRR could be an issue, but i've tested with the TL074 as well.
PSRR and CMRR decrease with increasing frequency, some manufacturers put diagrams of CMRR and PSRR vs. frequency into their datasheets. Anyway, ATM I believe the culprit is somewhere else, though some optimization might be achievable here once the root cause is fixed.

Quote
What's the utility of using VCOM vs just a VCC/2 then for bias? No need for the extra resistors? If it's saving some resistors but needs an extra dual op amp as a buffer that sounds like I'm doing it wrong.
Yes, it saves the resistors, handy if you don't need to buffer the voltage.

Quote
Output noise is identical when muted. The relay based circuit had very low output noise.

I'll try electrolytics there, I didn't think of ESR and wanted to save space.
So it's related to the DAC part and the increase came with the analog MUX. I wouldn't expect any significant PSRR from a 4053 type analog switch

Quote
The VCC rail is going through an LDO and ferrite bead. The ferrite might not be filtering right as I do find using beads correctly a bit confusing. The power section is identical for the previous relay based version though, that didn't have the output noise issues. the VCC rails do have quite a bit of noise on them though. I'm not sure how much is too much, but it's around 85mv p p & RMS of 27mv. Maybe the new type of switching is causing the LDO to work harder? Previously the relay was running of the 3v3 supply and the CMOS switches are on the 5V.

The codec is a bit fiddly to desolder and solder back on so I'll try the other options first...
 
The noise on the supply rail is way too high for any kind of audio circuitry, single digit mV or even less is what you want. Even for a digital rail I'd consider this too high. I'd guess this couples through the DAC part of the codec.
Ferrite beads have little to no effect within the audio frequency range, usually they show significant damping from single digit MHz upwards. An LDO might not be sufficient to dampen switch mode supply noise, some LDOs have really poor PSRR above some 100Hz. RC or RLC filtering the LDO input can help here, or use a rather expensive LDO that has a good PSRR for higher frequencies. SMPS noise can couple through GND into analog circuitry, too.
Safety devices hinder evolution
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #38 on: November 07, 2019, 01:00:17 am »
I think the actual number of the noise measurements are probably gibberish. The differences in levels between the two units probably is useful though. I'm checking that with oscilloscope probes so I'm getting a ton of extra noises.

The LDO I'm using is a MCP1802, it's described as high PSRR (70dB @ 10kHz)
the SMPS is TPS562200DDCR, which on the TI power designer sim has 25 mv p to p ripple



 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #39 on: November 07, 2019, 06:58:19 am »
I think the actual number of the noise measurements are probably gibberish. The differences in levels between the two units probably is useful though. I'm checking that with oscilloscope probes so I'm getting a ton of extra noises.
If you can, check the noise with the switcher disabled, otherwise same setup.

Quote
The LDO I'm using is a MCP1802, it's described as high PSRR (70dB @ 10kHz)
the SMPS is TPS562200DDCR, which on the TI power designer sim has 25 mv p to p ripple
Looks OK in the first place, the LDO appears to have a quite poor input step / transient response at a few 100kHz, so I still could imagine the switching frequency (not the ripple, but rather the switching transients) passing through. One should see a significant difference with the switcher disabled then. Otherwise, 650kHz / 25mV is rather easy to filter, but one must be careful to avoid interference propagated through GND and external wiring (maybe add a common mode choke to the power input)

Anyway, I'm starting to run out of ideas now ...
Safety devices hinder evolution
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #40 on: November 07, 2019, 07:49:22 am »
I just tested with all the switches removed and the noise performance is better. It's interesting because the switches sound fine when in bypass mode, when the signal is still going through them but not the codec, but when they are on and the codec is on then it's quite bad. I wonder if it's anything to do with the enable signal to the switches? That is coming from the digital side of the board right around.  This was also the case with the relays though, but in the case the line was only high for a few milliseconds.

I did change one other thing between this version and the previous relay based boards, which is that I switched to a different oscillator, from the same company as it was cheaper and had slightly better stats, but was in a larger footprint.
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #41 on: November 07, 2019, 08:00:29 am »
Oh and I tried a resistor voltage divider instead of VCOM and it sounded really distorted. I wonder if that was an issue with the bias resistors or something else, or just that it exposes the noise in the 5VA supply more.
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #42 on: November 07, 2019, 01:13:30 pm »
I just tested with all the switches removed and the noise performance is better. It's interesting because the switches sound fine when in bypass mode, when the signal is still going through them but not the codec, but when they are on and the codec is on then it's quite bad. I wonder if it's anything to do with the enable signal to the switches? That is coming from the digital side of the board right around.  This was also the case with the relays though, but in the case the line was only high for a few milliseconds.

I did change one other thing between this version and the previous relay based boards, which is that I switched to a different oscillator, from the same company as it was cheaper and had slightly better stats, but was in a larger footprint.

Yes, digital outputs can couple digital VCC noise into analog parts, they're rather low impedance coupled to the respective GND or VDD rail of the micro. So any noise that's on the digital supply will appear on the digital outputs. If the signal is low speed, this is rather easy to mitigate by an RC filter (in case GND to filter against is clean).

DId you properly bypass (large cap to GND) your resistive divider instead of VCOM, did you measure if the divider output deviates from ideal midpoint due to loading? Excessive common mode voltage could lead to clipping of the differential signal, im my imagination this would sound distorted. WIthout bypassing, the resistive divider forwards AVCC noise to that virtual GND, that's why one bypasses this.
Safety devices hinder evolution
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #43 on: November 12, 2019, 12:21:09 am »
I did bypass the resistive divider (47 uF) and the output seemed sensible, though I didn't measure how different it was to VCOM.

I do have an apology though... so I still had worse noise with no switches in but I've now realised what the issue was. The negative output from the DAC wasn't properly soldered and actually wasn't connected, so the differential output wasn't doing it's thing, thus the significant noise introduction. I now have about the same noise as the relay version. So basically it's all good. I'm not sure how I missed that the pin wasn't soldered correctly!

I'm not sure if the move to 4 layer was needed but things are working well, I am contemplating cleaning the AVCC rail more to remove the switcher noise but I'm not sure how important this is. I've seen some inductors with similar milliohm rating to the ferrite bead so maybe I should swap that out to create an LC filter designed to remove the switcher frequency? It's 650 kHz so far from the audio spectrum, so I'm not sure how much filtering it out will improve performance.
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #44 on: November 12, 2019, 07:17:13 am »
I did bypass the resistive divider (47 uF) and the output seemed sensible, though I didn't measure how different it was to VCOM.

I do have an apology though... so I still had worse noise with no switches in but I've now realised what the issue was. The negative output from the DAC wasn't properly soldered and actually wasn't connected, so the differential output wasn't doing it's thing, thus the significant noise introduction. I now have about the same noise as the relay version. So basically it's all good. I'm not sure how I missed that the pin wasn't soldered correctly!
LOL, stuff like this just happens. I remember having spoiled a whole day of hardware debugging because I didn't notice the scope probe was set to 1:1 instead of 10:1. Fixed that with tape as soon as discovered, then bought better quality 10:1 (non-switchable) probes.

Quote
I'm not sure if the move to 4 layer was needed but things are working well, I am contemplating cleaning the AVCC rail more to remove the switcher noise but I'm not sure how important this is. I've seen some inductors with similar milliohm rating to the ferrite bead so maybe I should swap that out to create an LC filter designed to remove the switcher frequency? It's 650 kHz so far from the audio spectrum, so I'm not sure how much filtering it out will improve performance.

Depends. Switching noise on power rails can affect ADCs / DACs in rather subtle ways, I had a design using a slow ouput rate 24 Bit delta/sigma converter that was seriously affected by supply ripple way above the passband. The ripple coupled into the comparator node that was operating at high frequency and very sensitive threshold (that's the nature of delta/sigma conversion). Most probably, the outside amplifiers operating in the analog audio frequency range are less sensitive to 650kHz switching ripple.
Safety devices hinder evolution
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #45 on: November 12, 2019, 08:04:52 am »
Yeah, I thought there might be interaction with the higher internal frequencies of the delta sigma codec.  Do you think  it's worth adding an LC filter? I've been looking and some 1uH 8.5mOhm inductors that are pretty cheap and would be minimal extra cost. That's similar power loss compared to the ferrite bead and I assume I'd be able to replace it with the LC filter. The annoying bit is the low value resistor for dampening.
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #46 on: November 12, 2019, 08:26:58 am »
Regarding LC filtering, I always preferred RC filtering with maybe an additional L. LC alone or even a ferrite bead can cause ugly ringing, making things worse. I'd go to include significant resistive damping in the filter. If your circuit allows for the voltage drop, start with 10R (in series to the inductor or instead the inductor), a some 10uF ceramic can achieve a lot then. And check the switching regulator doesn't go into "low power" modes, causing heavy lower frequency ripple.
Safety devices hinder evolution
 

Offline loki42Topic starter

  • Frequent Contributor
  • **
  • Posts: 364
  • Country: au
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #47 on: November 12, 2019, 08:41:37 am »
The circuit can't cope with that level of voltage drop. I've just been looking at circuits like : https://www.analog.com/en/technical-articles/switching-regulator-noise-reduction-with-an-LC-Filter.html

A Pi style filter looks pretty straight forward and the component count is low. Though I'm not sure how to select what the cut off frequency should be. I assume for filtering DC you just want it as low as possible for a given component cost. 1uH and 2 10uF seem to give me a 25khz cutoff frequency unless I'm calculating that wrong. I've been reading through : http://www.ti.com/lit/an/snva538/snva538.pdf as well.
 

Offline capt bullshot

  • Super Contributor
  • ***
  • Posts: 3033
  • Country: de
    • Mostly useless stuff, but nice to have: wunderkis.de
Re: how to route codec (ADC/DAC), analog pins not all on one side
« Reply #48 on: November 12, 2019, 10:51:10 am »
Analog (and former LT) has some quite useful application notes. To me, the hint "place a filter at the input of your buck regulator too" looks more useful than all the formulas from the TI paper. Corner frequency of the filters doesn't matter too much, as long as it low enough to attenuate the lowest frequency ripple (beware of "pulse-skipping eco-mode" and the like) that occurs in practice - for this reason I like high frequency switchers like the one you used. Anyway, if you do LC filtering, add damping (e.g. ESR of non-ceramic capacitors, high-loss inductance or real resistors in series or parallel with the reactive components).
« Last Edit: November 12, 2019, 10:53:16 am by capt bullshot »
Safety devices hinder evolution
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf