You can speed up the ADC by specifying a small clock divisor. The default is around 64 or 128, but you can specify 8x or even 4x and get much faster conversions. The accuracy will suffer, but, so what. With a 4mhz clock and a clk/4 ADC clock, each conversion will take 13 us for a conversion rate of ~76k/s. Hmm, I guess clk/8 will give you ~38khz conversion which should be plenty good. Read the BASCOM help for "config adc" and replace "auto" with 4 or 8 (or whatever) to get the faster speeds. To AC couple your signal, you need a capacitor between the ADC input and your signal. Use your Vcc/2 to bias the ADC side of the capacitor. The size of the resistor and the capacitor will be somewhat important, but alas, my electronic theory can't help you here with hard numbers. Try 10k + .1uf ceramic cap to start. Cheers! -----Original Message----- From: c45a6 [mailto:clone45@hotmail.com] > > Try hopping up the A/D to 250kHz, and using all 8 bits. > AC Couple your audio, and weakly (10k?) pull the A/D input to >VCC/2, and use VCC as your analog ref. Thanks for the fast response! I have some follow up questions. 1. Er.. How do you hop up the A/D to 250kHz? Do you set the ADPS bits of ADCSRA? I'm using the internal clock. Is that a big no-no? 2. "pull the A/D input to VCC/2" Sorry, my electronics language skills are terrible. Do you mean run a pull up resistor (around 10k) between VCC/2 and the A/D input pin? I just happen to have a VCC/2 source on my board already that I use for the reference voltage on the D/A converter. 3. How does one AC Couple the audio? Do you have any links to schematics for that? My pathetic little electronics books don't cover that subject. :-( A million thanks! - Bret
Message
RE: [AVR-Chat] Re: A/D and audio questions.
2004-01-03 by Larry Barello
Attachments
- No local attachments were found for this message.