<?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 output with stable frequency</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/52893/pwm-output-with-stable-frequency</link><description>PWM output with stable frequency 
 SDK: 15.3.0 Example: low_power_pwm Device: EYSHJNZWZ (nRF52832) 
 I want to output PWM with a stable frequency. In the above sample, PWM output with stable frequency was confirmed. 
 However, when the following processing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Oct 2019 23:36:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/52893/pwm-output-with-stable-frequency" /><item><title>RE: PWM output with stable frequency</title><link>https://devzone.nordicsemi.com/thread/214238?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 23:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91850698-50e8-4745-8575-c49af1acb40b</guid><dc:creator>takashina hiroki</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; For PWM in pwm_library / pwm_driver, it&amp;#39;s the HFCLK that decides how stable the frequency is.&lt;br /&gt;&amp;gt;&amp;gt; The low_power_pwm library uses the app_timer (which in turn use RTC1 (uses LFCLK)). But the toggling is done in interrupt context, so other interrupts could affect the PWM timing.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;From the above, I recognize that there is no way to achieve stable PWM output with PWM with LFCLK (XTAL) as the clock source.&lt;br /&gt;Is my perception correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM output with stable frequency</title><link>https://devzone.nordicsemi.com/thread/214111?ContentTypeID=1</link><pubDate>Wed, 09 Oct 2019 10:12:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dac095d2-01f9-4356-a220-e57d20be1480</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;The low_power_pwm library uses the app_timer (which in turn use RTC1(uses&amp;nbsp;LFCLK)). But the toggling is done in&amp;nbsp;interrupt context, so other&amp;nbsp;interrupts could affect the PWM timing. If you want to avoid that, use e.g.&amp;nbsp;pwm_library instead.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM output with stable frequency</title><link>https://devzone.nordicsemi.com/thread/213759?ContentTypeID=1</link><pubDate>Mon, 07 Oct 2019 23:26:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8601634d-1cf3-4b88-b391-7906b558d29a</guid><dc:creator>takashina hiroki</dc:creator><description>&lt;p&gt;&amp;gt;&amp;gt; For PWM in pwm_library / pwm_driver, it&amp;#39;s the HFCLK that decides how stable the frequency is.&lt;/p&gt;
&lt;p&gt;I want to select LFCLK (XTAL) as the PWM clock source.&lt;br /&gt;Therefore, these cannot be used.&lt;br /&gt;Is there a way to perform stable PWM output with a PWM whose clock source is LFCLK (XTAL)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM output with stable frequency</title><link>https://devzone.nordicsemi.com/thread/213588?ContentTypeID=1</link><pubDate>Mon, 07 Oct 2019 09:33:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:988e4f62-fc66-4435-99d1-b3979ddcf090</guid><dc:creator>Sigurd</dc:creator><description>[quote userid="72172" url="~/f/nordic-q-a/52893/pwm-output-with-stable-frequency/213525"]There seems to be no link listed first.[/quote]
&lt;p&gt;I fixed the links.&lt;/p&gt;
[quote userid="72172" url="~/f/nordic-q-a/52893/pwm-output-with-stable-frequency/213526"]Is it possible to select LFCLK (XTAL) with &amp;quot;pwm_library&amp;quot; or &amp;quot;pwm_driver&amp;quot;?[/quote]
&lt;p&gt;For PWM in pwm_library / pwm_driver, it&amp;#39;s the HFCLK that decides how stable the&amp;nbsp;frequency is. Use &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/group__nrf__drv__clock.html?cp=5_1_6_9_0_3_0_8#ga425c8dc0508bb9c0777da123b7c66f3d"&gt;nrf_drv_clock_hfclk_request()&lt;/a&gt;&lt;span&gt;&amp;nbsp;to request&amp;nbsp;high-accuracy(HFXO) source HFCLK.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM output with stable frequency</title><link>https://devzone.nordicsemi.com/thread/213526?ContentTypeID=1</link><pubDate>Sun, 06 Oct 2019 23:56:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91b1daa2-337d-494a-9e2d-c8df4de0f227</guid><dc:creator>takashina hiroki</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry.&lt;br /&gt;I forgot to talk about one important thing.&lt;/p&gt;
&lt;p&gt;I want to select LFCLK (XTAL) as the PWM clock source.&lt;br /&gt;Is it possible to select LFCLK (XTAL) with &amp;quot;pwm_library&amp;quot; or &amp;quot;pwm_driver&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM output with stable frequency</title><link>https://devzone.nordicsemi.com/thread/213525?ContentTypeID=1</link><pubDate>Sun, 06 Oct 2019 23:08:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ec59a04-f063-4ee7-a36a-db9e9d543908</guid><dc:creator>takashina hiroki</dc:creator><description>&lt;p&gt;Thank you for answering.&lt;/p&gt;
&lt;p&gt;There seems to be no link listed first.&lt;br /&gt;Please let me know if there are similar links.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: PWM output with stable frequency</title><link>https://devzone.nordicsemi.com/thread/213467?ContentTypeID=1</link><pubDate>Fri, 04 Oct 2019 15:45:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4a489ed-7fbd-4c1d-873c-6911749771e7</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Is there a way to perform stable PWM output regardless of other factors such as interrupts?[/quote]
&lt;p&gt;&amp;nbsp;Yes,&amp;nbsp;you should checkout the pwm_library instead(uses TIMER+GPIOTE+PPI). See&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_pwm.html?cp=5_1_3_34"&gt;this&lt;/a&gt; and &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.3.0%2Fpwm_example.html&amp;amp;cp=5_1_4_6_23"&gt;this link&lt;/a&gt;.&lt;/p&gt;
[quote user=""]Is it possible to output PWM at the hardware level?[/quote]
&lt;p&gt;Yes, we also have&amp;nbsp;dedicated &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pwm.html?cp=3_1_0_46#concept_pzc_1pw_nr"&gt;PWM hardware&lt;/a&gt; on the nRF52 series. The&amp;nbsp;&lt;span&gt;pwm_driver uses that. See &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/pwm_hw_example.html?cp=5_1_4_6_22"&gt;this link.&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>