<?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: Using Ctimer with callback</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921397#M36714</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tried the above sample code, and there is only register callback function in it,&lt;/P&gt;&lt;P&gt;so by referring MRT sample code, added IRQ handler and added the process&lt;/P&gt;&lt;P&gt;for enabling interrupts, but when the enable interrupts and driver IRQ handler function&lt;/P&gt;&lt;P&gt;called, if this interrupt register[in Ctimer] not used also the ctimer bit[P0.28] port pin keeps on toggling,&lt;/P&gt;&lt;P&gt;means in the code the interrupt is still not invoked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly I tested for SCtimer where only callbacks given in the demo code, and interrupt&lt;/P&gt;&lt;P&gt;enable register not used, so after adding it, only when the interrupt is enabled the port pin&lt;/P&gt;&lt;P&gt;is toggling[for testing purpose used inside the IRQ] , so in this interrupt is invoked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to run 2 interrupts concurrently, one for PWM and one for timer, for timer i'm using MRT&lt;/P&gt;&lt;P&gt;and it works fine, but for PWM i'm getting the individually frequency required, but for to develop&lt;/P&gt;&lt;P&gt;further for my application , I require the interrupt to be invoked in Ctimer, which is not happening,&lt;/P&gt;&lt;P&gt;kindly suggest on how to invoke the interrupt in ctimer, in match interrupt demo only register callback function&lt;/P&gt;&lt;P&gt;is there, but not given how to enable interrupts, kindly suggest on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Aug 2019 15:37:33 GMT</pubDate>
    <dc:creator>angiey0017</dc:creator>
    <dc:date>2019-08-14T15:37:33Z</dc:date>
    <item>
      <title>Using Ctimer with callback</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921393#M36710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If we are using Ctimer match0 callback, should we use IRQ handler, to invoke&lt;/P&gt;&lt;P&gt;interrupt? It's really confusing to use both, and in the callback there&lt;/P&gt;&lt;P&gt;is no priority to define, in the sdk sample codes they have given callbacks,&lt;/P&gt;&lt;P&gt;but when implemented for the application won't get the result as expected,&lt;/P&gt;&lt;P&gt;kindly advice on using callbacks, and to invoke interrupt in Ctimer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Jul 2019 17:16:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921393#M36710</guid>
      <dc:creator>angiey0017</dc:creator>
      <dc:date>2019-07-29T17:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Using Ctimer with callback</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921394#M36711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-content-finding="Community" data-userid="343099" data-username="angiey0017@gmail.com" href="https://community.nxp.com/people/angiey0017@gmail.com"&gt;angiey y&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.&lt;BR /&gt;1） If we are using Ctimer match0 callback, should we use IRQ handler, to invoke interrupt?&lt;BR /&gt;-- Yes, when Ctimer match interrupt happens, it will enter the CTIMERn_DriverIRQHandler() function at first, then trigger the CTIMER_GenericIRQHandler() function, next will call the corresponded callback function, hope the clarification helps.&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 01:54:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921394#M36711</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2019-07-30T01:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Ctimer with callback</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921395#M36712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;Yes it's clarified that need to use Ctimer IRQ handler to invoke interrupt, but for my application&lt;/P&gt;&lt;P&gt;I have used CTIMER_GenericIRQHandler() function, but interrupt is not invoking,&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you share any reference links or sample code of using callback function in IRQ handler,&lt;/P&gt;&lt;P&gt;it will help to understand and implement the process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 06:53:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921395#M36712</guid>
      <dc:creator>angiey0017</dc:creator>
      <dc:date>2019-07-30T06:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Ctimer with callback</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921396#M36713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-content-finding="Community" data-objectid="343099" data-objecttype="3" href="https://community.nxp.com/people/angiey0017@gmail.com"&gt;angiey y&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;BR /&gt;There's a simple_match_interrupt demo in the SDK library, and the demo demonstrates usage of the SDK CTimer driver with interrupt callback functions, so please refer to it for details.&lt;/P&gt;&lt;P&gt;SDK library:&lt;/P&gt;&lt;P&gt;&lt;A class="" data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fmcuxpresso.nxp.com%2Fen%2Fwelcome" rel="nofollow" target="_blank"&gt;https://mcuxpresso.nxp.com/en/welcome&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Jul 2019 02:22:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921396#M36713</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2019-07-31T02:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using Ctimer with callback</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921397#M36714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I tried the above sample code, and there is only register callback function in it,&lt;/P&gt;&lt;P&gt;so by referring MRT sample code, added IRQ handler and added the process&lt;/P&gt;&lt;P&gt;for enabling interrupts, but when the enable interrupts and driver IRQ handler function&lt;/P&gt;&lt;P&gt;called, if this interrupt register[in Ctimer] not used also the ctimer bit[P0.28] port pin keeps on toggling,&lt;/P&gt;&lt;P&gt;means in the code the interrupt is still not invoked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Similarly I tested for SCtimer where only callbacks given in the demo code, and interrupt&lt;/P&gt;&lt;P&gt;enable register not used, so after adding it, only when the interrupt is enabled the port pin&lt;/P&gt;&lt;P&gt;is toggling[for testing purpose used inside the IRQ] , so in this interrupt is invoked.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to run 2 interrupts concurrently, one for PWM and one for timer, for timer i'm using MRT&lt;/P&gt;&lt;P&gt;and it works fine, but for PWM i'm getting the individually frequency required, but for to develop&lt;/P&gt;&lt;P&gt;further for my application , I require the interrupt to be invoked in Ctimer, which is not happening,&lt;/P&gt;&lt;P&gt;kindly suggest on how to invoke the interrupt in ctimer, in match interrupt demo only register callback function&lt;/P&gt;&lt;P&gt;is there, but not given how to enable interrupts, kindly suggest on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2019 15:37:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921397#M36714</guid>
      <dc:creator>angiey0017</dc:creator>
      <dc:date>2019-08-14T15:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: Using Ctimer with callback</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921398#M36715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" data-containerid="-1" data-containertype="-1" data-content-finding="Community" data-objectid="343099" data-objecttype="3" href="https://community.nxp.com/people/angiey0017@gmail.com"&gt;angiey y&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;After running the simple_match_interrupt demo, when Ctimer match interrupt happens, it will enter the CTIMERn_DriverIRQHandler() function at first, then trigger the CTIMER_GenericIRQHandler() function, next will call the corresponded callback function. &lt;BR /&gt;The Ctimer interrupt definitely would be invoked, so I'm not clear with your statement " in match interrupt demo only register callback function is there".&lt;BR /&gt;Maybe you can try to refer to the &lt;A href="https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/lpc800-cortex-m0-plus-/low-cost-microcontrollers-mcus-based-on-arm-cortex-m0-plus-cores:LPC84X?tab=Design_Tools_Tab"&gt;code bundle library&lt;/A&gt; which is easier to understand versus the SDK.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_2.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/87567iA8E68E5491D86BAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_2.png" alt="pastedImage_2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P style="min- padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2019 08:16:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921398#M36715</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2019-08-15T08:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Using Ctimer with callback</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921399#M36716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the response.&lt;/P&gt;&lt;P&gt;Referring to the match interrupt demo, below are the functions implemented to enable&lt;/P&gt;&lt;P&gt;interrupt,i.e., after Ctimer_RegisterCallback function as given below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;1. &amp;nbsp; CTIMER_RegisterCallBack(CTIMER, &amp;amp;ctimer_callback_table[0], kCTIMER_MultipleCallback);&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;2. &amp;nbsp; CTIMER_EnableInterrupts(CTIMER,kCTIMER_Match0InterruptEnable);//added this line&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;nbsp;3. &amp;nbsp; EnableIRQ(CTIMER0_IRQn);//Added this line&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;4. &amp;nbsp; CTIMER_StartTimer(CTIMER);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Above is the part of the code, where I have added line 2 and 3 to enable interrupts, but if it's not used&lt;/P&gt;&lt;P&gt;also pwm is generating, and is it fine if we use--&amp;gt; void pwm_match_callback(uint32_t flags)..&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Since after calling Register callback function, and making toggling of led inside the pwm_match_callback &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;function, only ON_board led will toggle[Red, green ON BOARD LED'S], external port pin connected and other&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;parameters passed inside the function won't work, tried after changing in PIN_MUX.c and PIN_MUX.h library file.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And in code bundle library initially I tried developing our application using code bundle library codes,&lt;/P&gt;&lt;P&gt;but only led_demo sample worked, and not got expected result from the other demo codes.&lt;/P&gt;&lt;P&gt;As I checked again with Ctimer demo sample[code bundle library], after flashing the code to MCU and resetting&lt;/P&gt;&lt;P&gt;the MCU, the pwm wont toggle on the OUT_PORT bit P0.25.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the process i'm working on using SDK demo for ctimer i.e., I have mentioned in the callback function is correct?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Aug 2019 10:14:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921399#M36716</guid>
      <dc:creator>angiey0017</dc:creator>
      <dc:date>2019-08-16T10:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: Using Ctimer with callback</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921400#M36717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A _jive_internal="true" class="" data-containerid="-1" data-containertype="-1" data-content-finding="Community" data-objectid="343099" data-objecttype="3" href="https://community.nxp.com/people/angiey0017@gmail.com"&gt;angiey y&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;BR /&gt;1) Is the process i'm working on using SDK demo for ctimer i.e., I have mentioned in the callback function is correct?&lt;BR /&gt;-- Yes, and you can refer to simple_pwm_interrupt to learn how the register the pwm_match_callback() correctly.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Have a great day,&lt;BR /&gt;TIC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt; Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2019 02:19:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/Using-Ctimer-with-callback/m-p/921400#M36717</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2019-08-19T02:19:25Z</dc:date>
    </item>
  </channel>
</rss>

