<?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>Kinetis Microcontrollers中的主题 Re: The ERCLK32K clock source does not appear to increment the LPTMR0 counter register on a KL26 (MKL26Z256VMC4 0N40H)</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-ERCLK32K-clock-source-does-not-appear-to-increment-the/m-p/269472#M9031</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This same thing also appears to happen on MK10DN512V10 4N22D processors as well&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Dec 2013 18:45:52 GMT</pubDate>
    <dc:creator>nurichard</dc:creator>
    <dc:date>2013-12-18T18:45:52Z</dc:date>
    <item>
      <title>The ERCLK32K clock source does not appear to increment the LPTMR0 counter register on a KL26 (MKL26Z256VMC4 0N40H)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-ERCLK32K-clock-source-does-not-appear-to-increment-the/m-p/269471#M9030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am attempting to use the ERCLK32K clock source with the LPTMR0.&amp;nbsp; What I am finding is that the counter register (LPTMR0_CNR at 0x4004000c according to the &lt;A href="http://cache.freescale.com/files/microcontrollers/doc/ref_manual/KL26P121M48SF4RM.pdf?fpsp=1&amp;amp;WT_TYPE=Reference%20Manuals&amp;amp;WT_VENDOR=FREESCALE&amp;amp;WT_FILE_FORMAT=pdf&amp;amp;WT_ASSET=Documentation" style="color: #017bba; font-family: arial, sans-serif; font-size: 12px;"&gt;KL26P121M48SF4RM&lt;/A&gt;&lt;SPAN style="color: #51626f; font-family: arial, sans-serif; font-size: 12px;"&gt; &lt;/SPAN&gt;v3.2 reference manual) is always read as zero.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have configured the RTC to use the external oscillator for the 32,768kHz source and I can see the RT second and sub-second registers increases in agreement with a wall clock (RTC_TPR at 0x4003D000, RTC_TPR at 0x4003D004) so according to figure 5-1 in the RM, the ERCLK32K clock is working ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to figure 5-4 in the RM, the only other clock selection bits are the LPTMRx_PSR[PCS] bits which should be set to 0b10 in the table within section 3.8.3.3 of the RM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I configure and start the LPTMR0 registers as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Ensure timer disabled&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPTMR0_CSR &amp;amp;= ~LPTMR_CSR_TEN_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Timer interrupt enabled, timer reset when TCF raised, using timer mode, remaining disabled&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPTMR0_CSR = LPTMR_CSR_TIE_MASK;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Ensure the compare register is set to 10s in units of 1024th of a second&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPTMR0_CMR = 10240;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Select the ERCLK32K as the low power timer source, configure a prescaler of 32; counts in 1024th of a second&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPTMR0_PSR = LPTMR_PSR_PRESCALE(0b0100) | LPTMR_PSR_PCS(0b10);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Start the timer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; LPTMR0_CSR |= LPTMR_CSR_TEN_MASK;&lt;/P&gt;&lt;P&gt;"""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;At any time during those 10s, the LPTMR0_CNR always reads as zero rather than counting up as I believe it should.&lt;/P&gt;&lt;P&gt;At the end of time, the previously registered interrupt service routine executes after the correct interval so the timer is timing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot see anything in the latest errata that mentions any known mask problems (KINETIS_L_0N40H &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;09 AUG 2013&lt;/SPAN&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please could anyone kindly suggest what I am doing wrong,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My sincere thanks for your help,&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 18:36:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-ERCLK32K-clock-source-does-not-appear-to-increment-the/m-p/269471#M9030</guid>
      <dc:creator>nurichard</dc:creator>
      <dc:date>2013-12-18T18:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: The ERCLK32K clock source does not appear to increment the LPTMR0 counter register on a KL26 (MKL26Z256VMC4 0N40H)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-ERCLK32K-clock-source-does-not-appear-to-increment-the/m-p/269472#M9031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This same thing also appears to happen on MK10DN512V10 4N22D processors as well&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 18:45:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-ERCLK32K-clock-source-does-not-appear-to-increment-the/m-p/269472#M9031</guid>
      <dc:creator>nurichard</dc:creator>
      <dc:date>2013-12-18T18:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: The ERCLK32K clock source does not appear to increment the LPTMR0 counter register on a KL26 (MKL26Z256VMC4 0N40H)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-ERCLK32K-clock-source-does-not-appear-to-increment-the/m-p/269473#M9032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This note is being added 'as available' to all Kinetis documents in the LPTMR section:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P data-angle="0" data-canvas-width="641.7973524603844" data-font-name="g_font_19044_0" dir="ltr" style="font-size: 18.6667px; font-family: serif;"&gt;The CNR cannot be initialized, but can be read at any time. On each read of the CNR,&lt;/P&gt;&lt;P data-angle="0" data-canvas-width="650.6640193912983" data-font-name="g_font_19044_0" dir="ltr" style="font-size: 18.6667px; font-family: serif;"&gt;software must first write to the CNR with any value. This will synchronize and register&lt;/P&gt;&lt;P data-angle="0" data-canvas-width="639.2026857163905" data-font-name="g_font_19044_0" dir="ltr" style="font-size: 18.6667px; font-family: serif;"&gt;the current value of the CNR into a temporary register. The contents of the temporary&lt;/P&gt;&lt;P data-angle="0" data-canvas-width="344.69867693948754" data-font-name="g_font_19044_0" dir="ltr" style="font-size: 18.6667px; font-family: serif;"&gt;register are returned on each read of the CNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know why that 'little secret' is so hard to find.&lt;/P&gt;&lt;P&gt;But it is in paragraph 33.4.5 of the aforementioned reference manual (It's new enough).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Dec 2013 23:57:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-ERCLK32K-clock-source-does-not-appear-to-increment-the/m-p/269473#M9032</guid>
      <dc:creator>egoodii</dc:creator>
      <dc:date>2013-12-18T23:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: The ERCLK32K clock source does not appear to increment the LPTMR0 counter register on a KL26 (MKL26Z256VMC4 0N40H)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-ERCLK32K-clock-source-does-not-appear-to-increment-the/m-p/269474#M9033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The 'can't read' errors are definitely the most ironic and time consuming.&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Dec 2013 10:00:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/The-ERCLK32K-clock-source-does-not-appear-to-increment-the/m-p/269474#M9033</guid>
      <dc:creator>nurichard</dc:creator>
      <dc:date>2013-12-19T10:00:54Z</dc:date>
    </item>
  </channel>
</rss>

