完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
海都。看门狗定时器究竟是什么?它是导致复位的计时器吗?如果是这样,我需要做什么在我的照片?我听说我们需要在opthyReg中设置PSA,这意味着每当定时器溢出时,就会产生重置。但实际上,当PIC卡在执行程序时,它应该重置。不是吗?那么,看门狗定时器如何知道程序何时卡住&有效重置,我想在程序卡住时创建重置?那我该怎么办?还解释了在MCU中睡眠意味着什么?什么时候发生?如何使单片机休眠?如果我想唤醒MCU,我该怎么办?我可以通过看门狗定时器或任何中断吗?我在论坛上看到了很多疑问和回答。但这让我感到困惑,任何人都能给我一个清晰的解释。谢谢您。。。。。
以上来自于百度翻译 以下为原文 Hai All. What is watchdog timer actually? Is it a timer which cause reset? If so what i need to do make that work in my pic? I heard we need to set PSA in OPTION_REG, that means whenever timer overflows it creates reset. But actually it should do reset when the pic stuck in executing the program. Isn't it? SO, how watchdog timer knows when the program stuck & effectively reset, i want to create a reset when the program stuck? for that what i should do?? And also explain me what is mean by sleep in mcu? when it happens ? how to make the mcu sleep? If i want to wake up the mcu , what i should do? can i do by Watchdog timer or any interrupt? I saw many queries & replies in the forum. But it confused me. Anyone give me the crystal clear explanation. THANK YOU..... |
|
相关推荐
1个回答
|
|
一旦激活(这是通过PIC的CONFIG单词进行的),您必须每隔几毫秒重置一次WDT。数据表解释了如何重置WDT。如果您的软件在没有重置定时器的循环中停滞不前,那么一段时间之后它将导致重置。您必须安排您的软件以便重置。如果它正常运行,它将继续定期重置WDT,但如果代码被卡住,则不会重置它。您的问题都表明您没有花时间阅读PIC的数据表。还要注意,PIC16F877是一个非常旧的设备。微芯片制造类似的设备更便宜,更快,更容易设计,也更容易调试。看看PIC16F1xx系列。顺便说一下,您已经在“C18”论坛上发布了这个问题,它不适用于PIC16F设备。你应该张贴在“PIC微控制器(PIC10F,PIC12F,PIC16F,PIC18F)”论坛上。
以上来自于百度翻译 以下为原文 Once activated (which you do via the PIC's CONFIG words), you must reset the WDT every few milliseconds. The datasheet explains how to do that. If your software gets stuclk in a loop where it is not resetting the timer, then after a certain ime it wil cause a reset. You must arrange your software so that if it is running normally, it will keep resetting the WDT regularly, but not reset it if your code gets stuck. Your questions all indicate that you have not taken the time to read though the datasheet for your PIC. Also note, the PIC16F877 is a very old device. Microchip make similar devices which are cheaper, faster, easier to design around, and easier to debug. Look at the PIC16F1xxx family. Also, byu the way, you have posted this question in the "C18" forum, which is not applicable for a PIC16F device. You should have posted in the "PIC Microcontrollers (PIC10F, PIC12F, PIC16F, PIC18F)" forum. |
|
|
|
只有小组成员才能发言,加入小组>>
5178 浏览 9 评论
2003 浏览 8 评论
1931 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3177 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2228 浏览 5 评论
737浏览 1评论
622浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
509浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
636浏览 0评论
533浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 18:16 , Processed in 0.608771 second(s), Total 44, Slave 37 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号