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..
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?