You are on page 1of 1

/*

* fuente.c
*
* Created: 08/01/2015 13:08:32
* Author: PERSONALIZAR
*/

#include <avr/io.h>
#include <avr/interrupt.h>
int a=0;
int main(void)
{
TCCR1A=0x00;
TCCR1B=0x0b;
TIMSK1=0x02;
OCR1A=1259;
EICRA=0x02;
EIMSK=0x01;
sei();
DDRA=0x03;
DDRD=0x00;
PORTD=0x04;
while(1)
{
//TODO:: Please write your application code
if (a==0)
{
PORTA=0x01;
}
else{
PORTA=0x02;
}
}
}
ISR(INT0_vect)
{
TCNT1=0;
a=0;
}
ISR(TIMER1_COMPA_vect)
{
a=1;
}

You might also like