AdSense

Wednesday, 18 September 2013

ATMega - Everything slowed down about the factor of 8?

(Deutsche Version) This problem occured recently: I have an ATmega 1284-P which has a 16 MHz quarz. Sadly, everything was slower as expected, with a factor of 8. The fuses (I use AVR Studio 4, there you don't see every fuse) were ok. After some time on Google, I found out what the problem was: The fuse-bit CKDIV8 is 0, this means that the clock is divided by 8. Sadly, this fuse bit cannot be set with the AVR Studio 4, but there is a simple solution to disable the clock divider:

#include <avr/power.h> 

And then directly at the beginning of the program:

clock_prescale_set(clock_div_1);


This solved the problem for me.

No comments:

Post a Comment