<?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>8-bit Microcontrollers中的主题 Re: Using RTC in MC9S08SH8 microcontroller to make a Clock Hour</title>
    <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165073#M10356</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Can you please provide me the code to provide an interface between MC9s08sh8 and RTC.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;thanks and regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Vignesh.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 10 Apr 2013 11:27:16 GMT</pubDate>
    <dc:creator>admin</dc:creator>
    <dc:date>2013-04-10T11:27:16Z</dc:date>
    <item>
      <title>Using RTC in MC9S08SH8 microcontroller to make a Clock Hour</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165068#M10351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &amp;nbsp; I'm using a Mc908SH8, and I have a issue with the&amp;nbsp;&lt;SPAN&gt;RTC&lt;/SPAN&gt;&amp;nbsp;module that &amp;nbsp;count days, and I have an ERROR of 1 hour &amp;nbsp;y 1 day. I need please an example to correct this error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have use this register initialization.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RTCSC &amp;nbsp; &amp;nbsp;= 0x1F;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RTCMOD &amp;nbsp; = 0x00;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The interrupt routine:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;interrupt void isrRTClk(void){ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // RTC interrupt one per second&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; RTCSC |= 0x80;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Seconds++;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; if(Seconds &amp;gt; 59){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;Minutes++;&amp;nbsp;Seconds&amp;nbsp;= 0;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;if(Minutes&amp;nbsp;&amp;gt; 59){&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Hours++;&amp;nbsp;Minutes&amp;nbsp;= 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(Hours&amp;nbsp;&amp;gt; 23)&amp;nbsp;Hours&amp;nbsp;= 0;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;}&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks, and regards&lt;/P&gt;&lt;P&gt;Jorge &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Nov 2010 22:54:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165068#M10351</guid>
      <dc:creator>BairesRobotics</dc:creator>
      <dc:date>2010-11-24T22:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using RTC in MC9S08SH8 microcontroller to make a Clock Hour</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165069#M10352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The internal 1 KHz oscillator has a possible error (based on the QE128 datasheet, yours may differ) of about +/- 30%.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1 hour in a day is roughly 4%, so it's good enough.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To correct this error, use a different clock source.&amp;nbsp; The 1 KHz is only meant to give rough timing (eg., for delays, etc.), not for accurate clock keeping.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 00:17:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165069#M10352</guid>
      <dc:creator>tonyp</dc:creator>
      <dc:date>2010-11-25T00:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using RTC in MC9S08SH8 microcontroller to make a Clock Hour</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165070#M10353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Jorge,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Building a clock is easy if you work on a good time reference.&lt;/P&gt;&lt;P&gt;Be aware that due to cumulative errors, more than some PPMs are not acceptable.&lt;/P&gt;&lt;P&gt;A cheap reference is 32,768Hz xtals and these xtals are targeted to this application so PPM errors are fair enough.&lt;/P&gt;&lt;P&gt;SH8 architecture allows you to use directly these xtals.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it helps,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Celso&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 00:34:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165070#M10353</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2010-11-25T00:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using RTC in MC9S08SH8 microcontroller to make a Clock Hour</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165071#M10354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To achieve a timekeeping accuracy of say, one second per day, the reference frequency error will need to be within 10 parts per million (ppm).&amp;nbsp; Using a watch crystal as an external reference would achieve this accuracy only if it is trimmed with a trimmer capacitor.&amp;nbsp; However, the method of adjusting the trim setting is likely to be by "trial and error" - not very convenient or quick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With direct frequency measurement of the&amp;nbsp;reference, the&amp;nbsp;capacitive loading of the measurement probe will cause errors, and you would need a frequency counter with 0.1Hz resolution.&amp;nbsp; Setting the output of a TPM channel for a&amp;nbsp;specific period, and using a counter with period measurement capability, and with the period averaged over a number of cycles, may give more successful results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another approach is &lt;U&gt;not&lt;/U&gt; to trim the crystal at all, but to automatically&amp;nbsp;apply a&amp;nbsp;time correction whenever the accumulated error reaches, say one second.&amp;nbsp; The actual error, which might be 100 ppm or more,&amp;nbsp;could be initially determined&amp;nbsp;by measurement of TPM output period, as mentioned above, and would need to be stored as a non-volatile parameter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Nov 2010 04:43:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165071#M10354</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2010-11-27T04:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using RTC in MC9S08SH8 microcontroller to make a Clock Hour</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165072#M10355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think Mac is right in general terms. As most the designs I'm involved with are targeted to automotive apps, I'd strongly suggest you use a fixed-type oscillator w/ NP0 caps. Trimmers sometimes have significant TCs, poor vibration specs&amp;nbsp; and sometimes drift w/ conformal coating.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As Mac said you'll need calibration. One usual method is to use a pulse generated by the uC (HW defined e.g. generated thru Output compares) read by an external ATE. The ATE can e.g. gate an OCXO with the uC signal so the resolution depends on your pulse width. So you can use this value to NV trim your clock.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it helps,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Celso&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Nov 2010 05:55:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165072#M10355</guid>
      <dc:creator>celsoken</dc:creator>
      <dc:date>2010-11-27T05:55:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using RTC in MC9S08SH8 microcontroller to make a Clock Hour</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165073#M10356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Hi,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Can you please provide me the code to provide an interface between MC9s08sh8 and RTC.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;thanks and regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; background-color: #ffffff;"&gt;Vignesh.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Apr 2013 11:27:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165073#M10356</guid>
      <dc:creator>admin</dc:creator>
      <dc:date>2013-04-10T11:27:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using RTC in MC9S08SH8 microcontroller to make a Clock Hour</title>
      <link>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165074#M10357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vignesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not tested it, but the RTC interrupt code initially given by Jorge in this post should work correctly, given a suitable accuracy for the clock source.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mac&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 11 Apr 2013 01:24:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/8-bit-Microcontrollers/Using-RTC-in-MC9S08SH8-microcontroller-to-make-a-Clock-Hour/m-p/165074#M10357</guid>
      <dc:creator>bigmac</dc:creator>
      <dc:date>2013-04-11T01:24:48Z</dc:date>
    </item>
  </channel>
</rss>

