<?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>Difference bewteen top value and duty cycle in PWM Driver</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84033/difference-bewteen-top-value-and-duty-cycle-in-pwm-driver</link><description>Hi, I&amp;#39;m trying to use the pwm driver to turn off or on a dc motor (which the speed will variate via the pwm signal). I need to achieve a frequency between 20kHz and 100kHz and to variate the dutycyle. I do understand that the frequency is my main frequency</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jan 2022 12:09:28 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84033/difference-bewteen-top-value-and-duty-cycle-in-pwm-driver" /><item><title>RE: Difference bewteen top value and duty cycle in PWM Driver</title><link>https://devzone.nordicsemi.com/thread/349514?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 12:09:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d9861c2-03d4-482d-95e1-5b9e64866dcd</guid><dc:creator>Christos.Bou</dc:creator><description>&lt;p&gt;Thanks you, that vas very clear !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Difference bewteen top value and duty cycle in PWM Driver</title><link>https://devzone.nordicsemi.com/thread/349511?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 11:57:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03de6994-c067-4e74-b972-986ed3e557c3</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]I put 500kHz with a top value of 6, I&amp;#39;ll have a frequency of 83,33kHz. (is it correct ?)[/quote]
&lt;p&gt;Correct.&lt;/p&gt;
[quote user=""]I don&amp;#39;t understand how the duty cycle is working[/quote]
&lt;p&gt;In short, it&amp;#39;s the ratio between&amp;nbsp;seq_value and top value. With&amp;nbsp;duty_forward/duty_reverse&amp;nbsp;set to 3, you should get 50% duty cycle.&lt;/p&gt;
[quote user=""]Is it correct to make the top value minus the duty cycle (which duty_forward is a uint16_t, so his value is from 0 to 65535) to get the correct comparaison ?[/quote]
&lt;p&gt;Yes, but limited by top_value, so 0 to 6 is valid values for&amp;nbsp;&lt;span&gt;duty_forward/&lt;/span&gt;&lt;span&gt;duty_reverse in this case.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>