完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我已经查阅了数据表和参考手册,我还没有一个清晰的理解。我已经启用了WDT,使用LPRC作为时钟源,所以LPCR仍然应该在休眠模式下运行。定时器4框图似乎表明LPRC应该能够在睡眠期间运行定时器4。我有time4设置如下:当我睡觉时,定时器4停止,我会被WDT唤醒。家庭参考手册指出,定时器可以唤醒芯片的唯一方式是定时器1配置外部时钟源。对吗?使用内部源来唤醒唤醒时间的唯一方法是使用WDT?谢谢你的反馈。
以上来自于百度翻译 以下为原文 I've looked through the datasheet and the reference manual, and I don't have a clear understanding still. I have the WDT enabled, using the LPRC as the clock source, so the LPRC should still be running during sleep mode. Timer 4 block diagram seems to indicate that the LPRC should be able to run Timer 4 during sleep. I have Timer4 setup as follows: #define HardwareUpdate_Timebase 500 //Hz (2mS interval) #define TmrLPRC 2 // TECS bits to select a LPRC clock source //Setup interrupt driver using Timer _T4ON = OFF; //Turn off _T4SIDL = OFF; //Turn off in IDLE mode _T4GATE = OFF; //Turn off Gated Time Accumulation Enable bit _T4CS = ON; //Clock source selected by TECS bits _T4TECS = TmrLPRC; //ISR Freq = ((LPRC freq.) / Prescaler) / PR4) //Set pre-scaler //11 = 1:256 //10 = 1:64 //01 = 1:8 //00 = 1:1 _T4CKPS0 = 0; _T4CKPS1 = 0; PR4 = (int)(31000/HardwareUpdate_Timebase); _T4IF = Clear; //Clear Interrupts _T4IE = Enable; //Turn on Interrupt _T4ON = ON; //Turn on timer When I go to sleep the Timer 4 stops, I get woken up by the WDT instead. The family reference manual indicates that the only way a timer can wake up the chip is for Timer 1 to be configured with an external clock source. Is that right? The only way to time the wake up period using an internal source is with the WDT? Thanks for any feedback. |
|
相关推荐
3个回答
|
|
在睡眠模式中,模块被禁用,所以不会做任何事情。在空闲模式下,计时器继续。从MC下载这个文档,它解释了更多的睡眠和空闲模式。第11节。计时器
以上来自于百度翻译 以下为原文 In sleep mode the module is disabled so will not do nothing. In idle mode the timer continues. Download this document from MC, it explains more about sleep and idle modes. Section 11. Timers |
|
|
|
嗨,你确实可以在休眠模式中唤醒CPU,因为LPRC是一个单独的振荡器(参见数据表的图9-1)。然而,诀窍在于,你想要使用的定时器必须是异步的,也就是说,当它停止时,内部时钟不同步。如果仔细查看图13-1,YOU将注意到一个小的称为预分频器和TMR2(TMR4)同步的块。由于这个同步盒,TMR2和TMR4不能在睡眠模式下唤醒这个设备。您将需要使用TMR1/TMR3或TMR5(它们不具有这个同步单元)图12-1和13-3。
以上来自于百度翻译 以下为原文 Hi, You can indeed wake up the CPU in SLEEP mode because LPRC is a separate oscillator (see figure 9-1 of the datasheet). However, the trick is that the timer you want to use MUST be asynchronous, i.e. not synchronized by the internal clock as it is stopped. If you look carefully at the figure 13-1, you will notice a small bloc called SYNC between PRESCALER and TMR2 (TMR4). Due to this SYNC box, TMR2 and TMR4 cannot wake up this device in SLEEP mode. you will need to use either TMR1 / TMR3 or TMR5 which are asynchronous (they don't have this SYNC unit) figure 12-1 and 13-3. Regards |
|
|
|
谢谢你的反馈…我没有注意到图中的同步块,我把重点放在了门同步控制上。我切换到TMR1,它现在确实在工作。我认为家庭参考手册应该用这些信息来更新……第14节定时器,142.1在睡眠模式下的定时器操作“(DS39 704A页14-21)是不正确的与此信息铭记在心。
以上来自于百度翻译 以下为原文 Thank you for the feedback... I had missed noticing that SYNC block in the diagram, I was focused on the gate sync control. I switched to TMR1 and it is indeed working now. As a side note... I think the Family reference manual should be updated with this information... "Section 14 Timers, 14.12.1 Timer Operation in Sleep Mode" (DS39704A-page 14-21) is not correct with this information in mind. |
|
|
|
只有小组成员才能发言,加入小组>>
4824 浏览 9 评论
1829 浏览 8 评论
1747 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
2954 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2059 浏览 5 评论
460浏览 1评论
1111浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
362浏览 0评论
263浏览 0评论
LAN9252使用SQI通信,进行数字复位后读BYTE_TEST异常
1797浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-4-24 08:20 , Processed in 1.142950 second(s), Total 77, Slave 61 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号