--- crayola@optonline.net wrote: > > I believe it's a frame of 50 per second for it. Might want to=20 > > check this out to be sure. The standard is I believe 50 with=20 > > a 15ms center point PW but I've been wrong before :) >=20 > Yes, your right, it is 50 per second or 20 ms. And a 1.5 ms pulse=20 > should center the servo. >=20 Well I was mostly right hehehe :) > Okay.. Now we're getting into the part where I am lost at..=20 >=20 > Lets see, your suggesting using a bridge rectifier to remove the=20 > lower half of the wave so the voltage is all positive. That makes > sense. And then use a resistor to limit the Voltage to <=3D Vdd.=20 Well it's a standard circuit for make a PERFECT bridge. That's not a bridge circuit using real diodes. It's actually a series of opamps. I would use something to clip the signal to 5V if it saturates not sure off hand what that something should be :) >=20 > So that handles conditioning the audio signal for the PIC.. now the=20 > hard part.=20 >=20 Well part of it at least. It gets the signal to something that can be measured. > Then you suggest based on the voltage, use a logrythmic scale to=20 > produce a value that is ramped up based on the amplitude. Okay..=20 > couple of minor issues, I don=92t have the faintest clue about=20 > logrythmic scales (beyond the fact that they are logrythmic:) It's pretty easy actually look up tables are your friend :) Read in number compute value using standard PIC Look Up Table code. You have magnitude and then average these in a simple pulse acumulator averager. (You subtract the prior average and add the new value in for the next average). > and implementing them in a PIC, and I don=92t have any experience=20 > using the a/d converter. I am going to use a 16F877A for this=20 > project. The data sheet indicates that it can do 8 or 10 bit=20 > resolution. I am not sure why I would choose either one or the=20 > other but based on what I understand, 8 bit would be more=20 > then enough for sampling the audio signal, since I am only=20 > updating the servo every 20ms, and the PIC can sample at=20 Well you only need no more than 8khz to 12khz sampling as you didn't say you needed to do frequency analysis. Using an impulse averaging filter with this (24 bits?) you can have it respond with in 512 1024 2048 samples. Or anywhere from 1/16 to 1/4 of a second. > a much higher rate it appears. An average amplitude over=20 > that 20 ms period (with many samples) would be great to=20 > calculate and give the most accurate result, but one sample=20 > of the amplitude every 20 ms is probably good enough for=20 > this purpose.=20 Ok if you do that you need to add more circuitry :) Namely a capacitor to store the acumulated voltage in and an OP amp buffer to drive the PIC A2D input. You can drain the filter ciruit using a tristated pin from the pic. I actually think it's more complicated because you are adding hardware to do this. Otherwise you are JUST taking a sample at the 20ms point and ignoring everything that happened before that. > Any websites, tutorials, examples I should look at to really=20 > learn from scratch about implementing logrythmic scales in a PIC > and using the A/D converter at 8 bit resolution?=20 Look up table? Try the Application notes on the PICS :) > Anyone have any sample code they could share?=20 > Can anyone else fill in some more blanks?=20 > Ya'll are a big help to a newbie like myself. It seems=20 > as though this project might just be possible based on the=20 > help ya'll are providing.=20 >=20 Filling your head with crazy ideas we are ;) hehehehe >=20 > Heh.. that would be wild:) A bit beyond a PIC's capability to=20 > track a moving object however. Actually.. something that might=20 > be done with a PIC is to interpret a pair of microphones resulting > in a stereo sound, and using the difference between the sounds=20 > to determine where to move the eyes to (left, right, or center).=20 > Hmm.. Maybe that will be my next project:) Anyway, thanks for the=20 > help so far.=20 I can see it getting stuck follow a fly now... hehehehe :) =09 __________________________________=20 Do you Yahoo!?=20 Dress up your holiday email, Hollywood style. Learn more.=20 http://celebrity.mail.yahoo.com _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist