<?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>How to set PWM cycle to 10 seconds ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50977/how-to-set-pwm-cycle-to-10-seconds</link><description>Hi, 
 I use SDK 10 pwm example (examples\peripheral\pwm) to modify the PWM cycle to 10s and duty cycle to 50%. 
 Code showed as below: 
 
 
 But the PWM cycle seem only around 3 seconds. Can it possible change PWM cycle time to 10s ? If can, how to do</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Aug 2019 12:51:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50977/how-to-set-pwm-cycle-to-10-seconds" /><item><title>RE: How to set PWM cycle to 10 seconds ?</title><link>https://devzone.nordicsemi.com/thread/204078?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2019 12:51:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fdce274-feba-4e2d-bb02-28aff0c81311</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The 16 bit timer on the nRF51 will wrap around after a bit more than two seconds, using the lowest possible frequency (after the prescaler). So if you need a longer cycle you need to either modify the PWM library to handle wrapping or consider using the RTC (for instance via the app_timer) instead. Luckily, you don&amp;#39;t have to implement the RTC approach yourself, as we provide a &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v10.0.0/lib_low_power_pwm.html?cp=5_5_11_3_13"&gt;low power PWM library&lt;/a&gt; for this reason. Unless you need a very accurate signal despite the long duration, then the RTC bases approach you get in the ow power PWM library is probably just what you need.&lt;/p&gt;
&lt;p&gt;By the way, is there a particular reason you are using SDK 10? (The latest SDK with support for nRF51 is 12.3).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>