<?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>comprehension question Timer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/198/comprehension-question-timer</link><description>Hi, 
 maybe i have a silly question, but i didn&amp;#39;t programm timers before. I know how they work. But how is it possible that there are only three Timers in the 51822 and so many parts of the programm part (PWM,BLE,GPIOTE...) which need a timer? How can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Aug 2014 09:58:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/198/comprehension-question-timer" /><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1109?ContentTypeID=1</link><pubDate>Mon, 11 Aug 2014 09:58:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bd09748-d601-4fad-9b46-149b9c1157a7</guid><dc:creator>Ivan G&amp;#243;mez</dc:creator><description>&lt;p&gt;This is for sure the best post I found related with timers explanations in this forum. I&amp;#39;m trying to work with timers with a nRF51822 BLUETOOTH SMART BEACON KIT but I&amp;#39;m not able to make it work well. I get the date as I want ( I haven&amp;#39;t programmed timers at this level before) but I haven&amp;#39;t modified any timer in the example provided with the kit. The problem is that I use strftime call to get the time in the format I want but the hours pass like seconds and the minutes and seconds... really fast. I think that maybe the timer RTC0 is used for another task and there is a conflict with it. I don&amp;#39;t know well how can I check in order to modify the code to get the date as I want to.&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;
&lt;p&gt;Iván Gómez.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1097?ContentTypeID=1</link><pubDate>Mon, 05 Aug 2013 04:10:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4641d86-08d5-478a-884d-fa5cc5a3fc10</guid><dc:creator>Philip Freidin</dc:creator><description>&lt;p&gt;Hi Nils,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m glad to help. (sorry for my english, I am Australian and American :-)&lt;/p&gt;
&lt;p&gt;With regard to temperature, it is better to describe it as temperature dependence rather than compensation.&lt;/p&gt;
&lt;p&gt;The short answer to your question is Xtal or synth are both better than RC.&lt;/p&gt;
&lt;p&gt;The long answer is:&lt;/p&gt;
&lt;p&gt;Since the synthesizer depends on a crystal (16 or 32 MHz) , both the synthesizer and 32768 Hz crystal options will have similar characteristics. It depends on the crystal you specify and buy, but typically in the range of +/- 10 ppm to +/- 100ppm. On page 31 of the product spec, Nordic gives the worst case values of 60 ppm or 40 ppm. Lower values usually mean more expensive parts, but not always.&lt;/p&gt;
&lt;p&gt;In general, crystal oscillators will always be less affected by temperature than an RC oscillator. This is why crystals are used whenever an accurate clock is needed. There are also special crystal oscillators with extra stuff to compensate for temperature effects (TCXO) and oscillators that include a miniature oven to create a stable temperature (OCXO). Look here if you want to learn more &lt;a target="_blank" href="http://www.vectron.com" rel="nofollow"&gt;http://www.vectron.com&lt;/a&gt;  For work with the Nordic chips, you do not need these type of oscillators, I just thought you might be interested.&lt;/p&gt;
&lt;p&gt;Also, you may want to consider other things: 32768 Hz RC oscillator is totally inside the chip, XTAL/Synth both require an external crystal, but if you are using the radio, you need a crystal anyway. Also the 16/32 MHz crystal oscillators requires about 400 uA (page 31 and 32). The 32768 crystal oscillator needs only 1 uA (page 33,  fabulous), and the RC oscillator need 0.8 uA (page 34). These are all typical numbers.&lt;/p&gt;
&lt;p&gt;You asked &amp;quot;Why does it depend on Vcc ?&amp;quot;&lt;/p&gt;
&lt;p&gt;A crystal oscillator is only affected a tiny amount by change in VCC.
An RC oscillator is affected more by change in VCC.&lt;/p&gt;
&lt;p&gt;The reason is that the resistor (R) and capacitor (C) are implemented with various structures on the chip, and these structures are affected by the voltage the chip runs at, and also by temperature.&lt;/p&gt;
&lt;p&gt;When Nordic give a +/- 2% accuracy range for the RC oscillator, that range includes the combined effects of voltage (1.8V to 3.6V, page 29),
and temperature (-25C to 75C, page 29), and the general variability from one chip to another (usually described as &amp;quot;Process&amp;quot;). This is usually referred to as PVT parameters.&lt;/p&gt;
&lt;p&gt;Cheers,
Philip&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1096?ContentTypeID=1</link><pubDate>Sun, 04 Aug 2013 20:16:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7b9f22e-718d-4ce7-a670-f07641f57cde</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Hi Philip,&lt;/p&gt;
&lt;p&gt;thanks for your usefull informations. Every time you telling me how to understand the things i realy get more and more points of reference (sorry for my english, i am german :D), thanks because this is great for a newbie.
I just read the part you told me. Is it better , for tempreture compensating, to use an RC or an XTAL or to synth?&lt;/p&gt;
&lt;p&gt;Why does it depent on Vcc ?&lt;/p&gt;
&lt;p&gt;best regards Nils :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1095?ContentTypeID=1</link><pubDate>Sun, 04 Aug 2013 16:38:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ae43ee6-0dc1-4262-ab0d-6f13e39eaeec</guid><dc:creator>Philip Freidin</dc:creator><description>&lt;p&gt;The accuracy of the frequency you get from RTC0 or 1 depends on the accuracy of LFCLK. In my example function RTC1_ms_timer.c , I have selected the RC oscillator on line 36.  In the reference manual on page 54, LFCLKSRC has 3 possible choices. If you use either the synthesizer, or the 32768 Hz external crystal, you will have accuracy that depends on the crystal, probably around 60 ppm. On page 34 of the product spec, the spec fTOL,RC32k is given as +/- 2% , which is +/- 20000 ppm .&lt;/p&gt;
&lt;p&gt;There is also a calibration process that can use the 16MHz oscillator to temporarily (4 seconds according to fTOL,CAL,RC32k) improve accuracy of the RC oscillator to +/- 250 ppm. I&amp;#39;ve read the description in the ref manual at 12.1.3 , page 51, the information provided is insufficient for me to figure out how this should be used. I could not find any examples for this part of the chip.&lt;/p&gt;
&lt;p&gt;If you just want an approximate 1 ms tick, then the RC oscillator may be sufficient. If you need a more accurate tick, then use either the synthesizer (which needs the 16MHz crystal) or use the 32768 Hz crystal.&lt;/p&gt;
&lt;p&gt;Also, although you write &amp;quot;a perfect millisecond&amp;quot; , I suspect that it is just close, rather than perfect. Watch the signal on the oscilloscope, as you apply heat (hot air gun) or cold (can of instant freeze) to the chip, and you will see that it is temperature dependent. Probably also dependent on VCC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1108?ContentTypeID=1</link><pubDate>Sun, 04 Aug 2013 14:53:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c5095ce-8e7f-49aa-a2fe-bf53281fe48a</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Are there any informations for newbies to understand this better?&lt;/p&gt;
&lt;p&gt;best regards Nils&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1094?ContentTypeID=1</link><pubDate>Sun, 04 Aug 2013 14:52:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd36cdc4-c798-4f33-84cb-0d2ba60b31d9</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Hi Philip,&lt;/p&gt;
&lt;p&gt;thanks for your answer, it works.
But i changed the parameters like the preascaler. I messeured with the oscilloscope and when i take a prescaler with (idon#t know the exact value,i have to look on monday) 33 or 34 i get aa perfect millisecond.
why don&amp;#39;t i get the calculated time?&lt;/p&gt;
&lt;p&gt;best regards Nils&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1106?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2013 09:30:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9a5b2bb-990a-45fb-88e9-3e611cba6b17</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Thanks again, Philip.
Your feedback is appreciated :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1105?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2013 07:35:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f74b1a7-0755-4d4a-81e2-a8a79da3bc7d</guid><dc:creator>Philip Freidin</dc:creator><description>&lt;p&gt;Hi Audun,&lt;/p&gt;
&lt;p&gt;Thanks for engaging on this documentation topic, I&amp;#39;m glad you will be passing it on.  Given the choice of tutorials in the SDK or a stand alone document, I think a standalone document is better, but once it is written, it could be included in nrf51_sdk.chm as a section, at the same level as the current two top-level topics: Modules and Data Structures.&lt;/p&gt;
&lt;p&gt;In my experience, once a document is called an Application Note, the tendency can be to go for brevity, and focus on specific applications. To set the tone correctly, I would suggest &amp;quot;nRF51 Programmer&amp;#39;s Guide&amp;quot;.&lt;/p&gt;
&lt;p&gt;The tone of the document is to explain in detail how each part of the chip operates, explain what tradeoffs should be considered where various setting have interactions or where there are dependencies on other parts of the chip, or even system goals such as power consumption, latency, code size, memory usage, etc.  I think giving a rationale for the structure and features of each peripheral is also very worthwhile, and mandatory for many of the peripherals.&lt;/p&gt;
&lt;p&gt;A complete set of drivers with a uniform API will probably help, but it will likely rely on a vast number of #define constants , which is probably not much better than the current situation. Lacking the same rationale information, I think it would just let you do things you can already do, but easier. The tough things will still be tough, and people will end up having to look at driver sources to figure out what is going on to then write code for things the drivers don&amp;#39;t do or is unclear how to call the driver to do what you want.&lt;/p&gt;
&lt;p&gt;(As an aside, I depend on sources for all library functions. While I understand why source for S110 is not available, I am very concerned about the lack of sources for esb_arm.lib and gzll_arm.lib )&lt;/p&gt;
&lt;p&gt;If I had to choose between a well written  &amp;quot;nRF51 Programmer&amp;#39;s Guide&amp;quot; and a well written set of drivers, I would choose the Guide. With the right information, I can program my self through pretty much anything. With drivers, there will always be things that aren&amp;#39;t covered.&lt;/p&gt;
&lt;p&gt;In terms of resources at Nordic, the better the  &amp;quot;nRF51 Programmers Guide&amp;quot; is , the less support questions you get. Of course the same is true of a driver library  :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1093?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2013 06:55:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d67cd2cc-c3f5-4dff-ae3f-febfaf675a16</guid><dc:creator>Philip Freidin</dc:creator><description>&lt;p&gt;Hi Nils,&lt;/p&gt;
&lt;p&gt;I am delighted that my comments and example code are helping you.&lt;/p&gt;
&lt;p&gt;The PRESCALER register is set to 31 because the actual divide operation is the register value + 1. This is shown in the first formula in 18.1.2&lt;/p&gt;
&lt;p&gt;So if you want to divide by 32, you load PRESCALER with 31. Although 2 examples are given they are not clear enough about what is going on. Here is what I would add to the first example:&lt;/p&gt;
&lt;p&gt;round(32768/100) - 1 =
round(327.68) - 1 =
328 - 1 = 327
So PRESCALER is set to 327, and the LFCLK is
divided by 328 giving 99.9 Hz&lt;/p&gt;
&lt;p&gt;You wrote &amp;quot;Why restarts the rtc_counter if it is bigger then 42?&amp;quot;
In my example code, I do not reset the rtc_counter if it is bigger than 42.
The rtc_counter is never reset, it just keeps counting at 1024 Hz, due to the divide by 32 of the LFCLK (because PRESCALER is 31). In fact my code doesn&amp;#39;t even care about the value in COUNTER. But every time COUNTER is incremented (every 976.5625 us), a TICK interrupt also occurs, and that is what I use for the rest of my code.&lt;/p&gt;
&lt;p&gt;So the RTC1 causes an interrupt at slightly faster than every
millisecond (976.5625 us) and so on each tick, the &amp;quot;millisecond clock gains 23.4375 us&amp;quot;. After 1 second of real time, the RTC1_Milliseconds value would be 1024 (which is no surprise, since the RTC1 is running at 1024 Hz).&lt;/p&gt;
&lt;p&gt;So how do you make it increase by 1000 every second, rather than 1024. We could just subtract 24 once per second, but that would be a big jump. Instead I decided to not do the increment (skip it) on 24 occurrences during the 1 second period, and spread these skips out evenly during the 1 second. So if you increment RTC1_Milliseconds every tick (at 1024 Hz) but after 41 of these, on the next tick we don&amp;#39;t do the increment, then after 1024 interrupts (ticks) the RTC1_Milliseconds will have increased by 1000. RTC1_skip_increment_counter is what controls this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1104?ContentTypeID=1</link><pubDate>Fri, 02 Aug 2013 05:42:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:368e6256-afbf-4352-a754-cb75aca6dd4d</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Hi Philip,&lt;/p&gt;
&lt;p&gt;Thanks. This is valuable feedback for us. I&amp;#39;ll make sure it&amp;#39;s passed on internally.&lt;/p&gt;
&lt;p&gt;Regarding item 3, tutorials. There&amp;#39;s been some discussions about including tutorials as step-by-step code examples in the SDK, showing the &amp;#39;why&amp;#39; as well as the &amp;#39;how&amp;#39;. Do you think this is a usable format, or should it be a completely standalone document like for example an Application Note?&lt;/p&gt;
&lt;p&gt;There&amp;#39;s also been discussed including a complete set of peripheral drivers with a uniform API in the SDK. Using a driver API can be an alternative to learning registers and details regarding peripheral operation. Hopefully this can make development quicker and easier for at least the more common peripheral uses. As you say however, the PPI is not a common interface intuitively understood. A driver by itself won&amp;#39;t give any rationale or insights into how the PPI can be best used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1107?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 19:39:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99588015-4c78-49a6-abc5-5496c75cfbf0</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;I think this Topic here is pretty interesting for ather perople and newbies how starts programming the chip. To understand what ervy part of the chip does and how it can be programmed is essential for the users.&lt;/p&gt;
&lt;p&gt;I think i understand how to programm th rtc the HFCLK Timer is to programm similar?
How to use this compare [] things in the pwm example?&lt;/p&gt;
&lt;p&gt;But i didn&amp;#39;t understand how to use schedluing and what it is good for, its a little bit to abstract for me.
When i have to use it and when not and what is the main task of the scheduler?&lt;/p&gt;
&lt;p&gt;When i have tu use the PPI and the GPIOTE ?
Are they good for relieve the cpu? Or have i to use it also when i just to make a calculation with the cpu and then make an reaction at the output?&lt;/p&gt;
&lt;p&gt;Which timers ar use by the softdevice? Timer 0 and rtc 0?&lt;/p&gt;
&lt;p&gt;I hope you have some indulgence with me when i ask to much questions. It like i tell before i am a newbie. Its pretty much to lern but i hope i will understand it.&lt;/p&gt;
&lt;p&gt;Best regards, Nils :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1103?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 19:28:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9b935aa7-7463-4216-b1bb-91f96adf07d7</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Yes Philip great Comment. With Tutorial it would be much easier to understand how the things work and to use them.&lt;/p&gt;
&lt;p&gt;Just for newbies like me it is pretty hard to understand the 	coherences so a turorial would be pretty helpful.&lt;/p&gt;
&lt;p&gt;Nils :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1092?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 19:15:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:217e3e96-a11d-4677-a140-955242212815</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Hi Philip,&lt;/p&gt;
&lt;p&gt;thanks for this great answer you helped me pretty much with the understanding how to use the rtc or the timer.&lt;/p&gt;
&lt;p&gt;Thanks for this great example,  perfect for me but i have some question.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Why is the prescaler 31, you want to devide the timervalue by 32 is 31 right?&lt;/li&gt;
&lt;li&gt;Why restarts the rtc_counter if it is bigger then 42 ? why this value?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thank you for helping, i am a newbie who trys to understand all this stuff. It is a lot to learn but with such examples it works fine :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1102?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 13:22:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7234762-4fdc-47e1-abcc-2da56959b1db</guid><dc:creator>cocoa</dc:creator><description>&lt;p&gt;This is one of the best  ever written  proactive comments posted here.
The hope is that Nordic decides to publish a guide with practical examples and not just references, often difficult to interpret.&lt;/p&gt;
&lt;p&gt;Totally agree with you.&lt;/p&gt;
&lt;p&gt;Cheers.&lt;/p&gt;
&lt;p&gt;-cocoa&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1101?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 12:42:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb05e1b1-576a-4942-a032-30982d282dc5</guid><dc:creator>Philip Freidin</dc:creator><description>&lt;p&gt;Hi Audun,&lt;/p&gt;
&lt;p&gt;Thanks for your reply.  Let me try and be clearer. There are at
least 3 ways to inform customers of the functionality of the chip,
and how it should be used.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Reference documents.  We have this in the Reference Manual.
This document (should) explicitly state functionality, and where
registers have multiple values, give tables of values.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Example programs. These demonstrate how the chip might be
programmed to achieve a specific task. Its effectiveness depends
on the amount of documentation either in the code, or supplied
with it.&lt;/p&gt;
&lt;p&gt;The supplied examples show specific instances of how various
peripherals might be programmed, but do not cover all possibilities.
The comments might explain what the code is doing, but does not
cover the reason a certain technique is being used (rationale).
The examples do not explain the tradeoffs that may have been
considered, in choosing the way the code has been written.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Tutorials. These documents discuss in detail how a peripheral
is designed to work, it discusses how various settings might
interact, it explains how a customer might evaluate different
operating modes and chose an appropriate one for their
application.  Especially for complex or novel functions, this
type of document is very important.&lt;/p&gt;
&lt;p&gt;Nordic does not currently have this type of documentation for
the nRF51 family.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let me highlight two examples.&lt;/p&gt;
&lt;p&gt;The PPI is a novel method of supporting inter-peripheral communications. I&amp;#39;ve worked with microprocessors for 40 years, and I have never seen anything like it. It is brilliant. Please pass on my comments to the person who invented it.
That being said, the reference material is insufficient in making clear how it should be used. If we were talking about a UART, anyone with experience has seen it before, and so will be familiar with the functionality, and expected behavior.  Since the reference manual is devoid of examples, the supplied documentation is not enough. At a minimum there should be a detailed example that give REAL register addresses and values and draws a schematic of what the example does. Figure 16 is far too abstract. What is needed are actual values for things like CH[0].EEP, CHEN, CHG[n], CH[n].TEP etc for a worked example. Saying that there are examples *.c supplied is not enough, as the only way to figure out what is going on is to reverse engineer the code. That&amp;#39;s what I had to do to get an understanding of how the PPI worked. I shouldn&amp;#39;t have to go to that much effort.&lt;/p&gt;
&lt;p&gt;The WDT has 8 reload request registers. Again, this is something I have not seen before. (maybe I haven&amp;#39;t been using the right chips?). Anyway, here is an example of how the documentation fails to inform:&lt;/p&gt;
&lt;p&gt;(this is from the snippet you referred to)&lt;/p&gt;
&lt;p&gt;&amp;quot;To reload the watchdog counter, the special value 0x6E524635 needs
to be written to all enabled reload registers. One or more RR registers can be individually enabled via the RREN register.&amp;quot;&lt;/p&gt;
&lt;p&gt;So, does this mean that if 3 are enabled, all 3 MUST be loaded with the special value to cause a reload, or is it any of the 3 can be loaded with the special value to cause a reload?&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t say look at the examples, and reverse engineer the intent, because I can&amp;#39;t find any.&lt;/p&gt;
&lt;p&gt;Again, the problem here is that the documentation is reference only, with some ambiguity. What is missing is any explanation of why there are 8 reload registers, and how the chip architects expected them to be used.&lt;/p&gt;
&lt;p&gt;I bet these RR registers get cleared when the reload occurs, but the documentation does not say that. In fact given the current documentation, it could be interpreted as once the RR have the special value loaded, the reload operation just keeps occurring, which I know is silly. A well explained tutorial on the WDT and how it is expected to be used, especially the multiple RR registers would resolve this.&lt;/p&gt;
&lt;p&gt;Bug report for DevZone: After posting a message that includes formatting such as BOLD or Italics, if you then edit the message, the formatting is lost. See your messge to me where the Italic formatting was lost and now just shows as the tags.&lt;/p&gt;
&lt;p&gt;I hope you understand I am not being critical, but rather highlighting an opportunity to better inform customers of how these chips operate and how best to to program them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1100?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 11:05:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9551086-a389-4fae-b461-de4ccbe312d2</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Thanks for you feedback, Philip.
We&amp;#39;re always trying to improve. Having understandable and informative examples and documentation is considered important for us.&lt;/p&gt;
&lt;p&gt;That being said, there are fairly high-level descriptions of the PPI system and the different peripherals in the Reference Manual. Especially section 9.1 (Peripheral interface functional description) gives an overview of the peripherals and how PPI connects them.
There&amp;#39;s a functional description section for each peripheral in the reference manual. Snippet from WDT description (section 19.1.1):
&amp;quot;[i]The watchdog has 8 separate reload request registers which shall be used to request the watchdog to reload
its counter with the value specified in the CRV register. To reload the watchdog counter, the special value
0x6E524635 needs to be written to all enabled reload registers. One or more RR registers can be individually
enabled via the RREN register[/i]&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1099?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 11:04:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87043733-6786-4c47-a102-d6417f07bba8</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Thanks for you feedback, Nils.
We&amp;#39;re always trying to improve. Having understandable and informative examples and documentation is considered important for us.&lt;/p&gt;
&lt;p&gt;That being said, there are fairly high-level descriptions of the PPI system and the different peripherals in the Reference Manual. Especially section 9.1 (Peripheral interface functional description) gives an overview of the peripherals and how PPI connects them.
There&amp;#39;s a functional description section for each peripheral in the reference manual. Snippet from WDT description (section 19.1.1):
&amp;quot;[i]The watchdog has 8 separate reload request registers which shall be used to request the watchdog to reload
its counter with the value specified in the CRV register. To reload the watchdog counter, the special value
0x6E524635 needs to be written to all enabled reload registers. One or more RR registers can be individually
enabled via the RREN register[/i]&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1098?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 07:33:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7eb39a6b-74b0-4a50-9fa7-f39fd4d3697f</guid><dc:creator>Philip Freidin</dc:creator><description>&lt;p&gt;Hi Nils, (and Håkon)&lt;/p&gt;
&lt;p&gt;I agree about the documentation, especially about the GPIOTE, PPI,
Tasks and Events is insufficient. The problem is that it is reference
material only.&lt;/p&gt;
&lt;p&gt;The example code helps, but because of complexity, it is not clear
what is specific to a function (such as PPI) and what is required
because of the example application. No explanation of why functions
are used the way they are is given in the examples.&lt;/p&gt;
&lt;p&gt;What is really needed is a tutorial document with a detailed discussion
of how these things work, and how the resources should be used.
The situation with the PPI is particularly bad, because I think it is
unique to the nRF51 products.&lt;/p&gt;
&lt;p&gt;Another section in desperate need of an explanation and rationale
is the WDT registers RR0..7.&lt;/p&gt;
&lt;p&gt;Hey, Håkon , if you guys want to write a tutorial on these functions,
I would be delighted to proof read them from the point of view of
an end user/developer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1091?ContentTypeID=1</link><pubDate>Thu, 01 Aug 2013 07:17:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35e9e4af-9f90-427c-a09f-f9a3f4617a31</guid><dc:creator>Philip Freidin</dc:creator><description>&lt;p&gt;Hi Nils,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have any sample code of the round robin scheduler
that I can share.&lt;/p&gt;
&lt;p&gt;But I have attached my code for setting up RTC1 for a 1ms
interrupt, with two 32 bit counters for milliseconds and seconds
since the &amp;quot;beginning of time&amp;quot; .&lt;/p&gt;
&lt;p&gt;To build the scheduler, you would add the timer_variables and
bool stuff after line 73.&lt;/p&gt;
&lt;p&gt;You can use either of the two 32 bit counters to do some
other neat things in your code, like this:&lt;/p&gt;
&lt;p&gt;[b]    temp = RTC1_Milliseconds;
while(RTC1_Milliseconds &amp;lt; (temp+37)) {}   // wait here for 37 ms&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;temp = RTC1_Seconds;
{
    // lots of stuff goes in here that takes a long time to execute
}
printf(&amp;quot;Execution time in seconds:  %6d\n&amp;quot;, RTC1_Seconds - temp);[/b]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The example code supplied refers to one of my header files,
which must also be included in routines that use this stuff.
the only relevant lines to this example in the header are:&lt;/p&gt;
&lt;p&gt;[b]extern uint32_t  RTC1_Milliseconds;
extern uint32_t  RTC1_Seconds;
[/b]&lt;/p&gt;
&lt;p&gt;Enjoy.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/RTC1_5F00_ms_5F00_timer.c"&gt;RTC1_ms_timer.c&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1090?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2013 18:40:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7774d3c1-21f4-412c-aeee-ce6e63b37947</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thank you for your answers, you helped me pretty much with understanding how to use the timers.
Philip do you have any sample Code, i think i will use one timer like you did it.&lt;/p&gt;
&lt;p&gt;I think my biggest problem is understanding how the chips work. I read what gpiote, ppi, tasks and events mean. But i didn&amp;#39;t understand how to use them or how they work together.&lt;/p&gt;
&lt;p&gt;And when i want to programm something like a button i use gpiote but why?&lt;/p&gt;
&lt;p&gt;I think this is preety important for programming the chip, knowing how this works. Maybe you can help me or know some good stuff that i can read.&lt;/p&gt;
&lt;p&gt;best regards Nils :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1089?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2013 14:29:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd934ab0-9f61-4b67-a411-d34daef78ee6</guid><dc:creator>Philip Freidin</dc:creator><description>&lt;p&gt;Hi Nils,&lt;/p&gt;
&lt;p&gt;I often use the following approach as a very simple round-robin
scheduler, with tasks that have to run at different rates.&lt;/p&gt;
&lt;p&gt;I do the following for things that need timers of greater than 1ms.
I set up a timer to generate an interrupt every 1 ms.
I have a uint32_t timer_variable for each of my repetitive tasks.
I have a flag (bool) for each task.&lt;/p&gt;
&lt;p&gt;In the interrupt routine, I increment all the timer_variables, and
test each one to see if it is at its max value, and if it is I set the
bool for that timer_variable (task), and reset the timer_variable.
So I can have some thing happening every 10 ms or 10000ms
or any other repeat duration. The interrupt routine then exits.&lt;/p&gt;
&lt;p&gt;In the main code is a loop forever block that checks the bool
values, and if any are set, the appropriate task is run and the
bool is reset.  Obviously, you need to be careful how long these
routines run, and what the total execution time is.&lt;/p&gt;
&lt;p&gt;One of these timer_variable could be setup to count to 1000
and the task then runs once per second. The task could
implement a clock &amp;amp; calendar.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1088?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2013 07:40:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfafa6d2-c326-4542-8d5d-e7c49d8ad47a</guid><dc:creator>Audun</dc:creator><description>&lt;p&gt;Hi Nils,&lt;/p&gt;
&lt;p&gt;as you say, there are 3 Timers available on the nRF51822. In addition there are 2 RTC&amp;#39;s. The Timers use the 16 MHz clock (HFCLK) , while the RTC&amp;#39;s use the 32 kHz clock (LFCLK).&lt;/p&gt;
&lt;p&gt;When the softdevice is enabled it reserves one Timer and one RTC (in addition to other HW resources). That leaves your application with 2 Timers and 1 RTC. For PWMs you would typically use a Timer, while timekeeping is usually done with an RTC.&lt;/p&gt;
&lt;p&gt;If you have multiple tasks that require millisecond-resolution timing, you can look into the SDK component &lt;em&gt;app_timer&lt;/em&gt;. App_timer uses the RTC and facilitates timed events. For example: you want to read a sensor every 10 ms, do some processing every 100 ms, and then run a 3 second timeout for something.&lt;/p&gt;
&lt;p&gt;To summarize: the Timers are quite generic and can be connected to different peripherals to perform different functions.It&amp;#39;s up to your application to make sure the Timers and RTCs are allocated (and multiplexed if needed) to the different tasks you want to perform.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: comprehension question Timer</title><link>https://devzone.nordicsemi.com/thread/1087?ContentTypeID=1</link><pubDate>Wed, 31 Jul 2013 07:06:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4fe1ba9-3265-494f-aae9-548b5183218f</guid><dc:creator>Nils Minor</dc:creator><description>&lt;p&gt;No one have an idea? :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>