<?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>LPC MicrocontrollersのトピックRe: CTIMER - reading count value while count changes</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-reading-count-value-while-count-changes/m-p/803822#M32295</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but just to be clear, let me restate my question.&lt;/P&gt;&lt;P&gt;Is there protection in hardware that prevents the counter register from&lt;/P&gt;&lt;P&gt;changing while the firmware reads its value?&lt;/P&gt;&lt;P&gt;Since my external counter clock is varying and not related to any clock on&lt;/P&gt;&lt;P&gt;chip I worry about occasionally getting bad readings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently ensure that this can't happen by using a capture register. I&lt;/P&gt;&lt;P&gt;trigger the capture by changing the state of a port pin when my firmware&lt;/P&gt;&lt;P&gt;needs the counter value. That port pin is externally wired to the capture&lt;/P&gt;&lt;P&gt;input in order to force the capture, then my firmware reads the capture&lt;/P&gt;&lt;P&gt;register, not the counter register. This should be safe, and it works, but&lt;/P&gt;&lt;P&gt;it ties up two port pins and adds some extra code. If it's not necessary&lt;/P&gt;&lt;P&gt;I'd rather not do it, but I do need to be sure that the counter reading is&lt;/P&gt;&lt;P&gt;never garbled, and it would take some time to prove...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Klaus Renner | Cooper Perkins, Inc. | **10 Maguire Road, Bldg. 4 |&lt;/P&gt;&lt;P&gt;Lexington, MA 02421*&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;desk: 781-&lt;/STRONG&gt;761-4807 | &lt;A href="http://www.cooperperkins.com" target="test_blank"&gt;http://www.cooperperkins.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This email message contains confidential information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Wed, Jul 11, 2018 at 3:17 PM, victorjimenez &amp;lt;admin@community.nxp.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Jul 2018 19:43:06 GMT</pubDate>
    <dc:creator>klausrenner</dc:creator>
    <dc:date>2018-07-11T19:43:06Z</dc:date>
    <item>
      <title>CTIMER - reading count value while count changes</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-reading-count-value-while-count-changes/m-p/803820#M32293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using a&amp;nbsp;CTIMER0 in counter mode to count external pulses. Do I need to worry about the count changing while I'm reading the counter register? Is there a way to use a shadow register? I'm using an LPC54606 and don't see any mention of this in the user manual.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 13:48:08 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-reading-count-value-while-count-changes/m-p/803820#M32293</guid>
      <dc:creator>klausrenner</dc:creator>
      <dc:date>2018-07-11T13:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: CTIMER - reading count value while count changes</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-reading-count-value-while-count-changes/m-p/803821#M32294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;Klaus Renner,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don't need to worry, you won't have any problem while reading this register.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The shadow register is for a completely different purpose.&amp;nbsp;The Match Shadow registers contain the values that the corresponding Match Registers are (optionally) reloaded with at the start of each new counter cycle.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;Victor.&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, 11 Jul 2018 19:16:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-reading-count-value-while-count-changes/m-p/803821#M32294</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-07-11T19:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: CTIMER - reading count value while count changes</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-reading-count-value-while-count-changes/m-p/803822#M32295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, but just to be clear, let me restate my question.&lt;/P&gt;&lt;P&gt;Is there protection in hardware that prevents the counter register from&lt;/P&gt;&lt;P&gt;changing while the firmware reads its value?&lt;/P&gt;&lt;P&gt;Since my external counter clock is varying and not related to any clock on&lt;/P&gt;&lt;P&gt;chip I worry about occasionally getting bad readings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I currently ensure that this can't happen by using a capture register. I&lt;/P&gt;&lt;P&gt;trigger the capture by changing the state of a port pin when my firmware&lt;/P&gt;&lt;P&gt;needs the counter value. That port pin is externally wired to the capture&lt;/P&gt;&lt;P&gt;input in order to force the capture, then my firmware reads the capture&lt;/P&gt;&lt;P&gt;register, not the counter register. This should be safe, and it works, but&lt;/P&gt;&lt;P&gt;it ties up two port pins and adds some extra code. If it's not necessary&lt;/P&gt;&lt;P&gt;I'd rather not do it, but I do need to be sure that the counter reading is&lt;/P&gt;&lt;P&gt;never garbled, and it would take some time to prove...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Klaus Renner | Cooper Perkins, Inc. | **10 Maguire Road, Bldg. 4 |&lt;/P&gt;&lt;P&gt;Lexington, MA 02421*&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;desk: 781-&lt;/STRONG&gt;761-4807 | &lt;A href="http://www.cooperperkins.com" target="test_blank"&gt;http://www.cooperperkins.com&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This email message contains confidential information.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;On Wed, Jul 11, 2018 at 3:17 PM, victorjimenez &amp;lt;admin@community.nxp.com&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Jul 2018 19:43:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-reading-count-value-while-count-changes/m-p/803822#M32295</guid>
      <dc:creator>klausrenner</dc:creator>
      <dc:date>2018-07-11T19:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: CTIMER - reading count value while count changes</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-reading-count-value-while-count-changes/m-p/803823#M32296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;Klaus Renner,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;Is there protection in hardware that prevents the counter register from changing while the firmware reads its value?&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;No, there isn't a hardware protection that prevents this, but you don't need one. You can read the value of the counter anytime without getting wrong values, doesn't matter if the timer is running or on hold.&lt;/P&gt;&lt;P&gt;If the timer is still running when you want to read the value of the counter then you will read the last value stored in the buffer of the timer. So, even if the value changes while you are reading it you won't get an incorrect value.&amp;nbsp; Why do you think you may get bad readings occasionally?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;Victor.&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>Fri, 13 Jul 2018 17:53:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/CTIMER-reading-count-value-while-count-changes/m-p/803823#M32296</guid>
      <dc:creator>victorjimenez</dc:creator>
      <dc:date>2018-07-13T17:53:50Z</dc:date>
    </item>
  </channel>
</rss>

