AVR128的程序——定時(shí)器
#include
#define uchar unsigned char
#define uint unsigned int
void timer1_init(void);
uchar temp=0x01;
void main(void)
{
timer1_init();
SEI();
}
void timer1_init(void)
{
}
#pragma interrupt_handler timer1_ovf_isr:15
void timer1_ovf_isr(void)
{
PORTA=temp;
if(temp==0x00)
temp=0x01;
}
評(píng)論