Has anyone had a problem with the analogread function on when using an atmega32?
I connect AVCC to 5V and the AGND. I then connect a potentiometer to a ADC pin, but all I ever get are values ranging from 1016 to 1023 no matter how I adjust the voltage.
Do any of the arduino files need to be modified again to work with the Atmega32? (I already have the atmega32/644 mod files)
Hi, I got the 8 analog input pins on PORTA 0-7 to work using the atmega32 mod I found on a different site,but I can only get outputs from PC6 and PC7 and no PWM's at all.
I am not sure if the pin mappings are completely correct for the atmega32.
"So you connect one end of the pot to +5, the other end of the pot to gnd and the wiper to A0?"
Yes
AVCC is +5V
AGND is GND
AREF is unconnected
I tired using all of the ADC channels none of them worked. When I adjust the pot I can read on the oscilloscope the change, but I the values the pins read do seem not reflect any change in voltage. They change values randomly, or not at all depending on the channel.
From reading the link you provided, the pin mapping files are the same as the ones already used in the "on to atmega 32" posts on this site. which is where I got mine
I am however running at 4 MHz, do I need to change ADC clock prescaler to reflect this?