mov a,@0b00001000 ;P6,3通过按键开关电源。平时100K电阻接地,按下 iow p6 开关P63变高电平 start: wdtc ;disable wdtc mov a,@0B00000101 ;prescaler assign tcc 6 bit disi or eni contw clr tcc ;........ mov a,@0B00001101 ;prescaler assign wdt contw wdtc ;........ mov a,@0 ; 7 bit WDT control, 6 int/io choose bit. iow Re ; ; disable wdt ;......... mov p6,p6 ;read i/o ;........ disi ; ;..... slep ;唤醒之后 disi mov a,@0 ;7 bit WDT control, 6 int/io choose bit. iow Re ;disable wdt nop ;if eni ---interrupt vector nop ;if disi---next instruction bs p6,2 call delay1S bc p6,2 jmp start ;返回 |