好文档 - 专业文书写作范文服务资料分享网站

PIC16F887单片机内部时钟,看门狗唤醒睡眠模式

天下 分享 时间: 加入收藏 我要投稿 点赞

#include

__CONFIG(INTIO & WDTDIS &DEBUGDIS& PWRTEN & MCLRDIS & UNPROTECT & DUNPROTECT & BORXSLP & IESODIS & FCMDIS & LVPDIS); void delay50us(unsigned char z) {

unsigned char i,j; for(i=0;i

void main() {

unsigned int count; unsigned char temp; unsigned char i; OSCCON = 0x61; OPTION = 0x0f; WDTCON = 0x09; temp = 1; // ANSEL = 0; TRISD = 0x00; delay50us(20); PORTD = ~temp; while(1) {

SLEEP(); //进入睡眠模式;等待WDT溢出唤醒 if(temp>254) temp = 0; else

temp ++;

PORTD = ~temp; } }

#include

__CONFIG(INTIO & WDTDIS &DEBUGDIS& PWRTEN & MCLRDIS & UNPROTECT & DUNPROTECT & BORXSLP & IESODIS & FCMDIS & LVPDIS); void delay50us(unsigned char z) {

unsigned char i,j; for(i=0;i

; }

void main() {

unsigned int count; unsigned char temp; unsigned char i; OSCCON = 0x61; OPTION = 0x0f; WDTCON = 0x09; temp = 1; // ANSEL = 0; TRISD = 0x00; delay50us(20); PORTD = ~temp; while(1) {

SLEEP(); //进入睡眠模式;等待WDT溢出唤醒 if(temp>254) temp = 0; Else temp ++;

PORTD = ~temp; } }

PIC16F887单片机内部时钟,看门狗唤醒睡眠模式

#include__CONFIG(INTIO&WDTDIS&DEBUGDIS&PWRTEN&MCLRDIS&UNPROTECT&DUNPROTECT&BORXSLP&IESODIS&FCMDIS&LVPDIS);voiddelay50us(unsignedcharz){unsignedchar
推荐度:
点击下载文档文档为doc格式
93f7b0bwie2cg5h8iu8w
领取福利

微信扫码领取福利

微信扫码分享