Starting the Xmega produces spikes

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

 

I'm using a ATxMega128A4U and the DAC with a DDS to produce an audible Sinewave. I'm using the schematic in the attachement directly connected to the DAC. Switching my device on and off i hear a plopping sound. Switching the device on and off without the connection to the mikrocontroller i hear no plopping sound. On the oscilloscope i can see the folling on the output of the DAC.

 

Has someone an idea what that could be. In my software I do the following after start:

 

PORTB.DIR = 0b11111100;
PORTB.OUTCLR = PIN2_bm;
DACB.CTRLA = DAC_CH0EN_bm | DAC_ENABLE_bm;
DACB.CTRLB = DAC_CHSEL_SINGLE_gc;
DACB.CTRLC = DAC_REFSEL_AVCC_gc;
DACB.CH0OFFSETCAL = g_settings.cDACOffset;
DACB.CH0GAINCAL = g_settings.cDACGain;
while(!(DACB.STATUS & DAC_CH0DRE_bm));
	DACB.CH0DATA = 0;

Tank you very much for every idea!

 

EDIT:Now with correct screenshots :)

Attachment(s): 

Last Edited: Fri. May 26, 2017 - 12:35 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Think about the initial voltage across C13. The popping is common in audio circuits, so many amps have a startup mute feature.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Surely, it's perfectly normal that, if you turn any audio gear on or off while it's connected to the amp+speakers, you'll hear some kind of transient ... ?

 

This is why the rule is to turn the amps on last, and off first.

 

 

How to embed images in a post - so that we can see then: http://www.avrfreaks.net/comment...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well I thought there may be some solution to prevent this :). But if you say thats ok and common - maybe an switch that connnects/disconnects the Headphones etc. after a amount of time?  Can the Xmega detect a off switching and disonnect the speaker or something?

Last Edited: Fri. May 26, 2017 - 12:47 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why have you connected the output of opamp A to ground?  This could lead to a power up surge.

 

Most DAC's I have worked with, have a default power up output value, usually set to mid point of range, some are settable using a register, this can lead to power up pop sound in an audio circuit.

 

Jim

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You are talking of R17? Someone told me to try this to prevent high frequency noise using my audio interface. But it did not work.

 

EDIT: Pin 1 is my voltage reeference for the filter :), look closely its not the supply GND maybe I should tkae another bias symbol.

Last Edited: Fri. May 26, 2017 - 01:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:
Why have you connected the output of opamp A to ground?  

Good question!

 

Curby wrote:
You are talking of R17?

That would be opamp B, surely?

 

I think he means IC67A - pin 1:

 

(see how much easier it is to discuss the schematic when we can see it in the thread!)

Last Edited: Fri. May 26, 2017 - 01:43 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
ki0bk wrote:
Why have you connected the output of opamp A to ground?
Good question!

That looks to be for a virtual-GND reference between actual GND and +5V. With the resistors chosen, it would be at (about) 2V with respect to actual GND.

 

Edit: cleaned up the quotes

David (aka frog_jr)

Last Edited: Fri. May 26, 2017 - 01:50 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Could try a relay to disconnect the output until a few seconds of power up. I think that is what stereo equipment does, most anything i always hear a relay click after being powered up and no pop in the speakers. Now, i would also try a cd4066 analog switch in the audio path being controlled by the micro. 

Well you could also have a charge up cap being fed current through a resistor on an opamp setup as a comparator to switch on the analog switch or relay upon power up.

power down would require the cap to be discharged so a PNP transistor would need to be hooked up to that charged cap and be controlled with a 100k-100k resistor divider on the power rails.

 

 

~GuitarDude

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

vertamps wrote:
Could try a relay to disconnect the output until a few seconds of power up. I think that is what stereo equipment does, most anything i always hear a relay click after being powered up

The click you here is in the amplifier - it delays connecting the speakers for a short while after powerup.

 

Having a relay in the OP's circuit probably wouldn't help - as it is on the input to the amplifier.

 

But there are things called "pop-less" or "click-less" audio switches ...

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

frog_jr wrote:

awneil wrote:
ki0bk wrote:
Why have you connected the output of opamp A to ground?
Good question!

That looks to be for a virtual-GND reference between actual GND and +5V. With the resistors chosen, it would be at (about) 2V with respect to actual GND.

 

Edit: cleaned up the quotes

 

I see that now, yes I would choose another symbol. 

Sorry

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

ki0bk wrote:
I would choose another symbol
+1

David (aka frog_jr)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

One solution is to start the DAC with the same voltage output as is present at the other side of the cap. Then, ramp it to the nominal waveform midpoint. No pops, then.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

I think there are a couple of items that might warrant review.

 

The Analog and Digital grounds are mixed up back and forth.  Presumably the Xmega is on the Digital Ground, and the DAC and AVcc are on the Analog ground.  That part of the circuit is not shown.

 

Next, the virtual ground is not centered at Vcc/2.  It is fine to have an off-centered virtual ground, but I'm not sure why this circuit requires this.  It is common for Zero Cross detection offset and for (old) op-amps that went closer to the rail in one direction than in the other.  Neither apply here.

 

Next, the circuit starts with an attenuator, then a HPF, feeding the op-amp filter.  The attenuator is tied to the digital ground, but presumably the DAC is on the analog ground part of the micro.  This introduces digital noise into the circuit right from the front end.

 

The associated DC - Blocker / HPF does not have a hard wired reference to the virtual ground, or to Vcc/2.  The DC bias can drift all over the place, and noise and popping can occur based upon clipping not just from start up transients, but from various input signal values, as well.

 

R11 would typically be part of a voltage divider to hold the DC bias, with no signal input, to the desired Vcc/2 mid-point, or perhaps to your off-set virtual ground voltage, (but that isn't needed in this application).

The same concept applies to the output of C9.  There is no DC bias control of the signal feeding the signal attenuator POT which feeds the 386 amplifier. 

 

A more classic approach would be to have the signal attenuator pot feed the DC blocking cap, with DC bias control (resistor divider) on the output of the cap, which then feeds the audio amp chip.

(Disclaimer: I don't recall the 386's input circuitry, and I'm not looking it up at the moment).

 

Next, why is the audio amp chip connected to the digital ground?  This should be connected to the analog ground, or once again the amp will introduce digital noise into the system.

Likewise, the output of the filter feeding J7 should also be connected to the analog ground, not the digital ground.

 

Additionally, the virtual ground driver might perform a bit better with a 0.1 uF cap across the 10 uF cap.

 

Lastly, I used lots of 386 amps in the past.  It was a great chip in its time.  There are now, however, a number of other (i.e. "better"), small audio amp chips available, including Class D amp chips.  This, however, doesn't impact the circuit as provided.

 

JC