標題: 單片機全io口喚醒問題 [打印本頁]

作者: ZF追風    時間: 2018-12-15 09:38
標題: 單片機全io口喚醒問題
有沒有一種單片機進入掉電模式后可以任意一個IO口喚醒,求大佬介紹

作者: devcang    時間: 2018-12-15 11:56
從51類型的理解,是全部支持外部中斷,不現(xiàn)實,也沒必要

~~~~~~~~
作者: 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.torrancerestoration.com/bbs/) Powered by Discuz! X3.1