<?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 Re: LPC43xx: Generating PWM with timer 0/1/2/3 in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622470#M24406</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ping, sorry I just read your reply. I could send you my code, but - as I have seen - Rolf Meeser already stated, that it's really not possible to generate PWM signals with the standard timer IP block on LPC43xx. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Sep 2016 15:57:43 GMT</pubDate>
    <dc:creator>andreasklockner</dc:creator>
    <dc:date>2016-09-19T15:57:43Z</dc:date>
    <item>
      <title>LPC43xx: Generating PWM with timer 0/1/2/3</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622467#M24403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV class=""&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;due to the fact, that on many microcontrollers one can use timers to generate PWM signals, I tried to generate a PWM signal (Duty 0% - 100%) with the Timer module of the LPC4337.&lt;/P&gt;&lt;P&gt;Unfortunately, I ran into problems. At the moment, it seems, that this is not possible without using interrupts (and thus jitter).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I did:&lt;/P&gt;&lt;P&gt;- init timer 3&lt;/P&gt;&lt;P&gt;- set match register to 20% duty&lt;/P&gt;&lt;P&gt;- set pin LOW on match&amp;nbsp; (or HIGH on match).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Result: Pin was always LOW (or HIGH).&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Reason: it seems, that there is NO possibility to reset the PIN, when timer overflows (or reset by an other match). Thus it's not possible to generate a PWM with a variable duty cycle.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or have I misunderstood the timer module? Is there a way to configure it to output PWM signals (without interrupt activity)&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 11:48:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622467#M24403</guid>
      <dc:creator>andreasklockner</dc:creator>
      <dc:date>2016-09-15T11:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: LPC43xx: Generating PWM with timer 0/1/2/3</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622468#M24404</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 was wondering if you can share the codes, then I can run the demo and replicate the issue.&lt;/P&gt;&lt;P&gt;I'm looking forward to your reply.&lt;BR /&gt;Have a great day,&lt;BR /&gt;Ping&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>Mon, 19 Sep 2016 03:09:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622468#M24404</guid>
      <dc:creator>jeremyzhou</dc:creator>
      <dc:date>2016-09-19T03:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: LPC43xx: Generating PWM with timer 0/1/2/3</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622469#M24405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your conclusion is correct: The standard timers of the LPC43xx cannot generate a PWM signal by themselves. They require software to initialize the pin at the beginning of each cycle, causing jitter and limiting the achievable minimum and/or maximum duty cycle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Extended versions of the standard timer IP block provide a basic PWM mode, but they only exist in other LPC device families (e.g. LPC11U3x), not in the LPC18xx/LPC43xx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For LPC43xx the preferred method of generating PWM signals is the SCT module.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2016 09:28:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622469#M24405</guid>
      <dc:creator>rolfmeeser</dc:creator>
      <dc:date>2016-09-19T09:28:37Z</dc:date>
    </item>
    <item>
      <title>Re: LPC43xx: Generating PWM with timer 0/1/2/3</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622470#M24406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ping, sorry I just read your reply. I could send you my code, but - as I have seen - Rolf Meeser already stated, that it's really not possible to generate PWM signals with the standard timer IP block on LPC43xx. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Sep 2016 15:57:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622470#M24406</guid>
      <dc:creator>andreasklockner</dc:creator>
      <dc:date>2016-09-19T15:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: LPC43xx: Generating PWM with timer 0/1/2/3</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622471#M24407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree with the accepted answer, that the best method is to&amp;nbsp;have no software&amp;nbsp;interrupts. If there is a reason the standard timer must be used, there should be no&amp;nbsp;jitter. Granted the minimum pulse width and maximum frequency would be limited to the rate the interrupts could keep up, but jitter would only occur if the timer&amp;nbsp;counter is reset or&amp;nbsp;if the software directly sets the pin state. If the interrupt handler keeps the timer counter running, a PWM could be generated with no jitter using the following pseudo code.&lt;/P&gt;&lt;PRE&gt;// 'PulseWidth' is the number of timer ticks the pin stays HIGH
// 'Period' is the number of timer ticks for a PWM cycle (frequency)
void TimerInterrupt(void) 
{ &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;if (Pin == High) { &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;SetPinToGoLowOnMatch(); &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;MatchReg = MatchReg + PulseWidth; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;} else { &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;SetPinToGoHighOnMatch(); &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;MatchReg = MatchReg + (Period – PulseWidth); &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;ClearInterrupt(); 
}

&lt;/PRE&gt;&lt;P&gt;-Tyler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Sep 2016 14:17:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC43xx-Generating-PWM-with-timer-0-1-2-3/m-p/622471#M24407</guid>
      <dc:creator>tyler_drazich</dc:creator>
      <dc:date>2016-09-20T14:17:29Z</dc:date>
    </item>
  </channel>
</rss>

