完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
我有一些关于WDT的问题。当WDT醒来时,如何让程序在等待指令后面运行?参考纸编号:DS601114GIN第9节。看门狗、死人和上电定时器18:在睡眠模式下造成WDT超时以中断为例,在确定为WDT唤醒之后,可在启动代码中使用来自中断指令的返回(ReFiE)。这将导致代码执行之后的操作码继续执行,将指令设为省电模式(示例示例9-2)。我使用示例9-2一些代码,但没有成功;如果((RCON&0x18)=0x18){//WDT导致休眠易失性唤醒(“ErET”)“”,我的问题是,如何让程序从WDT唤醒时从等待指令后面跑出来?
以上来自于百度翻译 以下为原文 I have some questions about the WDT. How to let the program run from behind the WAIT instruction when from WDT wake up? reference paper number: DS60001114G in Section 9. Watchdog, Deadman, and Power-up Timers page 18: To cause a WDT time-out in Sleep mode to act likean interrupt, a return from interrupt instruction(RETFIE) may be used in the start-up code after the event was determined to be a WDT wake-up. This will cause code execution to continue with the opcode following the WAIT instruction that put the deviceinto the Power-Saving mode (seeExample 9-2). i used Example 9-2 some code ,But there is no success; if (( RCON & 0x18 ) == 0x18) { // The WDT caused a wake from sleep asm volatile ( “eret” ); // return from interrupt } LED_InitTest(); // Unlock the OSCCON register SYSKEY = 0x12345678; //write invalid key to force lock SYSKEY = 0xAA996655; //write Key1 to SYSKEY SYSKEY = 0x556699AA; //write Key2 to SYSKEY // OSCCON is now unlocked OSCCONSET = 0x10; // set power save mode to Sleep // Alternate relock code in ‘C’ SYSKEY = 0x33333333; // OSCCON is relocked WDTCONSET = 0x8000; // Enable WDT while(1) { WDTCONSET = 0x01; // service the WDT // In certain devices, software must write a 0x5743 // to WDTCON<31:16> using a single 16-bit write tmp = RCON; // Perform a dummy read before WAIT instruction //asm volatile ( “wait” ); // put device into selected power-saving mode __asm__ __volatile__ ("wait"); // code execution will resume here after wake LED_WDT_Wakeup(); } so,my question ,How to let the program run from behind the WAIT instruction when from WDT wake up? |
|
相关推荐
1个回答
|
|
|
我认为这个代码是无效的。
以上来自于百度翻译 以下为原文 __asm__ __volatile__ ("eret"); i think this code is invalid . |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1122浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
872浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-1 22:42 , Processed in 0.959573 second(s), Total 72, Slave 55 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
1151