<?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>nRF24LE1 PWM frequency setting</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47764/nrf24le1-pwm-frequency-setting</link><description>Hi, 
 I&amp;#39;m asking this becase it is not very clear about the PWM in Product Specification v1.6 for nRF24LE1 in the nRF24LE1_PS_v1.6.pdf mentioned the pwm Frequency-range from 4 kHz to 254 kHz (when MCU is clocked at 16 MHz), First, may i know what the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 May 2019 09:13:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47764/nrf24le1-pwm-frequency-setting" /><item><title>RE: nRF24LE1 PWM frequency setting</title><link>https://devzone.nordicsemi.com/thread/189250?ContentTypeID=1</link><pubDate>Mon, 27 May 2019 09:13:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c526f96b-51a3-4b25-8100-e3cc767cdef7</guid><dc:creator>Kevin</dc:creator><description>&lt;p&gt;Hi Hakon,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Very appreciate your answer, that solved my confusion for few days !&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;please kindly update this in&amp;nbsp;next version PS Doc,&amp;nbsp; and another e&lt;span&gt;rrata in my previous post, thanks.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;br /&gt;Kevin.&lt;/p&gt;
&lt;pre class="tw-data-text tw-ta tw-text-medium" id="tw-target-text" dir="ltr"&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF24LE1 PWM frequency setting</title><link>https://devzone.nordicsemi.com/thread/189216?ContentTypeID=1</link><pubDate>Mon, 27 May 2019 07:51:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f68d6319-99c2-44b9-97a5-8d22a9f30aa4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]First, may i know what the pre-scale value we chose to get the 4 kHz and 254kHz?[/quote]
&lt;p&gt;4kHz: PWMCON (7:6) = 0b&amp;#39;11, and PWMCON[5:2]&amp;nbsp; = 15&lt;/p&gt;
&lt;p&gt;This gives 16M clk * 1 / (255 * (15+1) = ~4&amp;nbsp;kHz (generating an effective 2kHz pulse)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;254 kHz:&amp;nbsp;&lt;span&gt;4kHz: PWMCON (7:6) = 0b&amp;#39;00, and PWMCON[5:2]&amp;nbsp; =&amp;nbsp;0&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;16M * 1 / (31 * (0&amp;nbsp;+ 1) = ~516 kHz (generating an effective ~258 kHz pulse)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Quick test in firmware:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    // Fast
    #if 1
    PWMCON = 0x03;
    PWMDC0 = 15;
    // Slow
    #else
    PWMCON = 0xff;
    PWMDC0 = 127;
    #endif&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So, the documentation is incorrect, as the PWM peripheral itself will be between 4 kHz and 516 kHz, with an effective output frequency of between 2 kHz and 258 kHz.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;[quote user=""][/quote]&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;second, what is the available value for PWMCON bit5-2: PWM frequency pre-scale factor , is it from 0~15 ? all the 16 values can be chose ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;As per the first picture you attached, you can set the prescaler from 0 to 15. You are free to choose any value between.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>