<?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>nRF52 timer has no modulus?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18222/nrf52-timer-has-no-modulus</link><description>I&amp;#39;m learning about the nRF52 series and so far love everything I see, especially the SDK. But I just got to the point where I&amp;#39;d like to generate precisely timed output, and there is something I don&amp;#39;t understand: the nRF52832 timer seems to have no modulus</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 09 Dec 2016 10:33:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18222/nrf52-timer-has-no-modulus" /><item><title>RE: nRF52 timer has no modulus?</title><link>https://devzone.nordicsemi.com/thread/70347?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2016 10:33:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:314a8bc4-5a5a-424c-8f05-134683ba808b</guid><dc:creator>Jan Rychter</dc:creator><description>&lt;p&gt;Yes! Thank you — this seems to be what I was missing. While reading the specs I thought to myself: there is no way they could have designed an otherwise great chip with such a limitation.&lt;/p&gt;
&lt;p&gt;I will have to figure out how exactly this clearing works out cycle-wise, but I&amp;#39;m very glad it&amp;#39;s there. And yes, for PWM I will definitely use the PWM modules, I just used it as an example. At the moment I actually need specific timer periods.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF52 timer has no modulus?</title><link>https://devzone.nordicsemi.com/thread/70346?ContentTypeID=1</link><pubDate>Fri, 09 Dec 2016 09:11:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ecffeca-0686-4ae7-a73a-843266caf204</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Jan&lt;/p&gt;
&lt;p&gt;What you are probably missing is the SHORTS register, which allows you to enable a shortcut between any of the compare events and the clear task. With this enabled you can assign one of the CC registers to act as a reload register, and have the timer reset every time the value in the CC register is reached.&lt;/p&gt;
&lt;p&gt;Codewise it would look something like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_TIMER0-&amp;gt;CC[3] = 1000;   
NRF_TIMER0-&amp;gt;SHORTS = TIMER_SHORTS_COMPARE3_CLEAR_Msk;   
NRF_TIMER0-&amp;gt;TASKS_START = 1;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As a side note, if what you need is PWM I would recommend using the dedicated PWM modules. They can also be configured with an arbitrary reload value, in the range 2-(2^15), and allow you to update the duty cycle directly from a RAM buffer without requiring MCU interaction.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>