You are on page 1of 1

/*

* timer_interrupt.c
*
* Created: 04-09-2019 15:23:12
* Author : DESD
*/

/* Timer using interrupt for 1sec event */

#define F_CPU 16000000

#include <avr/io.h>
#include <avr/interrupt.h>

int main(void)
{

TCNT1=0xC2F7;
TIMSK|=(1<<TOIE1);
TCCR1B = 0x05;
sei();
DDRC=0xff;

//PORTC=0X00;

while (1)
{

}
}

ISR(TIMER1_OVF_vect){

PORTC=~PORTC;
TCNT1=0xC2F7;
}

You might also like