<?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: PWM dutycycle of 0% using SCTtimers?</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594071#M22586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MarcVonWindscooting on Sat Feb 20 04:00:08 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working with LPC800 SCT but I think they're pretty similar.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You set output to one in cycle 63 and reset it in cycle 0 (=64), so the result is one pulse!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would use autolimit for the cycle length, set output to 1 in cycle 0 (event0) and reset output&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;on match (event1) and use conflict resolution (not sure it's neccessary) to have precedence of reset over set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That costs 3 matches and 2 events. Slightly more expensive, but should do what you want. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 19:22:59 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T19:22:59Z</dc:date>
    <item>
      <title>PWM dutycycle of 0% using SCTtimers?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594070#M22585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by renskessener on Wed Feb 17 14:14:44 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to make a PWM signal with a dutycycle from 0 – 100% in 64 steps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(Actually I need 4 PWM’s but if one works I can make 4 work)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It must be possible to have 0% dutycycle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thought SCT timers would be the best choice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to LPC processors and I don’t understand (yet) all items in the user manual.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I use the LPC11U68 board as a vehicle to figure things out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I used the example (in LPCopen) “ periph_SCT_PWM” as a guide.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Using STC1:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I set the MATCH0 and MATCHREL0 registers to 63 to represent PWM-cycle length.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I use MATCH1 and MATCHREL1 registers as the dutycycle register.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By changing the MATCHREL1 register to a new desired dutycycle, the MATCH1 register will follow the next cycle as I understand. It varies from 0 to 63.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EVENT[0] is used to signal a match for the PWM-cycle length and sets OUT0 to 1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EVENT[1] is used to signal a match for the dutycycle and sets OUT0 to 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SCT_EVENT_0 and SCT_EVENT_1 bothe enable STATE0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I do not need states.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It works, BUT at a dutycycle of 0, OUT0 still produces a pulse.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Probably because EVENT[0] take precedence or because, if MATCH1 == 0,&amp;nbsp; EVENT[1]&amp;nbsp; happens&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;At the first clockcycle.?????&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do I misunderstand the capabilities of the SCT-timers?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What do I do wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there an example out there that makes a PWM that includes 0% dutycycle?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594070#M22585</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: PWM dutycycle of 0% using SCTtimers?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594071#M22586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MarcVonWindscooting on Sat Feb 20 04:00:08 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm working with LPC800 SCT but I think they're pretty similar.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You set output to one in cycle 63 and reset it in cycle 0 (=64), so the result is one pulse!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would use autolimit for the cycle length, set output to 1 in cycle 0 (event0) and reset output&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;on match (event1) and use conflict resolution (not sure it's neccessary) to have precedence of reset over set.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;That costs 3 matches and 2 events. Slightly more expensive, but should do what you want. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Marc&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594071#M22586</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: PWM dutycycle of 0% using SCTtimers?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594072#M22587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by gstraka on Mon Apr 11 15:04:22 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: MarcVonWindscooting&lt;/STRONG&gt;&lt;BR /&gt;I'm working with LPC800 SCT but I think they're pretty similar.&lt;BR /&gt;&lt;BR /&gt;You set output to one in cycle 63 and reset it in cycle 0 (=64), so the result is one pulse!&lt;BR /&gt;&lt;BR /&gt;I would use autolimit for the cycle length, set output to 1 in cycle 0 (event0) and reset output&lt;BR /&gt;on match (event1) and use conflict resolution (not sure it's neccessary) to have precedence of reset over set.&lt;BR /&gt;That costs 3 matches and 2 events. Slightly more expensive, but should do what you want. &lt;BR /&gt;&lt;BR /&gt;Marc&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Marc, I had the same question as OP and your answer helped me!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If this solution is more expensive, would it in theory be more efficient to take the original implementation and simply shut off the PWM for a 0% duty cycle?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: Actually with the above solution, it's possible to get a 0% duty cycle but not a 100% duty cycle.&amp;nbsp; It's basically reversing the problem, no?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:22:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594072#M22587</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: PWM dutycycle of 0% using SCTtimers?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594073#M22588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by renskessener on Tue Apr 12 04:22:36 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;From gstraka:&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit: Actually with the above solution, it's possible to get a 0% duty cycle but not a 100% duty cycle. It's basically reversing the problem, no?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, I agree. It reverses the problem. It is either 0% but not 100% or 100% and not 0%.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I figured out how to do it by using centre aligned PWM and a bidirectional counter. That works perfect.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Later I found It is also described in AN11538 (SCTimer/PWM cookbook), chapter 20.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, for me the problem is solved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the replies.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:23:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594073#M22588</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: PWM dutycycle of 0% using SCTtimers?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594074#M22589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by gstraka on Tue Apr 12 07:56:20 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: renskessener&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;From gstraka:&lt;/STRONG&gt;&lt;BR /&gt;Edit: Actually with the above solution, it's possible to get a 0% duty cycle but not a 100% duty cycle. It's basically reversing the problem, no?&lt;BR /&gt;&lt;BR /&gt;Yes, I agree. It reverses the problem. It is either 0% but not 100% or 100% and not 0%.&lt;BR /&gt;&lt;BR /&gt;I figured out how to do it by using centre aligned PWM and a bidirectional counter. That works perfect.&lt;BR /&gt;Later I found It is also described in AN11538 (SCTimer/PWM cookbook), chapter 20.&lt;BR /&gt;&lt;BR /&gt;So, for me the problem is solved.&lt;BR /&gt;&lt;BR /&gt;Thanks for the replies.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for the info...I've been looking at AN11538 but must have completely missed that chapter.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:23:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594074#M22589</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: PWM dutycycle of 0% using SCTtimers?</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594075#M22590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by gstraka on Tue Apr 12 19:32:57 MST 2016&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: renskessener&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;From gstraka:&lt;/STRONG&gt;&lt;BR /&gt;Edit: Actually with the above solution, it's possible to get a 0% duty cycle but not a 100% duty cycle. It's basically reversing the problem, no?&lt;BR /&gt;&lt;BR /&gt;Yes, I agree. It reverses the problem. It is either 0% but not 100% or 100% and not 0%.&lt;BR /&gt;&lt;BR /&gt;I figured out how to do it by using centre aligned PWM and a bidirectional counter. That works perfect.&lt;BR /&gt;Later I found It is also described in AN11538 (SCTimer/PWM cookbook), chapter 20.&lt;BR /&gt;&lt;BR /&gt;So, for me the problem is solved.&lt;BR /&gt;&lt;BR /&gt;Thanks for the replies.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Maybe it's just me, but it seems like chapter 20 of AN11538 has some errors.&amp;nbsp; For example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]It says "&lt;/SPAN&gt;&lt;STRONG&gt;MATCH[1].L = 0 results in 0% duty cycle (signal OFF)&lt;/STRONG&gt;&lt;SPAN&gt;".&amp;nbsp; I agree with this one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]It says "&lt;/SPAN&gt;&lt;STRONG&gt;MATCH[1].L = MATCH[0].L - 1 results in 100% duty cycle (signal ON).&lt;/STRONG&gt;&lt;SPAN&gt;"&amp;nbsp; This seems wrong, wouldn't it result in a near-0% duty cycle?&amp;nbsp; To get 100% MATCH[1].L would have to equal MATCH[0].L.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; [*]It says "&lt;/SPAN&gt;&lt;STRONG&gt;0 &amp;lt; MATCH[1].L &amp;lt; MATCH[0].L - 1 results a 1 to 99% duty cycle.&lt;/STRONG&gt;&lt;SPAN&gt;"&amp;nbsp; This seems correct except that the example implementation has it backwards.&amp;nbsp; MATCH[1].L = 1 should result in a near-100% duty cycle while MATCH[1].L = MATCH[0].L - 1 should result in a near-0% duty cycle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I off base here?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 19:23:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/PWM-dutycycle-of-0-using-SCTtimers/m-p/594075#M22590</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T19:23:02Z</dc:date>
    </item>
  </channel>
</rss>

