• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

ATmega32a ADC is not working

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.
 

wkrug

Active Member
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.
 

Latest threads

EE World Online Articles

Loading

 
Top