Hi there!
First of all, I'm sorry if you will find mistakes in my text. English is not my native language.
If you have a simple code, how to work with Timer1_COMPB_vect on AtMega8, I will be a very grateful.
So.
I am trying to understand how to work with Timer1_COMPB_vect and I wrote the code, but my code doesn't work.
My code:
ISR (TIMER1_COMPB_vect){ cli (); PORTD ^= (1 << PC0); //Example code sei (); } int main (void){ DDRC |= (1 << DDC0); PORTC |= (1 << PC0); TCNT1 = 0x0000; // Initial value is zero TCCR1B |= (1 << CS12) | (1 << CS10); // clk / 1024. 8*10^6/1024 = 7812 tics/sec. OCR1B = 7812; // 1 sec. TIMSK |= (1 << OCR1B); // Interrup of OCR1B. sei (); // Global interrrupt. while (true){} return 0; }
Thanks!