#include <iom16v.h>
#include "D:ICC_HCmmICC.H"
#define DISP_DDR DDRB
#define DISP_PORT PORTB
void wdt_init(void)
{
asm("wdr"); //clr wdt
WDTCR=0x0F; //enable wdt,clk = 2048,2.1S
}
/*------------------------------------------------------------------
--------------------------------------------------------------------*/
void main(void)
{
uint8 i;
DISP_DDR = 0XFF;
wdt_init();
while(1)
{
DISP_PORT++; //数据显示向上加,作AVR正常运行的指示
asm("wdr"); //喂狗,去除此句将导致狗饿死,AVR复位
delay50ms(20);
}
} |