ki@n
Newbie level 5
Hi everyone
I don't know what's happened but it seems that the time/counter unit is not working
I'm writing code for atmega328pu in arduino uno with codevision,I was working on a project with 7 segment(counting up from 0 to 9 with 1 second delay) and everything was ok until the 7 segment stopped working correctly and it just started blinking rapidly
Now I've written this code,the clock is set to 8Mhz,an led(connected to port B.0) must blink with a 1 sec delay,it works properly in proteus but in arduino board the led just turns on and nothing happens after that
I don't know what's happened but it seems that the time/counter unit is not working
I'm writing code for atmega328pu in arduino uno with codevision,I was working on a project with 7 segment(counting up from 0 to 9 with 1 second delay) and everything was ok until the 7 segment stopped working correctly and it just started blinking rapidly
Now I've written this code,the clock is set to 8Mhz,an led(connected to port B.0) must blink with a 1 sec delay,it works properly in proteus but in arduino board the led just turns on and nothing happens after that
C:
#include <mega328p.h>
interrupt [13] void ext_int(void)
{
PORTB ^= (1<<0);
}
void main(void)
{
DDRB.0 = 1;
PORTB.0 = 0;
TCCR1B = (1<<WGM12)|(1<<CS12);
TCNT1H = 0;
OCR1BH = 31249;
TIMSK1 = (1<<OCIE1B);
#asm ("sei");
while(1) {}
}