完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
这是一个跨接线,线程始于2015年7月,标题为“MCP7940警报不可用”。我目前没有收到任何回复,所以无论是因为这是一个老话题,没有人有任何东西要说,或者因为没有人在这个话题下看……我的下一步是微芯片支持本身。根据数据表,如果*ALM0和ALM1都被设置(EN位设置),警报标志清除(IF位为零),ALMPOL清除(零),那么MFP管脚将仅在*BOTH*警报匹配时触发。据我所知,这并没有发生。例如:Setup alARM#0[0x0D]:alarm.ity(0)、.on seconds(000)、cleared inter.标志(0)、因为0无效而不关心工作日(001)//setworkkdayto 1 Setup alarm#1[0x14]:.ity被忽略(0)、.on.(001)、cleared int触发标志(0),不在乎工作日(001)设置闹钟#0到(例如)25秒的时间[0x0A](所有其他的闹钟寄存器未被触摸)设置闹钟#1到(例如)3分钟[0x11](所有其他的闹钟寄存器未被触摸)设置控制寄存器[0x07]:启用闹钟#0和闹钟#1,另一个数据表说应该在xx:03:25发出警报(MFP应该变低)。但是,它在xx:03:00(没有其他时间)发出警报。如果我单独使用任何一个警报,它们都按预期工作(如数据表所说)。
以上来自于百度翻译 以下为原文 This is a cross-post with a thread started in July 2015 titled "MCP7940 Alarm Unusable". I've received no replies at this time, so whether this is because it is an old thread, no-one has any thing to say, or because no-one looks under this topic... my next step is microchip support itself. According to the datasheet, if *both* ALM0 and ALM1 are set (EN bits set), alarm flags clear (IF bits zero) and the ALMPOL is clear (zero), then the MFP pin will only trigger when *BOTH* alarms match. As far as I can determine, that is not happening. eg: Setup alarm#0 [0x0D] : alarm polarity (0), trigger on seconds (000), cleared interrupt flag (0), don't care weekdays (001) //set weekday to 1 because 0 is invalid Setup alarm#1 [0x14] : polarity is ignored (0), trigger on minutes (001), cleared interrupt flag (0), don't care weekdays (001) Set time for alarm #0 to (example) 25 seconds [0x0A] (all other alarm registers untouched) Set time for alarm #1 to (example) 3 minutes [0x11] (all other alarm registers untouched) Setup the control register [0x07] : enable both alarm #0 and alarm #1, the other bits are not required (00110000) The datasheet says this should alarm (MFP should go low) at xx:03:25 However, it alarms at xx:03:00 (and at no other time). If I use either alarm separately, they work as expected (as the datasheet says). Has anyone else encountered this problem with the MCP7940N chips? |
|
相关推荐
2个回答
|
|
|
对于感兴趣的读者来说,如果其他人有这个问题,这里是Microchip回应:嗨,我已经阅读了论坛。你得到的结果是正确的行为。由于ALARM0设置为25S,假设RTCC时间为0:00,在第一个25S期间应该声明告警0。因为ALARM0已经被断言,RTCC只等待直到RTCC时间达到3min(ALARM1)之前MFP被断言。这就是为什么在3点,而不是在3:25报警。如果你需要在3:25报警,你可以使用一个警报,并设置相应的面具匹配在秒,分钟,小时,星期,日期和月。如果你需要使用双警报,我的建议是,在旗标被声明后,你需要清除ALARM0中断标志“某个时间”。这应该防止MFP PIN在ALARM1到达时(3:00)被断言。RTCC等待直到在MFP被断言之前再次到达ARARM0(25S)。请注意,MFP只有在“一段时间”内才会被断言。这是时间,它需要从警报AR0开始,直到你清除ALARM0中断标志。我附上两个数字。MCP7940NI方案解释了什么是HAPPENNEN,MCP7940NY建议是您可以尝试的建议。我希望这有帮助。谢谢,MJ
以上来自于百度翻译 以下为原文 For interested readers, in case someone else has this problem, here is the microchip response: Hi, I've read the forum. The result you got is the correct behaviour. Since alarm0 is set at 25s, assuming rtcc time is 0:00:00, alarm 0 should be asserted during the first 25s. Since alarm0 is already been asserted, the rtcc only waits until rtcc time reaches 3min(alarm1) before MFP is asserted. This is why it is alarming at 3:00 and not at 3:25. If you need an alarm at 3:25, you can use single alarm and set the corresponding mask to match at Seconds, Minutes, Hour, Day of Week, Date and Month. If you need to use dual alarm, my suggestion is that you need to clear the alarm0 interrupt flag 'some time' after the flag has been asserted. This should prevent MFP pin to be asserted at when alarm1 has been reached (3:00). The rtcc waits until alarm0(25s) is reached again before MFP is asserted. Take note the MFP should be de-asserted only for 'some time'. This is time is the time it takes from the alarm0 asserted until you cleared the alarm0 interrupt flag. I attached two figures. MCP7940N_Scenario explains what is hapenning and MCP7940N_Suggestion is my suggestion that you can try. I hope this helps. Thanks, MJ |
|
|
|
|
|
嗨,MJ,谢谢你的澄清-现在你已经指出了它是完全有意义的!我想我只使用一个警报,设置和中断最重要的(小时),然后重置相同的警报和中断在最不重要的(分钟)。分钟/秒场景只是为了测试,所以我不需要等待几个小时来查看我的代码逻辑是否如预期的那样工作。非常感谢。
以上来自于百度翻译 以下为原文 Hi MJ, Thanks for the clarification - it makes perfect sense now you've pointed it out! I think I will use only a single alarm, set and interrupt on the most significant (hours) and then reset the same alarm and interrupt on the least significant (minutes). The minutes/seconds scenario was just for testing so I didn't have to wait several hours to see if my code logic was working as expected. Thankyou very much. |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501 浏览 0 评论
5811 浏览 9 评论
2350 浏览 8 评论
2237 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3544 浏览 3 评论
1159浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1120浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
888浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
501浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-13 14:00 , Processed in 0.802616 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
3632