<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>ColdFire/68K Microcontrollers and ProcessorsのトピックRe: M5223X RTC details</title>
    <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5223X-RTC-details/m-p/142795#M2616</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Rocco&lt;BR /&gt;&lt;BR /&gt;Thanks for the idea and the link to the other posting - I did search for RTC but not the register so didn't find it.&lt;BR /&gt;It will not be practical to test whether 25000000 or (25000000-1) is correct since it will only be measurable over long periods with an accurate 25000000 monitor at the same time so it doesn't really make any difference. I will go for the (25000000-1) since it seems to correspond with the instructions.&lt;BR /&gt;&lt;BR /&gt;There is another method to ensure that the overflow doesn't occur and that is to set a second interrupt and read the time on that, however it is not very practicle. I think that I will use your suggested method since it will then not involve with playing with the enable.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Aug 2007 16:46:10 GMT</pubDate>
    <dc:creator>mjbcswitzerland</dc:creator>
    <dc:date>2007-08-12T16:46:10Z</dc:date>
    <item>
      <title>M5223X RTC details</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5223X-RTC-details/m-p/142793#M2614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;SPAN&gt;Hi All&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am just integrating a driver interface to use the RTC in the M5223X.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Since I haven't used it just yet I thought that may be someone who has can answer a couple of points which are not totally clear from the documentation...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. I would like to be able to read back the time. This involves reading three registers (seconds, hours_minutes, days).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a small risk involved because whilst reading one of them it could be possible that others get incremented due to the fact that a 1Hz clock arrives between instructions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Therefore I will try disabling the RTC during the read sequence and re-enabling it again afterwards.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Will this work or will disabling cause side effects (apart from possibly losing a 1 Hz tick?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. I have seen that the set up of the RTC 1Hz rate is given in the example as:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MCF_CLOCK_RTCDR = 48000000;&amp;nbsp; /* device dependent */&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think that the oscillator clock is required and not the PLL rate (?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The M5223X has (always) 25MHz so 25000000 would seem appropriate. However I have also read that the value 0 disables the clock and the divide value is one more that the register value.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This would suggets that the best setting would be (25000000 - 1) - or in the example case (48000000 - 1).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Have I understood this correctly?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apart from those points it seems quiet straight forward. Or is there anything else to watch out for?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mark&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.uTasker.com" rel="nofollow" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2007 05:14:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5223X-RTC-details/m-p/142793#M2614</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2007-08-12T05:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: M5223X RTC details</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5223X-RTC-details/m-p/142794#M2615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi Mark&lt;BR /&gt;&lt;BR /&gt;I have not used the Coldfires yet, but had a similar problem with a real-time clock. My solution was to always read the clock starting with the most significant data: days, then hours, then minutes and finally seconds. Then I would test the seconds value, and if it was zero I would simply read everything again. It potentually adds a few instructions every minute, but works everytime.&lt;BR /&gt;&lt;BR /&gt;As far as your second question:&lt;BR /&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=2188&amp;amp;query.id=18916#M2188" target="_blank"&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;A href="http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=2188&amp;amp;query.id=18916#M2188" target="test_blank"&gt;http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&amp;amp;message.id=2188&amp;amp;query.id=18916#M2188&lt;/A&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2007 08:22:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5223X-RTC-details/m-p/142794#M2615</guid>
      <dc:creator>rocco</dc:creator>
      <dc:date>2007-08-12T08:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: M5223X RTC details</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5223X-RTC-details/m-p/142795#M2616</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Hi Rocco&lt;BR /&gt;&lt;BR /&gt;Thanks for the idea and the link to the other posting - I did search for RTC but not the register so didn't find it.&lt;BR /&gt;It will not be practical to test whether 25000000 or (25000000-1) is correct since it will only be measurable over long periods with an accurate 25000000 monitor at the same time so it doesn't really make any difference. I will go for the (25000000-1) since it seems to correspond with the instructions.&lt;BR /&gt;&lt;BR /&gt;There is another method to ensure that the overflow doesn't occur and that is to set a second interrupt and read the time on that, however it is not very practicle. I think that I will use your suggested method since it will then not involve with playing with the enable.&lt;BR /&gt;&lt;BR /&gt;Cheers&lt;BR /&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.uTasker.com" rel="nofollow" target="_blank"&gt;www.uTasker.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Aug 2007 16:46:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5223X-RTC-details/m-p/142795#M2616</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2007-08-12T16:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: M5223X RTC details</title>
      <link>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5223X-RTC-details/m-p/142796#M2617</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;/DIV&gt;Hi&lt;BR /&gt;&lt;BR /&gt;Here's my new code:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;DIV class="msg_source_code"&gt;&lt;DIV class="text_smallest"&gt;Code:&lt;/DIV&gt;&lt;PRE&gt;    case RTC_GET_TIME:        {        int iLoop = 0;            do {                ((RTC_SETUP *)ptrSettings)-&amp;gt;usDays = DAYS;                ((RTC_SETUP *)ptrSettings)-&amp;gt;hours = (unsigned char)(HOURMIN &amp;gt;&amp;gt; 8);                ((RTC_SETUP *)ptrSettings)-&amp;gt;ucMinutes = (unsigned char)(HOURMIN &amp;amp; MINUTES_MASK);                ((RTC_SETUP *)ptrSettings)-&amp;gt;ucSeconds = (unsigned char)(SECONDS &amp;amp; SECONDS_MASK);            } while ((((RTC_SETUP *)ptrSettings)-&amp;gt;ucSeconds == 0) &amp;amp;&amp;amp; (iLoop++ == 0)); // if seconds is zero re-read to ensure no overflow during first read sequence        }        break;&lt;/PRE&gt;&lt;/DIV&gt;&lt;BR /&gt;Mark&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:43:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/ColdFire-68K-Microcontrollers/M5223X-RTC-details/m-p/142796#M2617</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2020-10-29T08:43:04Z</dc:date>
    </item>
  </channel>
</rss>

