<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Is it possible to vary the pulse width of a PWM in hardware?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5047/is-it-possible-to-vary-the-pulse-width-of-a-pwm-in-hardware</link><description>I need to use a high speed PWM (&amp;gt; 500 kHz) in which I can vary the pulse width. In examples, it&amp;#39;s handled in software which is too slow. 
 Is there any way to set a pin on a compare event and clear it on another? From the documentation I don&amp;#39;t see how</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Jan 2015 14:11:54 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5047/is-it-possible-to-vary-the-pulse-width-of-a-pwm-in-hardware" /><item><title>RE: Is it possible to vary the pulse width of a PWM in hardware?</title><link>https://devzone.nordicsemi.com/thread/17775?ContentTypeID=1</link><pubDate>Fri, 09 Jan 2015 14:11:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7c31b832-5b53-43fb-816f-14e992fba548</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;What is done in the &lt;a href="https://github.com/NordicSemiconductor/nrf51-pwm-library"&gt;PWM library&lt;/a&gt; is that the hardware maintains a fixed dutycycle PWM without using the CPU, by using TIMER+PPI+GPIOTE. You need the CPU however to change the PWM duty cycle. If you need to change the PWM frequency (the pulse width), it should be doable 500-1000 times per second with the PWM library. Is that too slow for your scenario? The &lt;a href="https://github.com/NordicSemiconductor/nrf51-pwm-library/tree/master/example_sound"&gt;sound example&lt;/a&gt; shows how to change the PWM frequency.&lt;/p&gt;
&lt;p&gt;Or am I perhaps not answering your questions you are asking? If not, can you please clarify what you want to achieve.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>