<?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>HW PWM disturbance</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111401/hw-pwm-disturbance</link><description>Hi! 
 I&amp;#39;m developing for nrf52832 using zephyr. I&amp;#39;m using the nordic hal driver in order to use the PWM with EasyDMA. The PWM is used to control a piezo buzzer. The PWM is working and to my understanding the CPU should not be able to interfere when using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 23 May 2024 11:54:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111401/hw-pwm-disturbance" /><item><title>RE: HW PWM disturbance</title><link>https://devzone.nordicsemi.com/thread/485625?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 11:54:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27c228df-8a19-44ce-84e4-e8fca355a0ad</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
[quote user="JonasS"]Is it possible, when we need to drive the PWM controlling the buzzer, lock it so that it not using the HFINT. And then when we not using the PWM anymore switch back letting the system switch again between the clocks?[/quote]
&lt;p&gt;Yeah, absolutely.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Use&amp;nbsp;&lt;br /&gt;err = onoff_cancel_or_release(clk_mgr, &amp;amp;clk_cli);&lt;br /&gt;&lt;br /&gt;when the&amp;nbsp;PWM is not being used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HW PWM disturbance</title><link>https://devzone.nordicsemi.com/thread/485612?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 11:18:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19be4092-7ee9-49bf-a3b8-71ff0aec29a8</guid><dc:creator>JonasS</dc:creator><description>&lt;p&gt;Ok, that was quite big difference.&lt;/p&gt;
&lt;p&gt;Our product is dependent on the power consumption so I have another questions.&lt;/p&gt;
&lt;p&gt;Is it possible, when we need to drive the PWM controlling the buzzer, lock it so that it not using the HFINT. And then when we not using the PWM anymore switch back letting the system switch again between the clocks?&lt;/p&gt;
&lt;p&gt;Best regards Jonas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HW PWM disturbance</title><link>https://devzone.nordicsemi.com/thread/485578?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 09:04:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e50bc97-3e96-4f1f-bbc4-5aecb458ee1c</guid><dc:creator>Sigurd</dc:creator><description>[quote user="JonasS"]Thanks for the answer. Tried the solution and it became much better :)[/quote]
&lt;p&gt;Great to hear!&lt;/p&gt;
[quote user="JonasS"]Could this have any impact on the power consumption?&amp;nbsp;[/quote]
&lt;p&gt;Yes, &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=5_2_0_18_3_0#unique_641326801"&gt;from the PS&lt;/a&gt; we have that the&amp;nbsp;&lt;span&gt;Run current for HFINT is 60uA, while the run current for HFXO is 250uA.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HW PWM disturbance</title><link>https://devzone.nordicsemi.com/thread/485542?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 07:38:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e7a4464-5490-41af-afef-ab6a0a51efad</guid><dc:creator>JonasS</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;Thanks for the answer. Tried the solution and it became much better :)&lt;/p&gt;
&lt;p&gt;Could this have any impact on the power consumption?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;BR Jonas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: HW PWM disturbance</title><link>https://devzone.nordicsemi.com/thread/485481?ContentTypeID=1</link><pubDate>Wed, 22 May 2024 15:39:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a6f8f7e-6fbf-4b5e-9243-844434daa931</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;The Bluetooth stack will request the HFXO when it uses the RADIO, so you might see some small jitter when HFCLK changes between HFINT and HFXO.&lt;/p&gt;
&lt;p&gt;You can&amp;nbsp;call this function below&amp;nbsp;to request HFXO to be used all the time, and see if you see any changes:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int clocks_start(void)
{
	int err;
	int res;
	struct onoff_manager *clk_mgr;
	struct onoff_client clk_cli;

	clk_mgr = z_nrf_clock_control_get_onoff(CLOCK_CONTROL_NRF_SUBSYS_HF);
	if (!clk_mgr) {
		LOG_ERR(&amp;quot;Unable to get the Clock manager&amp;quot;);
		return -ENXIO;
	}

	sys_notify_init_spinwait(&amp;amp;clk_cli.notify);

	err = onoff_request(clk_mgr, &amp;amp;clk_cli);
	if (err &amp;lt; 0) {
		LOG_ERR(&amp;quot;Clock request failed: %d&amp;quot;, err);
		return err;
	}

	do {
		err = sys_notify_fetch_result(&amp;amp;clk_cli.notify, &amp;amp;res);
		if (!err &amp;amp;&amp;amp; res) {
			LOG_ERR(&amp;quot;Clock could not be started: %d&amp;quot;, res);
			return res;
		}
	} while (err);

	LOG_DBG(&amp;quot;HF clock started&amp;quot;);
	return 0;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>