maniamoozadeh
Newbie level 3
proteus problem
hello.
I have a problem with counter/timer0 of the atmega16 AVR.
I wrote a simple code in codevisionAVR and then simulate it in proteus.
but the timer doesn't count up to 0xFF. I don't know why ?
my code seems to be right.
in proteus I put a atmega16 in designer windows. then set the CKSEL Fuses to
"internal RC 8 MHz" oscillator. then go into debug mode and open the watch
window and put TCNT0 register in it.
the TCNT0 counts up to a value (not 0xFF) and then goes to 0 !
hello.
I have a problem with counter/timer0 of the atmega16 AVR.
I wrote a simple code in codevisionAVR and then simulate it in proteus.
but the timer doesn't count up to 0xFF. I don't know why ?
my code seems to be right.
in proteus I put a atmega16 in designer windows. then set the CKSEL Fuses to
"internal RC 8 MHz" oscillator. then go into debug mode and open the watch
window and put TCNT0 register in it.
the TCNT0 counts up to a value (not 0xFF) and then goes to 0 !
Code:
#include <mega16.h>
void main()
{
TCCR0 = 0x05;
TCNT0 = 0x00;
while(1)
{
}
}