<?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>Unable to Run timer1 with S110</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27010/unable-to-run-timer1-with-s110</link><description>I&amp;#39;m developing application on nrf51 for that i&amp;#39;m using...
SDK : nRF51_SDK_8.1.0_b6ed55f
Board : PCA10028
I&amp;#39;m trying to run code from SDK examples C:\nRF51_SDK_8.1.0_b6ed55f\examples\peripheral\timer\pca10028\armgcc in SDK with s110 softdevice. it is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Jun 2015 12:12:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27010/unable-to-run-timer1-with-s110" /><item><title>RE: Unable to Run timer1 with S110</title><link>https://devzone.nordicsemi.com/thread/105952?ContentTypeID=1</link><pubDate>Mon, 01 Jun 2015 12:12:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:69d55a7e-6c93-445e-92b6-3e45361bc62c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;pre&gt;&lt;code&gt;uint32_t time_ms = 500;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You are using Timer1 which is only 16-bit wide. By default it it uses 16MHz clock and prescaler of 0, which means that it generates 16000000 ticks per second. So for 500ms it generates half of that which is 8000000(0X7A1200) ticks.  The maximum TIMER1 can take is 0XFFFF (65535 ticks). Which means that when you try to write 0X7A1200 into this 16-bit register it only writes 0X1200 in it. Which in turn configures your timer to generate interrupt very 287us. Your leds are blinking but really really fast.&lt;/p&gt;
&lt;p&gt;So you have to make sure that your 500ms fits into your timer. This you can achieve by changing the prescaler of TIMER1 to&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#if (TIMER1_ENABLED == 1)
#define TIMER1_CONFIG_FREQUENCY    NRF_TIMER_FREQ_125kHz
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now Timer1 will generate only 125000 ticks per second, so for 500ms it will generate 625000(0XF2F4) ticks. Which will fit nicely for you case.&lt;/p&gt;
&lt;p&gt;The higher the timout value, lower should be timer tick frequency, else the tick wont fit in.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>