Dirty signals/isolation question..?

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
xl97
 
Posts: 201
Joined: Mon Jul 27, 2009 12:51 pm

Dirty signals/isolation question..?

Post by xl97 »

Hey group...
I have a question about what I believe is dirty/noisy lines.. and how one goes about isolating things to get rid of noise..etc

Im not sure how much of this is a 'timer' issue and how much is 'noise/interference'.. so I'll explain whats happening...and be educated. :)

I have a custom board, more or less a tiny (all smd) Arduino/Waveshield merged board.. (runs all WaveHC sketches..etc..etc.....& functions just like WaveShield)

I am experimenting with code some code and attempting to learn more about the FSM (Finite State Machine) type approach to doing multiple things at once in your code.. (instead of do one thing now.. wait till done.. do next thing..etc)..sorta like an advanced blinkWithoutDelay in my mind..

anyways...

what I was (am) attempting to do was play a simple audio file, in continuous loop (seamless/gapless playback).. and PWM fade an LED up & down, all without skipping a beat.
I believe I have accomplished that, but am having some 'issues'.. both with performance and quality.


1.) I understand the WaveHC/Waveshield uses Timer1 for its audio playback capabilities.. (I think I was told that means now PWM on pin9 now?) <--- but I have read other posts/comments about other PWM pins and timer issues..in conjunction with the WaveHC/Shield..


So this might be a reason for some of the problem(s)?

I play my audio file in a loop.. and I test using pin 3, 5 or 6...

pin3 makes the fade look insanly choppy..and blinky. More like a 'sputter'..in random intervals..(no rhyme or reason)

pin 5 fade IN perfect.. but fades OUT choppy..sputtering, but in a pattern..and eventually fades out..and then again, fades in smooth.

pin 6 fades IN & OUT perfect.. but I hear this 'whine' in the speaker from the audio output now..??


So I guess Im looking for some discussion from the more experienced members here??

Anyone play with the WaveShield and experience this stuff? (could just be hardware on my custom board..and WaveShield itself does NOT behave like this)..

Anyone have some good links/tuts (for a beginner like myself) to read up on isolation and clean signals for audio/pwm?


pic of the DAC/amp portion of schematic if it will help:
Image

Thanks guys.. :)

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Dirty signals/isolation question..?

Post by adafruit_support_mike »

I can't make any comments about signals interfering with each other inside the uC, but if you're getting interference between signals outside the chip, you're probably seeing ground bounce. That's extremely common in PWM circuits, especially when you mix PWM with analog signals.

To get a sense of what's going on, imagine replacing every piece of connector in your GND path with a resistor. Every time the path branches, you'll need three resistors to meet at that point.. usually one will point toward the power supply's GND port, one will point toward a component, and one will point toward everything else that still needs a GND connection. The bizarre tapped voltage divider you end up with will be a magnified version of what's already there.

Any two parts of your GND circuit in series with each other will interfere with each other. They're both trying to share the same current-return path, and they both see anything that happens in the shared path. The goal is to arrange the connections so each current-return path touches the power supply's GND port before it meets the return path for another part of the circuit.

The VCC rail works the same way, with the additional problem that your subcircuits are competing for current. Power supplies can only supply so much charge per second, and while 1A sounds good, it means you only get one microamp's worth of charge per microsecond.

CMOS logic is notorious for yanking the rails around. It uses almost no current while it's holding a state, but wants a lot of current when it changes state so it can make the transition quickly. Debounce caps smooth that out by acting like tiny rechargeable batteries that can supply a huge amount of charge for a very short time. They might only last a microsecond, but it's the microsecond when you really need it.

This app note has some good information:

http://www.analog.com/static/imported-f ... AN-202.pdf

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”