Microchip
直播中

尤娟

7年用户 224经验值
私信 关注
[问答]

如何关闭INT1.DSWAKELbits.XX?

嗨,伙计,我使用PIC18F97 J94。我只想在执行睡眠()功能后用It0唤醒深度睡眠模式。我的问题是我也能用iT1唤醒它。数据表上说只有INT0可以唤醒深度睡眠模式,我如何关闭INT1.DSWAKELbits.XX,那里没有引脚(EXT)。

以上来自于百度翻译


      以下为原文

    Hi guys,
im using PIC18F97J94. I only wanna wake up the deep sleep mode with INT0 after execute SLEEP() function. My problem is
I can wake it with INT1 too. The datasheet say only INT0 can wake up the DEEP SLEEP MODE, how can I turn off the INT1.
DSWAKELbits.XX there ist no pin (EXT).

回帖(1)

陈藜文

2019-6-24 10:47:28
你好!我也试图从睡眠中唤醒PIC18F97 J94。它从空闲和睡眠模式唤醒只是罚款,但没有唤醒从深睡眠模式在EXT RTC或DSSWT。只有MCLR复位唤醒它。你能告诉我DS模式的配置吗?就是说,你是如何让它在INT0 n INT1上醒来的。这里是我写的代码:-//这是主要部分sprintf(data0,“startt”);.String(data0,2);.String(data0,3);.String(data0,3);.String(data0,4);.(20);sprintf(data1,“等待重启”);.String(data1,2);transmitString(data1,3);.String(data1,4);DS();/*,其中DS定义为IDLEN=0;IDLEN=0;SWDTEN=1;DSWDT=1;DSWDT=1;DSEN=1;DSEN=1;Sleep();//现在我希望PIC唤醒并打印这个againpragma conf如下//CONFIG6L#pragma配置WDTWIN=PS25_0//Watch Dog Timer Window(Watch Dog Timer Window Width是25%)agma config WDTEN=ON//Watchdog Timer Enable(由SWDTEN位设置控制的WDT)pragma config WINDIS=WDTSTD//Window Watchdog Timer.ble(标准WDT选择;Windowd WDT禁用)pragma config WPSA=128//WDT Prescaler(WDT预分频比为1:128)//CONFIG7Lpragma RETEN=ON//保持电压调节器控制启用(睡眠期间由SRETEN控制的保持)pragma config VBTBOR=ON//VBAT BOR启用(启用VBAT BOR)pragma config DSBOREN=OFF//深睡眠BOR启用(深睡眠时BOR禁用(不影响非深睡眠模式下的操作)#pragma config DSBITEN=ON//DSEN位启用位(深度睡眠由寄存器位DSEN控制)//CONFIG7H//CONFIG8L#pragma config DSWDTPS=DSWDTPS=DSWDTD//深度睡眠监视器定时器后置选择(1:262114(8.456Secs)//CONFIG8H#pragma配置DSWDTEN=ON//深度睡眠监视器定时器Enable(DSWDT Enabled)#pragma config DSWDTOSC=LPRC//DSWDT参考时钟选择(DSWDT使用LPRC作为参考时钟),但是上面的代码没有唤醒它。如果我设置DSEN=0,那么它会重置正确的FRM休眠模式。但这也带来了同样的问题。接收到了It0,但PIC没有唤醒。

以上来自于百度翻译


      以下为原文

    Hi!
I am also trying to wake up PIC18F97J94 from deep sleep. It wakes up from IDLE and SLEEP mode just fine, but doesn't wake up from DEEP SLEEP mode on EXT RTC or DSWDT. only MCLR reset wakes it up.
can u please tell me the configurations for DS mode? i.e. how u got it to wake up on INT0 n INT1.
 
here is the code I have written:-
//this is the main part
 sprintf(data0 , "startedt");
        transmitString(data0 , 2);
        transmitString(data0 , 3);
        transmitString(data0 , 4);
        
            delay(20);
      
        sprintf(data1 , "waiting for restartt");
        transmitString(data1 , 2);
        transmitString(data1 , 3);
        transmitString(data1 , 4);
       
        DS();
 
/* where DS is defined as  
    IDLEN = 0;
    IDLEN = 0;
SWDTEN = 1;
DSWDT = 1;
DSWDT = 1;
    DSEN = 1;
    DSEN = 1;
    Sleep();
// now I want PIC to wake up and print this again
pragma conf is as follows
 
// CONFIG6L
#pragma config WDTWIN = PS25_0  // Watch Dog Timer Window (Watch Dog Timer Window Width is 25 percent)
#pragma config WDTCLK = FRC     // Watch Dog Timer Clock Source (Use FRC when WINDIS = 0, system clock is not INTOSC/LPRC and device is not in Sleep; otherwise, use INTOSC/LPRC)
#pragma config WDTPS = 8192     // Watchdog Timer Postscale (1:8192)

// CONFIG6H
#pragma config WDTEN = ON       // Watchdog Timer Enable (WDT controlled by SWDTEN bit setting)
#pragma config WINDIS = WDTSTD  // Windowed Watchdog Timer Disable (Standard WDT selected; windowed WDT disabled)
#pragma config WPSA = 128       // WDT Prescaler (WDT prescaler ratio of 1:128)

// CONFIG7L
#pragma config RETEN = ON       // Retention Voltage Regulator Control Enable (Retention controlled by SRETEN during Sleep)
#pragma config VBTBOR = ON      // VBAT BOR Enable (VBAT BOR is enabled)
#pragma config DSBOREN = OFF    // Deep Sleep BOR Enable (BOR disabled in Deep Sleep (does not affect operation in non-Deep Sleep modes))
#pragma config DSBITEN = ON     // DSEN Bit Enable bit (Deep Sleep is controlled by the register bit DSEN)

// CONFIG7H

// CONFIG8L
#pragma config DSWDTPS = DSWDTPSD// Deep Sleep Watchdog Timer Postscale Select (1:262114 (8.456 Secs))

// CONFIG8H
#pragma config DSWDTEN = ON     // Deep Sleep Watchdog Timer Enable (DSWDT Enabled)
#pragma config DSWDTOSC = LPRC  // DSWDT Reference Clock Select (DSWDT uses LPRC as reference clock)
 
But above code doesnt wake it up. if I set DSEN = 0; then it resets properly frm SLEEP mode.
I tried with ext RTC too. but that gives same problem. INT0 is received but PIC doesnt wake up.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分