<?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>sdk11 pwm frequency control</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16072/sdk11-pwm-frequency-control</link><description>Hi, i used sdk11 and softdevice version s130_2.0. 
 And i used pwm library. 
 i try to make pwm pulse accurate 38khz. 
 When i used sdk 6.0, i could control timer used to prescaler and cc[0]. 
 but sdk 11, i couldn&amp;#39;t find prescaler and cc[0]. 
 i</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Aug 2016 16:55:35 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16072/sdk11-pwm-frequency-control" /><item><title>RE: sdk11 pwm frequency control</title><link>https://devzone.nordicsemi.com/thread/61302?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 16:55:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5426c17-4fcf-4491-8544-f065093b0b68</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;ok, I see your point.&lt;/p&gt;
&lt;p&gt;To get 38.0 kHz, I suspect you need timer prescaler as = 0 to have the base frequency of the timer as 16MHz&lt;/p&gt;
&lt;p&gt;The desired timer ticks are therefore 16MHz/38khz=421=0x1A5. In order to set the TIMER CC value as 0x1A5, you could hardcode that in the app_pwm.c -&amp;gt; app_pwm_init function. Instead of calling nrf_drv_timer_us_to_ticksin line 777, just set ticks = 0x1A5;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sdk11 pwm frequency control</title><link>https://devzone.nordicsemi.com/thread/61303?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 06:56:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82ab983c-616a-4386-b45d-f9075007a235</guid><dc:creator>HakJae</dc:creator><description>&lt;p&gt;So i used &amp;quot;app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(26L, 3, BSP_LED_1);&amp;quot; and &amp;quot;app_pwm_channel_duty_set(&amp;amp;PWM1, 0, 50);&amp;quot;. it can control period merely &amp;#39;us&amp;#39; unit. it have 38.461khz..  i want to have 38.0xx khz. So i should control prescaler. how to control prescaler ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sdk11 pwm frequency control</title><link>https://devzone.nordicsemi.com/thread/61301?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2016 06:29:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83158248-1b17-44f4-a141-50dd5a50f70c</guid><dc:creator>Stefan Birnir Sverrisson</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;For reliable PWM, use the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/lib_pwm.html?cp=6_0_0_3_20"&gt;PWM library in SDK 11&lt;/a&gt;. The PWM library uses TIMER peripheral in the background. There is a library function &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/group__app__pwm.html?cp=6_0_0_6_8_17_10#ga071ee86851d8c0845f297df5d23a240d"&gt;app_pwm_channel_duty_set&lt;/a&gt; to set the duty cycle. To set the PWM period, configure app_pwm_config_t.period_us before initializing the PWM library. There is &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v11.0.0/pwm_example.html?cp=6_0_0_4_5_16"&gt;pwm_library example in SDK 11&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>