<?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>NORDIC51822 PWM Settings</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27178/nordic51822-pwm-settings</link><description>Now want to use two way PWM, how to set the PWM cycle, frequency, duty cycle, there are two road PWM phase, which is the starting point is not the same as shown in figure
 
 Based on the Nordic \ nRF5_SDK_12 _f012 2.0 
 void motor_pwm(void)
{
	</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Oct 2017 09:00:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27178/nordic51822-pwm-settings" /><item><title>RE: NORDIC51822 PWM Settings</title><link>https://devzone.nordicsemi.com/thread/107064?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 09:00:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7b332977-b9d4-4ba5-9d22-eb61431e6dd0</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you want a simple PWM driver example where you can set the PWM duty cycle directly, then you should take a look at the example linked to in &lt;a href="https://devzone.nordicsemi.com/question/137430/is-there-a-simple-example-how-to-set-a-pwm-driver/?answer=138420#post-id-138420"&gt;this post&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The frequency will be F(pwm) = F(clk, e.g &lt;code&gt;NRF_PWM_CLK_1MHz&lt;/code&gt; ) / &lt;code&gt;.top_value = #value&lt;/code&gt;. E.g. using NRF_PWM_CLK_1MHz, with &lt;code&gt;.top_value =10&lt;/code&gt;, you will get 0.1 MHz PWM frequency.&lt;/p&gt;
&lt;p&gt;The duty cycle is will be the ratio between the &lt;code&gt;top_value&lt;/code&gt; and &lt;code&gt;seq_value&lt;/code&gt;. E.g. if you have &lt;code&gt;.top_value = 10&lt;/code&gt;, then you can set seq_value = 5, to get 50% duty cycle.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NORDIC51822 PWM Settings</title><link>https://devzone.nordicsemi.com/thread/107063?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 05:39:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3937f80c-7db3-464e-ba11-f3375202ce7a</guid><dc:creator>creator</dc:creator><description>&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/_5F00_20171016133905.png" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>