ATmega32a ADC is not working

Status
Not open for further replies.

osomeim

New Member
I have been trying to get analog data from the sensor and convert it to digital using the ADC pins of the ATmega32a. The code is working fine with the simulation, but when i run the same code on ATmega32a it gives the 255 every time. I tried using the simple potential divider circuit using two 10k resistors but still, the output of the adc is 255. I even connected the adc pin to ground but the output didn't change.

Please help. Thanks in advance.
 
I guess Your problem is not the ADC Input rather the referece voltage.
There are 3 different ways to configure.
1 internal reference
2 external reference
3 reference from AVCC
All these variants need different wireings and external cicuits.
Take a look into the Datasheet page 201 in the full version which combinations of hardware and software configration fit.
AVCC has always to be connected with a inductor to VCC.

P.S.
Don't forget to disable JTAG Fuse when not needed.
It captures a few Ports of PORTC.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…