Re: [AVR-Chat] ADC tips?
2005-03-11 by Jose Fuentes
I had problems using the 2.56V internal reference. I switched to VCC reference (by software, yo don't need to change anything on the hardware) and it improved significantly. Also, there was a problem with the AD reading routine because it was initializing the ADC every time the routine was called. Take into account that the crystal frequency and the prescaler settings may affect the precision of the readings. Now my board is pretty stable, even the LSB bit. I use an LC filter between VCC and AVCC. Regards Jose --- Leon Heller <leon.heller@dsl.pipex.com> wrote: > > > ----- Original Message ----- > From: Stuart Whelan > To: AVR-Chat@yahoogroups.com > Sent: Friday, March 11, 2005 2:19 AM > Subject: [AVR-Chat] ADC tips? > > > Hi folks, > > I am playing with some ADC stuff, but (Damn it Jim,) > I am a programmer, > not an electronics whiz. > > I am using Mega8's in PDIP packages, using the > internal oscillator > (running at 8Mhz). > > The chip is setup to use the internal reference > 2.56V and a prescaler of > 64 (giving 125.000 kHz ADC clock freq). > > I have .1uf smoothing caps on the right next to the > chips between VCC > and GND. > > I have .1uf caps between AVCC and GND, and also > between AREF and GND. > Once again right next to the IC. > > The analogue source is 100K linear POTs. > > The pots are 3pin pots with pin 1 connected to GND, > pin 3 to AREF and > pin 2 to the ADCn. > > The priority is on smooth and non-fluctuating/steady > signal as opposed > to an 'accurate' signal. It is for joystick inputs, > and the pots are > connected to things like throttles and flight yokes, > rudder pedals. > > The Mega8 iterates through the 6 ADC channels. > > I have implemented software smoothing within the > chip, but the raw > hardware signal is bouncing around by up to 4 bits. > > My question are these: What else can I do or should > I do to get a > 'smooth signal'? > > - Should I be using an external clock source? > > - Should I be using VCC as my AREF? > - Should I be using something other than the Int.Ref > 2.56v for AREF? > - What would be regarded as a 'smooth' VCC or AREF? > My VCC at the moment > is fluctuating by about 20mV according to the scope. > > Any comments, tips suggestions or advice would be > most welcome. > > Have you followed the suggestions on the data sheet > (page 200) regarding the > power connections? I've played around with the > Mega8535 ADC with input from > a pot and got very stable values. I was using a > home-made PCB but I didn't > bother with the recommended analogue ground plane. > > Leon > -- > Leon Heller, G1HSM > http://www.geocities.com/leon_heller > > > > > Yahoo! Groups Links > > > AVR-Chat-unsubscribe@yahoogroups.com > > > > > > ___________________________________________________________ 250MB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar