完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
任何人告诉我写一个代码,应该引起看门狗定时器复位!请任何人帮助我!我只从理论上看,实际上看不到。图片或视频能比在互联网上阅读页数教得好。
以上来自于百度翻译 以下为原文 Anyone tell me to write a code that should cause watchdog timer reset! Can please anyone help me !! I only read theoretically and haven't seen practically. A picture or video can teach well than reading number of pages in the internet. |
|
相关推荐
19个回答
|
|
启用配置字节中的看门狗,并让它运行松散。
以上来自于百度翻译 以下为原文 Enable the Watchdog in your config bit and let it run loose. |
|
|
|
好啊!它是如何重置的?单片机需要挂机吗???????那我该怎么办?给我一个主意????
以上来自于百度翻译 以下为原文 Ok ! How it resets? It needs the mcu need to be hanged ?????? for that what i should do? give me an idea??? |
|
|
|
当WDT计时器到期时,它将重置,只要您不使用CrrWdTh()或CLRWDT重置它,它就会发生。
以上来自于百度翻译 以下为原文 It will reset when the WDT timer expired, which will happen as long as you do NOT reset it with ClrWdt() or CLRWDT. |
|
|
|
嗨,这取决于你的程序是如何编写的,你可能没有注意到PrGRAM连续地运行,或者由看门狗定时器重置。你可以尝试使程序保持一个LED持续5秒,然后在无休止的循环中闪动LED 1/2秒,1/2秒。f.设置看门狗定时器约2秒超时限制。迈西尔
以上来自于百度翻译 以下为原文 Hi, Depending upon how your program is written, you may not notice any difference wether the porgram is running continously, or is reset by the watchdog timer. You may try to make the program such that it keep a LED on for 5 seconds, then in the endless loop, flash the LED 1/2 second On, 1/2 second Off. Set the watchdog timer for about 2 seconds timeout limit. Mysil |
|
|
|
为此,我建议将超时设置为至少8秒;否则,所有OP See将始终是LED。
以上来自于百度翻译 以下为原文 For that, I would suggest setting the timeout to at least 8 seconds; otherwise, all OP see will be the LED on all the time. |
|
|
|
5秒谷歌搜索:HTTPS://VE2CUY.WordPress。COM/WATE-DOT/DOW/W首先理解WDT是什么和它的目的…剩下的就是这个。
以上来自于百度翻译 以下为原文 5 seconds google search: https://ve2cuy.wordpress.com/watch-the-dog/ First understand what the WDT is and its purpose... the rest comes from that. |
|
|
|
嗨,你说得对,我的建议是对OP的一个挑战。为了使程序在第一个长的时间间隔内生存下来,延迟或定时器必须被分成更小的块,并注意中间的看门狗。我要求程序保持5秒钟的LED,我没有要求唱歌。LE 5秒延迟。在实际程序中,看门狗超时发生在出错时,而不是在计划时。迈西尔
以上来自于百度翻译 以下为原文 Hi, You are right about that, my suggestion was meant as a challenge to OP. For the program to survive the first long interval, delay or timer must be divided into smaller chunks with attention to the watchdog in between. I did ask for the program to keep LED on for 5 seconds, I didn't ask for a single 5 second delay. In real programs, watchdog timeout happen when there is a mistake, not when it is planned. Mysil |
|
|
|
|
|
|
|
我看,我的坏-我有一个心态,OP希望看到看门狗定时器重置。
以上来自于百度翻译 以下为原文 I see, my bad -- I was having a mindset that OP wants to see the watchdog timer doing a reset. |
|
|
|
是的,他会,如果他不清除主回路中的看门狗定时器,但根据时间和公差,效果可能,或可能不容易注意到。但是,8秒看门狗超时,如消息6中的1和0所建议的,也将与可观察的效果一起工作。迈西尔
以上来自于百度翻译 以下为原文 Yes, and he will, if he do not clear watchdog timer in the main loop, but depending upon timing and tolerances, the effect may, or may not be easily noticeable. However, 8 seconds watchdog timeout, as suggested by 1and0 in message #6, will also work with observable effect. Mysil |
|
|
|
必须注意的是,看门狗复位可能是一种正常的操作行为,取决于设备的操作模式。例如在低功率器件中。看门狗对错误恢复和有意周期性程序重启都是合适的。
以上来自于百度翻译 以下为原文 Mention must be noted that the watchdog reset may be a normal operational behavior depending on device mode of operation. For example in low power device. Watchdog is good for both, error recovery and intentional periodic program restart when it is appropriate. |
|
|
|
看门狗也可以用来唤醒PIC设备从睡眠模式周期,并在一些设备上,它可以是软件控制的。
以上来自于百度翻译 以下为原文 Watchdog can also be used to wakeup the PIC device from SLEEP mode periodic, and on some devices it can be software controlled. |
|
|
|
在我的代码开始时,我经常使用1秒或2秒的延迟,在那个时候可能会亮红色的LED。然后点亮绿色LED并启动主程序。很容易看出,设备在电源开启或WDT中已经复位。您还可以使用编码闪烁率来指示复位是否来自开机、WDT、断电或其他原因。
以上来自于百度翻译 以下为原文 I often use a 1 or 2 second delay at the start of my code, and perhaps light a red LED during that time. Then light a green LED and start the main program. It's easy to see that the device has reset during power-on or WDT. You can also use a coded blink rate to indicate if reset was from power on, WDT, brownout, or other reasons. |
|
|
|
|
|
|
|
下面是我的代码,根据你的建议。我使用的是PIC16F87A,我有两个疑问。如何计算看门狗定时器复位时间?在哪里放置CLRWDT();???解释清楚!!!!定义了X-TalthFRIQ(20x3f3f);(a)定义Led PosidValb主(){TrdD= 0x00;TrISD= 0x000;OpthyReg=0x0f;Led=0x01;γ-DelayyMS(5000);而(1){Le= 0x01;γ-DelaysMs(500);LED=0x01;γ-DelayyMS(500);}谢谢你包括
以上来自于百度翻译 以下为原文 Here is below my code based on your suggestion. I'm using PIC16F877A. I have two doubts. How to calculate watchdog timer reset time? And where to put CLRWDT(); ??? Explain clearly !!! Thank you #include #include #define _XTAL_FREQ 20000000 __CONFIG(0x3F3F); #define led PORTD void main() { PORTD=0x00; TRISD=0x00; OPTION_REG=0x0F; led=0x01; __delay_ms(5000); while(1) { led=0x01; __delay_ms(500); led=0x01; __delay_ms(500); } } |
|
|
|
对。。。我想在复位模式下看到看门狗定时器。
以上来自于百度翻译 以下为原文 Yes... I want to see the watchdog timer in reset mode. |
|
|
|
|
|
|
|
如果我的程序由一些周期性活动组成,比如串行传输数据,看门狗定时器可能会觉得这是一个无限循环-因为我在重复同样的任务。在这样的情况下,程序员不会在每隔几条指令后连续重置看门狗计时器的头痛,以防止重置UpKely帮助。
以上来自于百度翻译 以下为原文 If my program consists of some periodic activity, say transferring data serially, the watchdog timer may feel this is an infinite loop - since I am repeating the same task. In such a case won't the programmer have the headache of continuously resetting the watchdog timer after every few instructions to prevent resetting the uC Kindly help… |
|
|
|
你需要选择一个适合你的应用程序的看门狗暂停时间。如果系统被锁定,系统需要重启多快?10毫秒?10秒?到处喷洒CLRWDT可能会打败WDT。如果它被困在WDT的循环中,它就不会重置。
以上来自于百度翻译 以下为原文 You need to choose a watchdog time out that suits your application. How fast does the system need to reset if it does lock up. 10milliseconds? 10 seconds? Sprinkling CLRWDT everywhere may defeat the WDT. If it is stuck in a loop with a WDT it will not reset. |
|
|
|
只有小组成员才能发言,加入小组>>
5309 浏览 9 评论
2070 浏览 8 评论
1974 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3243 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2281 浏览 5 评论
828浏览 1评论
721浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
668浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
719浏览 0评论
616浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-1-28 12:39 , Processed in 1.482781 second(s), Total 111, Slave 95 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (威廉希尔官方网站 图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号