<?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 Is SysTick COUNTFLAG required to be cleared ? in LPCXpresso IDE</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/Is-SysTick-COUNTFLAG-required-to-be-cleared/m-p/561548#M16367</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by noritan_org on Fri Jan 29 23:17:25 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;In the example project "systick" for the LPCXpresso LPC1114, there is an exception handler as follows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void SysTick_Handler(void) {
&amp;nbsp; msTicks++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* increment counter necessary in Delay() */
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;I wonder why this handler has no code to clear the COUNTFLAG of the SYST_CSR register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It was described in the page 307 on 00.10 version of user manal UM10398, the COUNTFLAG register can be cleared by reading the SYST_CSR register.&amp;nbsp;&amp;nbsp; I understand that the exception will be activated during the COUNTFLAG is 1, and the SysTick exception handler is continued to be executed until the COUNTFLAG is cleared.&amp;nbsp; But, the results attempting the project "systick" is different from my assumption.&amp;nbsp; The SysTick exception is invoked periodically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My questions are :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Is the COUNTFLAG automatically cleared when a SysTick exception is activated ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Is there an another internal (invisible) pending flag causing SysTick exception separated from the COUNTFLAG ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Is it required to read the SYST_CSR register in the SysTick handler to clear the COUNTFLAG ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 00:51:02 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T00:51:02Z</dc:date>
    <item>
      <title>Is SysTick COUNTFLAG required to be cleared ?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Is-SysTick-COUNTFLAG-required-to-be-cleared/m-p/561548#M16367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by noritan_org on Fri Jan 29 23:17:25 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;In the example project "systick" for the LPCXpresso LPC1114, there is an exception handler as follows.&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;void SysTick_Handler(void) {
&amp;nbsp; msTicks++;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /* increment counter necessary in Delay() */
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;SPAN&gt;I wonder why this handler has no code to clear the COUNTFLAG of the SYST_CSR register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It was described in the page 307 on 00.10 version of user manal UM10398, the COUNTFLAG register can be cleared by reading the SYST_CSR register.&amp;nbsp;&amp;nbsp; I understand that the exception will be activated during the COUNTFLAG is 1, and the SysTick exception handler is continued to be executed until the COUNTFLAG is cleared.&amp;nbsp; But, the results attempting the project "systick" is different from my assumption.&amp;nbsp; The SysTick exception is invoked periodically.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My questions are :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Is the COUNTFLAG automatically cleared when a SysTick exception is activated ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Is there an another internal (invisible) pending flag causing SysTick exception separated from the COUNTFLAG ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. Is it required to read the SYST_CSR register in the SysTick handler to clear the COUNTFLAG ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:51:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Is-SysTick-COUNTFLAG-required-to-be-cleared/m-p/561548#M16367</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is SysTick COUNTFLAG required to be cleared ?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Is-SysTick-COUNTFLAG-required-to-be-cleared/m-p/561549#M16368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by NXP_USA on Sat Jan 30 17:12:25 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: noritan_org&lt;/STRONG&gt;&lt;BR /&gt;In the example project "systick" for the LPCXpresso LPC1114, there is an exception handler as follows.&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;...&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;I wonder why this handler has no code to clear the COUNTFLAG of the SYST_CSR register.&lt;BR /&gt;&lt;BR /&gt;My questions are :&lt;BR /&gt;1. Is the COUNTFLAG automatically cleared when a SysTick exception is activated ?&lt;BR /&gt;2. Is there an another internal (invisible) pending flag causing SysTick exception separated from the COUNTFLAG ?&lt;BR /&gt;3. Is it required to read the SYST_CSR register in the SysTick handler to clear the COUNTFLAG ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. The COUNTFLAG is set when the SysTick counter decrements from 1 to 0 and is not cleared by the interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. The SysTick interrupt is controlled by ICSR-&amp;gt;PENDSTSET and ICSR-&amp;gt;PENDSTCLR. PENDSTSET can be read to determine if a SysTick exception is pending. It would only show as pending if the SysTick interrupt was blocked by a higher priority interrupt, otherwise it would be serviced and cleared in hardware. It does not need to be cleared by the interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. The COUNTFLAG does not trigger the SysTick interrupt.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-NXP&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:51:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Is-SysTick-COUNTFLAG-required-to-be-cleared/m-p/561549#M16368</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Is SysTick COUNTFLAG required to be cleared ?</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/Is-SysTick-COUNTFLAG-required-to-be-cleared/m-p/561550#M16369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by noritan_org on Mon Feb 01 07:26:54 MST 2010&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for clear answers.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I wouldn't worry about the COUNTFLAG in the exception handler.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 00:51:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/Is-SysTick-COUNTFLAG-required-to-be-cleared/m-p/561550#M16369</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T00:51:03Z</dc:date>
    </item>
  </channel>
</rss>

