We are using a ATmega328 micro on a project based on an Arduino with a 328. We have setup the registers correctly, and upload the compiled HEX file from Arduino to the micro over AVR Studio. The entire program executes as expected, with the exception of reading in analog.
When using the analogRead() function on our standalone micro it always returns 1023, the max value. On the Arduino it returns the correct value. We are also using I2C which operates correctly, which uses pins A4 and A5. I have also tried more than one micro so I can confidently say it's not a hardware issue.
Does anyone have any suggestions? Are there any differences that I might not be accounting for?