<?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>PWM duty-cycle error</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103476/pwm-duty-cycle-error</link><description>Hi, I have a custom board with a nRF52832, and I am using a hardware PWM channel to drive a buzzer. 
 I am using SDK v17.1.0 and softdevice S132. 
 Sometimes my board needs to advertise fast and sometimes slowly. 
 When advertising slowly, everything</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Sep 2023 11:52:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103476/pwm-duty-cycle-error" /><item><title>RE: PWM duty-cycle error</title><link>https://devzone.nordicsemi.com/thread/444703?ContentTypeID=1</link><pubDate>Wed, 06 Sep 2023 11:52:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0dc5385-ecac-4883-a161-5b1c2d66ce92</guid><dc:creator>Kenneth_CBS</dc:creator><description>&lt;p&gt;It works - thank you so much!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM duty-cycle error</title><link>https://devzone.nordicsemi.com/thread/444695?ContentTypeID=1</link><pubDate>Wed, 06 Sep 2023 11:06:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed05db12-3f32-4753-8c8e-e8fbffe09541</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I would expect possible audio distortion may occur when updating the PWM, but to answer this question:&lt;/p&gt;
[quote user=""]According to my measurements, the PWM pulse width (and therefore also the duty cycle) changes randomly between 476us and 483us in the same burst of PWM pulses.[/quote]
&lt;p&gt;Can you try have the HFCLK running continously by using&amp;nbsp;sd_clock_hfclk_request()?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>