<?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>topic Timer in S12 / MagniV Microcontrollers</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480215#M11991</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;I have one clarification on Timer usage. &lt;/SPAN&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Currently, I am using "S912XEG128W1MAA".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;For OS system timer, I have configured related registers as follows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;In Datasheet, fomular for the time-out period = (PITMTLD + 1) * (PITLD + 1) / fBUS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;In Implementation,&lt;BR /&gt;.- PITMTLD(clock divider) : 47&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;.- PITLD(timeout counter) : &lt;STRONG&gt;1000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;.- fBUS : 48 MHz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;With this configuration, I assumed &lt;STRONG&gt;1000&lt;/STRONG&gt;us timer to call a routine every &lt;STRONG&gt;1000&lt;/STRONG&gt;us.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Herewith, one confusion with the fomular from my side is..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Do I need to configure PITLD as 999 not 1000 to have 1000us cycle time?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Thanks and best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Wongeun Chang&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Mar 2016 15:04:34 GMT</pubDate>
    <dc:creator>wongeunchang</dc:creator>
    <dc:date>2016-03-15T15:04:34Z</dc:date>
    <item>
      <title>Timer</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480215#M11991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Hello,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;I have one clarification on Timer usage. &lt;/SPAN&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Currently, I am using "S912XEG128W1MAA".&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;For OS system timer, I have configured related registers as follows.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;In Datasheet, fomular for the time-out period = (PITMTLD + 1) * (PITLD + 1) / fBUS&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;In Implementation,&lt;BR /&gt;.- PITMTLD(clock divider) : 47&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;.- PITLD(timeout counter) : &lt;STRONG&gt;1000&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;.- fBUS : 48 MHz&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;With this configuration, I assumed &lt;STRONG&gt;1000&lt;/STRONG&gt;us timer to call a routine every &lt;STRONG&gt;1000&lt;/STRONG&gt;us.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Herewith, one confusion with the fomular from my side is..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Do I need to configure PITLD as 999 not 1000 to have 1000us cycle time?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Thanks and best regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Wongeun Chang&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Mar 2016 15:04:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480215#M11991</guid>
      <dc:creator>wongeunchang</dc:creator>
      <dc:date>2016-03-15T15:04:34Z</dc:date>
    </item>
    <item>
      <title>Re: Timer</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480216#M11992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello &lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Wongeun Chang,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;Yes, &lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 10pt;"&gt;configure PITLD as 999 .&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: calibri, verdana, arial, sans-serif;"&gt;48*1000/48MHZ = 1000us &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Hope it helps&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;Alice Yang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2016 07:37:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480216#M11992</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-03-16T07:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Timer</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480217#M11993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Alice,&lt;/P&gt;&lt;P&gt;Thank you for your reply very much.&lt;/P&gt;&lt;P&gt;from my point of view, PITLD needs to be designed to be used as it is.&lt;/P&gt;&lt;P&gt;for example, if I configure to 1000, then it needs to be managed as 1000 us. Which means the use does not need to consider ‘-1’.&lt;/P&gt;&lt;P&gt;What do you think about it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Mar 2016 08:05:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480217#M11993</guid>
      <dc:creator>wongeunchang</dc:creator>
      <dc:date>2016-03-16T08:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Timer</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480218#M11994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry i don't know what's your meaning .&lt;/P&gt;&lt;P&gt;If you configure &lt;SPAN style="font-size: 10pt; font-family: calibri, verdana, arial, sans-serif;"&gt; PITLD&amp;nbsp; as 1000, then after 1000us , it will generate interrupt.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: calibri, verdana, arial, sans-serif;"&gt;BR&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: calibri, verdana, arial, sans-serif;"&gt;Alice&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 11:42:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480218#M11994</guid>
      <dc:creator>Alice_Yang</dc:creator>
      <dc:date>2016-03-17T11:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: Timer</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480219#M11995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay. Let me explain it in this way then,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Earlier, I asked following question regarding ‘Timer’.&lt;/P&gt;&lt;P&gt;1. The formula for the time-out period = (PITMTLD + 1) * (PITLD + 1) / fBUS&lt;/P&gt;&lt;P&gt;2. If PITMTLD = 47, fBUS = 48MHz, PITLD = 999&lt;/P&gt;&lt;P&gt;    Timeout = (47&lt;EM&gt;1)*(999&lt;/EM&gt;1)/(48*10^6) = 1000us&lt;/P&gt;&lt;P&gt;3. Timeout flag seems to be set after 1000us.&lt;/P&gt;&lt;P&gt;4. In conclusion, setting PITLD to 999 means that timeout flag will be set every 1000us.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q. When PITTf.p0 will be set to 1?&lt;/P&gt;&lt;P&gt;     Case1. PITLD0 = 1000 -&amp;gt; 1000us or 1001us&lt;/P&gt;&lt;P&gt;     Case2. PTILD0 = 999   -&amp;gt;  999 us or 1000us&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR Wongeun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 12:15:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480219#M11995</guid>
      <dc:creator>wongeunchang</dc:creator>
      <dc:date>2016-03-17T12:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: Timer</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480220#M11996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wongeun,&lt;/P&gt;&lt;P&gt;According to RM (chapter 17.4.1 Timer):&lt;/P&gt;&lt;P&gt;“Whenever a 16-bit timer counter and the connected 8-bit micro timer counter have counted to zero, the PITLD register is reloaded and the corresponding time-out flag PTF in the PIT time-out flag (PITTF) register is set, as shown in Figure 17-28.”&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="PIT trigger and flag timing.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23292iEABCF5212B63F326/image-size/large?v=v2&amp;amp;px=999" role="button" title="PIT trigger and flag timing.png" alt="PIT trigger and flag timing.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Therefore, PTFx flag is set when modulus down counter is reloaded from 0x0000 to PITLDx value.&lt;/P&gt;&lt;P&gt;Since value 0x0000 is also the valid value for modulus down counter, we have to set (time interval in us-1) as PITLDx value. Of course, that is valid only for cases where micro timer modulus down-counter produces 1us time base.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, for your cases:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case1. PITLD0 = 1000 -&amp;gt; 1001us&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case2. PTILD0 = 999&amp;nbsp; -&amp;gt;&amp;nbsp; 1000us&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I hope it helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;RadekS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------------------------------------------&lt;BR /&gt;Note: If this post answers your question, please click the Correct Answer button. Thank you!&lt;BR /&gt;-----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Mar 2016 21:00:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/Timer/m-p/480220#M11996</guid>
      <dc:creator>RadekS</dc:creator>
      <dc:date>2016-03-17T21:00:32Z</dc:date>
    </item>
  </channel>
</rss>

