AVR ADC PROBLEM !

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
hadikazemi

AVR ADC PROBLEM !

Post by hadikazemi » Mon Jun 30, 2008 5:32 pm

HI
I use AVR ATMEGA 16 ADC for 0-5V Voltmeter ! But ADC get me only 0xFF for all Voltage !
i link AREF and AVCC to VCC (5V) and with 1uf to ground !

i use CodevisionAVR for programming !

any body can help me ?

Maciek

Post by Maciek » Fri Aug 29, 2008 8:02 am

I have the same problem. i use ATmega 32 and 16. Tested with 7 devices on the same bord. 0xFF for all Voltage, for 0V on ADC0 too. I have tested the program on difrent PCB and it works.
I got AVCC linked to VCC. AVCC, AREF and VCC with 100nf to ground.

When I push the VCC from 5V to 5,3V the ADC starts to work. I got 0x00 with 0V on ADC0.

PS. Sorry for my english.

Maciek

Post by Maciek » Fri Aug 29, 2008 11:31 am

To high clock speed. You have to change ADPS bits in ADCSRA register. The ADC clock speed must be less then 200khz to work right.

Post Reply