<?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>getting incorrect output using the timer_example_timer_mode example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24419/getting-incorrect-output-using-the-timer_example_timer_mode-example</link><description>My goal is to generate the clock signal of some particular frequency. I am using nrf51822 DK and used the timer example code from
 github : github.com/.../main.c .
With timer prescalar set to 0 , the output frequency should be 16Mhz.
but the output</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Aug 2017 15:15:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24419/getting-incorrect-output-using-the-timer_example_timer_mode-example" /><item><title>RE: getting incorrect output using the timer_example_timer_mode example</title><link>https://devzone.nordicsemi.com/thread/96169?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 15:15:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11a1e859-9f1b-413a-95f6-b013646c9afc</guid><dc:creator>Nikhil</dc:creator><description>&lt;p&gt;Thank you very much Jorn. I really appreciate your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getting incorrect output using the timer_example_timer_mode example</title><link>https://devzone.nordicsemi.com/thread/96168?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 15:11:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fbfdccf-64ac-445d-b48c-df0655bcc3dc</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Unfortunately it is practically impossible to generate a 16MHz signal. The best I have found is 8MHz using a timer, PPI and GPIOTE, &lt;a href="https://github.com/NordicSemiconductor/nrf51-8-mhz-gpio-clock"&gt;here&lt;/a&gt;. However we cannot guarantee stable and reliable operation, so use it at your own risk.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getting incorrect output using the timer_example_timer_mode example</title><link>https://devzone.nordicsemi.com/thread/96170?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 12:34:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90638d64-7457-4f91-b0c9-38810b9babca</guid><dc:creator>Nikhil</dc:creator><description>&lt;p&gt;Thanks Jorn. How can I generate the clock signal of 16 Mhz?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: getting incorrect output using the timer_example_timer_mode example</title><link>https://devzone.nordicsemi.com/thread/96167?ContentTypeID=1</link><pubDate>Thu, 17 Aug 2017 09:42:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c56e909f-d7d2-46b1-a49b-1a4bc6a50238</guid><dc:creator>J&amp;#248;rn</dc:creator><description>&lt;p&gt;Hello Nikhil&lt;/p&gt;
&lt;p&gt;I believe the result you see is correct.
The example toggles a led on two compare values of the timer. The led then blinks with a frequency of approximately 244 Hz (4,098ms period time on my logic analyzer). This is however NOT the timer frequency of 16 MHz.
The timer counts through 65536 values during one LED period. To find the actual timer frequency you take 65536/0,004098 = 15992191Hz, approximately 16MHz as decribed in the example.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Jørn Frøysa&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>