<?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>nrfx timer - How to set a timer prescaler?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60419/nrfx-timer---how-to-set-a-timer-prescaler</link><description>A simple question - if using the nrfx timer library how do I set a timer prescaler? 
 I&amp;#39;m using timers 3 &amp;amp; 4 in compare/capture mode to measure pulse widths (not the application timer)</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Apr 2020 14:51:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60419/nrfx-timer---how-to-set-a-timer-prescaler" /><item><title>RE: nrfx timer - How to set a timer prescaler?</title><link>https://devzone.nordicsemi.com/thread/245611?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 14:51:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd21ce3b-a964-43b0-b212-44d8f065fabc</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;The legacy API configs will overwrite NRFX configs in apply_old_config.h if the legacy config is&amp;nbsp;&lt;em&gt;&lt;strong&gt;defined&lt;/strong&gt;&lt;/em&gt;, regardless of if it is set or not. You need to completely remove the legacy configs from the sdk_config.h file in order for the NRFX configs to not be overwritten.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfx timer - How to set a timer prescaler?</title><link>https://devzone.nordicsemi.com/thread/245595?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 14:15:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:991e3960-fc0f-4579-9394-a4ba2634bcc4</guid><dc:creator>Nick_RA</dc:creator><description>&lt;p&gt;OK thanks.&lt;/p&gt;
&lt;p&gt;Trying to use the nrfx driver is really giving me a headache! For some reason my code only compiles if I have both TIMER_ENABLED and NRFX_TIMER_ENABLED in sdk_config.h&amp;nbsp; at the same time, which directly&amp;nbsp; contradicts the advice I&amp;#39;ve found on the devzone&amp;nbsp;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/33349/upgrade-to-the-nrfx-api-sdk-v15"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is the code&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  nrfx_timer_config_t t4_cfg      = NRFX_TIMER_DEFAULT_CONFIG;
  t4_cfg.frequency                = NRF_TIMER_FREQ_8MHz;
  t4_cfg.bit_width                = NRF_TIMER_BIT_WIDTH_32;
  err_code = nrfx_timer_init(&amp;amp;m_t4, &amp;amp;t4_cfg, timer4_handler);
  nrfx_timer_compare(&amp;amp;m_t4,NRF_TIMER_CC_CHANNEL0,PULSE1_MIN,true);
  nrfx_timer_compare(&amp;amp;m_t4,NRF_TIMER_CC_CHANNEL1,PULSE1_MAX,true);
  nrfx_timer_compare(&amp;amp;m_t4,NRF_TIMER_CC_CHANNEL2,PULSE2_MIN,true);
  nrfx_timer_compare(&amp;amp;m_t4,NRF_TIMER_CC_CHANNEL3,PULSE2_MAX,true);
  nrfx_timer_clear(&amp;amp;m_t4);
  nrfx_timer_enable(&amp;amp;m_t4);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;ant the failures are&lt;/p&gt;
&lt;p&gt;undefined reference to `nrfx_timer_init&amp;#39;&lt;br /&gt;undefined reference to `nrfx_timer_compare&amp;#39;&lt;br /&gt;undefined reference to `nrfx_timer_compare&amp;#39;&lt;br /&gt;undefined reference to `nrfx_timer_compare&amp;#39;&lt;br /&gt;&amp;nbsp;undefined reference to `nrfx_timer_compare&amp;#39;&lt;br /&gt;undefined reference to `nrfx_timer_clear&amp;#39;&lt;br /&gt;undefined reference to `nrfx_timer_enable&amp;#39;&lt;br /&gt;undefined reference to `nrfx_timer_init&amp;#39;&lt;/p&gt;
&lt;p&gt;In fact the code compiles if&amp;nbsp;&lt;span&gt;TIMER_ENABLED is set, irrespective of&amp;nbsp;NRFX_TIMER_ENABLED&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Any ideas?&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrfx timer - How to set a timer prescaler?</title><link>https://devzone.nordicsemi.com/thread/245526?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2020 12:31:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e02521e-62b9-49d0-8968-fef4e8e926de</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The prescaler is set by the &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.8.0/drivers/include/nrfx_timer.h#L91"&gt;frequency parameter&lt;/a&gt; in the config that you pass to nrfx_timer_init(). I should be set to one of the frequnecies defined in &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.8.0/hal/nrf_timer.h#L192"&gt;nrf_timer_frequency_t&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;PRESCALER register is set by the HAL function &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.8.0/hal/nrf_timer.h#L633"&gt;nrf_timer_frequency_set&lt;/a&gt;&lt;span&gt;(), which is called &lt;a href="https://github.com/NordicSemiconductor/nrfx/blob/v1.8.0/drivers/src/nrfx_timer.c#L106"&gt;in&amp;nbsp;nrfx_timer_init&lt;/a&gt;().&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;br /&gt;Jørgen&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>