vibhorkhanna
05-14-2006, 07:35 PM
hi all,
i m planning to blink an led using timer0 overflow interrupt and use this to extend it later....
but i m not able to do so....the interrupt works just once.....
below is the code....... i m using c and compiling using winavr
#include <avr\io.h>
#include<avr\interrupt.h>
#include<avr\signal.h>
void init(void)
{
TIMSK=0x01;
TCCR0=0x05;
TCNT0=0x00;
DDRB=0xff;
PORTB=0x00;
sei();
}
SIGNAL (SIG_OVERFLOW0)
{
TCNT0=0x00;
PORTB|=~(1<<PB1);
cbi(TIFR, TOV0);
//sei();
}
int main( void )
{
init();
while(1)
{
}
}
i commented out cbi() instruction but still to no change
pls ...help
i m planning to blink an led using timer0 overflow interrupt and use this to extend it later....
but i m not able to do so....the interrupt works just once.....
below is the code....... i m using c and compiling using winavr
#include <avr\io.h>
#include<avr\interrupt.h>
#include<avr\signal.h>
void init(void)
{
TIMSK=0x01;
TCCR0=0x05;
TCNT0=0x00;
DDRB=0xff;
PORTB=0x00;
sei();
}
SIGNAL (SIG_OVERFLOW0)
{
TCNT0=0x00;
PORTB|=~(1<<PB1);
cbi(TIFR, TOV0);
//sei();
}
int main( void )
{
init();
while(1)
{
}
}
i commented out cbi() instruction but still to no change
pls ...help