<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Handling RTC overflow</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21686/handling-rtc-overflow</link><description>Hi all, I have an nRF52832 which is woken up every 15 seconds by an RTC to check for ESB broadcasts. The nRF52 will be powered continuously until the battery runs out, so at some point the RTC will overflow. If the ESB does receive a packet, there will</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Apr 2017 11:58:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21686/handling-rtc-overflow" /><item><title>RE: Handling RTC overflow</title><link>https://devzone.nordicsemi.com/thread/85179?ContentTypeID=1</link><pubDate>Thu, 27 Apr 2017 11:58:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e7522c2-0dd7-467b-906d-e46b9a9cbb77</guid><dc:creator>Steve H</dc:creator><description>&lt;p&gt;Great, thanks butch. I&amp;#39;ll just ensure that the 32-bit target counter value is modulo 24-bit before I set it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Handling RTC overflow</title><link>https://devzone.nordicsemi.com/thread/85178?ContentTypeID=1</link><pubDate>Thu, 27 Apr 2017 11:51:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19e5a59f-d27b-43f5-bc6d-87395458c65d</guid><dc:creator>butch</dc:creator><description>&lt;p&gt;I think you do not need to &amp;quot;handle it&amp;quot; if your other math for setting the compare registers is proper modulo (clock) arithmetic.  When the counter overflows, it goes back to zero and keeps counting.  You can configure an event for overflow, but I don&amp;#39;t think you need to (unless you need to count the overflows, for example to keep a long clock.)  The tricky part is setting the compare register: when the counter is near overflow it is a large number, when you calculate the compare value modulo the size of the counter it yields a small number, but thats what it should be.  All unsigned arithmetic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>