<?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>Setting 100% PWM duty cycle.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107235/setting-100-pwm-duty-cycle</link><description>Hello, 
 I use nRF52840 in a project in which I read a potentiometer and set PWM output from 0 to 100%. Setting [0 .. 100%) is OK,but when I try set exactly 100% duty cycle, I see at the oscilloscope 0%. I use following function to set PWM DC: 
 ol_DC_movingsetting</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 10 Jan 2024 16:04:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107235/setting-100-pwm-duty-cycle" /><item><title>RE: Setting 100% PWM duty cycle.</title><link>https://devzone.nordicsemi.com/thread/463605?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 16:04:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7226222a-3ffd-4cd4-97ac-631dd19d2744</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;I&amp;#39;m was not able to reproduce this.&lt;/p&gt;
&lt;p&gt;Could you provide a simple sample that reproduces this?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting 100% PWM duty cycle.</title><link>https://devzone.nordicsemi.com/thread/463533?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 12:30:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7087de7-244d-448c-ba4e-ba4a45e1e150</guid><dc:creator>JWalker</dc:creator><description>&lt;p&gt;Again low level at the oscilloscope....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting 100% PWM duty cycle.</title><link>https://devzone.nordicsemi.com/thread/463531?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 12:28:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c466d362-6737-45c5-b297-78f93af548b2</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;How about this then ?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;pwm_set_dt(get_pwmmotor_device(), 0u, 0u);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting 100% PWM duty cycle.</title><link>https://devzone.nordicsemi.com/thread/463529?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 12:24:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4b198e8-1157-4f19-9455-c16067a27bf7</guid><dc:creator>JWalker</dc:creator><description>&lt;p&gt;Hi!&lt;br /&gt;&lt;br /&gt;It does not work - produces low level at the PWM output.&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// PWM output
static struct pwm_dt_spec pwmmotor = PWM_DT_SPEC_GET(DT_ALIAS(pwmmotor0));

const struct pwm_dt_spec* get_pwmmotor_device(void)
{
    return &amp;amp;pwmmotor;
}

void ol_set_output(void)
{
    pwm_set_dt(get_pwmmotor_device(), 100u, 100u);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I do not know if following in the device can produce this problem&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;compatible = &amp;quot;pwm-leds&amp;quot;;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;However I cannot figure what &amp;quot;pwm-leds&amp;quot; could be changed with...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Setting 100% PWM duty cycle.</title><link>https://devzone.nordicsemi.com/thread/463523?ContentTypeID=1</link><pubDate>Wed, 10 Jan 2024 12:07:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1cf78171-5e42-4f4a-a4d4-7879645720ff</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Does this work for you?&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;pwm_set_dt&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;&amp;amp;pwm_motor_0&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;100&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;100&lt;/span&gt;&lt;span&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>