标题: 单片机全io口唤醒问题 [打印本页]

作者: ZF追风    时间: 2018-12-15 09:38
标题: 单片机全io口唤醒问题
有没有一种单片机进入掉电模式后可以任意一个IO口唤醒,求大佬介绍

作者: devcang    时间: 2018-12-15 11:56
从51类型的理解,是全部支持外部中断,不现实,也没必要

~~~~~~~~
作者: yzwzfyz    时间: 2018-12-15 12:21
标准51没有,STC的51可以。
作者: yzwzfyz    时间: 2018-12-15 12:23
学会查手册!查单片机的中断源有哪些,一查便知。
作者: yousunny    时间: 2018-12-15 16:44
STC出的官方验证的,外部中断唤醒
/*------------------------------------------------------------------*/
/* --- STC MCU Limited ---------------------------------------------*/
/* --- STC12C5Axx Series MCU Power-Down wakeup by INT0 Demo --------*/
/* If you want to use the program or the program referenced in the  */
/* article, please specify in which data and procedures from STC    */
/*------------------------------------------------------------------*/

#include "reg51.h"
#include "intrins.h"

//External interrupt0 service routine
void exint0() interrupt 0           //(location at 0003H)
{
}

void main()
{
    IT0 = 1;                        //set INT0 int type (1:Falling 0:Low level)
    EX0 = 1;                        //enable INT0 interrupt
    EA = 1;                         //open global interrupt switch

    while (1)
    {
        INT0 = 1;                   //ready read INT0 port
        while (!INT0);              //check INT0
        _nop_();
        _nop_();
        PCON = 0x02;                //MCU power down
        _nop_();
        _nop_();
        P1++;
    }
}

可以参考一下




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1