<?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>Custom PWM base clock frequency</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/14954/custom-pwm-base-clock-frequency</link><description>Heyho! 
 Is it possible to set the PWM base clock frequency to 40kHz? If so, how? I see that the predefined base clock frequencies don&amp;#39;t go any lower than 125kHz. 
 I&amp;#39;m using an nRF52 DK with the PWM-hardware driver. (nrf_drv_pwm) 
 EDIT: I might add</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Jul 2016 06:07:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/14954/custom-pwm-base-clock-frequency" /><item><title>RE: Custom PWM base clock frequency</title><link>https://devzone.nordicsemi.com/thread/57041?ContentTypeID=1</link><pubDate>Thu, 07 Jul 2016 06:07:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77b29775-13e0-4ed0-84ea-6645e6774e8b</guid><dc:creator>Henrik</dc:creator><description>&lt;p&gt;Thank you so much!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom PWM base clock frequency</title><link>https://devzone.nordicsemi.com/thread/57040?ContentTypeID=1</link><pubDate>Wed, 06 Jul 2016 16:49:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a6fca86-f3b1-4585-8b6d-bf1d2e552a8a</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi Henrik&lt;/p&gt;
&lt;p&gt;As I understand it, the PWM switching frequency is actually the multiplication of the base frequency and the COUNTERTOP when in up-counting mode. The formula is also given in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/pwm.html?cp=2_2_0_46_0#concept_l3d_smw_nr"&gt;PWM peripheral documentation in the PS&lt;/a&gt; below figure 2. So if you want to set PWM frequency of 40kHz, you could for example set mode=count_up, base frequency as 1MHz and COUNTERTOP=25 because 1MHz/25=40kHz.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>