Quote Originally Posted by malc-c View Post
Guys, I'm getting a little out of my depth and would like some feedback here.

From my previous posts some of you (two Steves !) will remember that I'm playing with a 16F873 to come up with a better version of some disco lights based on an 16F628a. I'm now looking at hooking up the audio output from a CD player but I've never played with A - D conversion and not sure what I need to do. I've used the example varibles in the manual so I have

[/code]


And it's probably not going to act like a VU meter. I've tried this before. I was semi-successful in 2 ways.

The first way, I got around it by looking for and averaging the peaks of what I was sampling on the A/D port over X time. It's either that or you feed the audio in thru a diode into a capacitor across the A/D port with a small-ish resistor to ground (I wish I could do ASCII graphics). The audio 'charges' up the cap, the resistor discharges it slowly-ish (think R/C time constant), the diode keeps the cap from messing with the input signal and only let's positive voltage thru even though you do lose the .25v or .7v due to forward voltage drop (or you could use an opamp as a follower). Then you sample the A/D input.

The 2nd method was using actual FFT routines on a PIC18F4620, 128 bands per channel updated at about 13hz. Ya baby! That was neat to look at on a 128x64 graphic LCD! But the FFT routines cost me some $$$. Check my site (www.srt.com/~jdgrotte) to see what came out at the PICAlyzer link.

But just sampling the A/D of an audio input won't get you anywhere. It would be just like looking at audio on an o'scope. Doesn't look like anything useful...