Saturday, 10 October 2015

PORT Blinking using TIMER2

#include <avr/io.h>
#include<util/delay.h>
int main(void)
{

 int i;
 DDRA=0xff;
PORTA=0x00;
TCCR2=0x07;

 while(1)
 {  
for(i=0;i<7;i++)
{
   TCNT2=0xff;
while((TIFR&0x40)==0);
TIFR|=0X40;
}
PORTA=PORTA^0XFF;
    }
}

No comments:

Post a Comment