I'm having a terrible issue with the ATMEGA32 running at 16MHz.
My program reads the ADC input in an infinite loop.
If I hold Reset during start-up for about 1 second, the program runs correctly and sampling is at the correct speed.
However, when I rely on the chip to start itself (no reset held low at start-up), the program runs unacceptably slowly (I assume an error with the clock somewhere).
I have tried everything to delay the RESET from being pulled high before the power supply has stabilised;
-0.1uF from Reset to Gnd (to delay start-up)
-BOD enabled and set to Vcc=4v
-CLKSEL set to 16K+64mS
Even written a start-up routine that causes a SECOND RESET after start-up (using the Watchdog)..
Still it does not work. Does anyone know what's going on here? Why does the ADC run slow? How long does it need to start-up? and why haven't Atmel taken this into account? Furthermore, what effect does the value of Caps across the supply have?