<?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>Timer Prescaler</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9798/timer-prescaler</link><description>I have a problem enabling TIMER1:
If the prescaler is set between 16MHz and 2 MHz the firmware fails to enable the SoftDevice, even if I didn&amp;#39;t manage TIMER0, but TIMER1 which should be dedicated to the softDevice.
Using a lower prescaler instead it</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 28 Oct 2015 20:24:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9798/timer-prescaler" /><item><title>RE: Timer Prescaler</title><link>https://devzone.nordicsemi.com/thread/36316?ContentTypeID=1</link><pubDate>Wed, 28 Oct 2015 20:24:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0fe143fa-63ba-4ad5-a152-b27ba4ac351b</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I did not see anywhere that you have called the function &lt;code&gt;nrf_drv_timer_enable&lt;/code&gt;. Without this the timer has been initialized but never actually started.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer Prescaler</title><link>https://devzone.nordicsemi.com/thread/36315?ContentTypeID=1</link><pubDate>Sun, 25 Oct 2015 12:34:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99d5f132-603e-4447-8267-adc74dc4069e</guid><dc:creator>Lorens</dc:creator><description>&lt;p&gt;I meant that that function didn&amp;#39;t return(I just put a breakpoint at the following instruction, and it never stops).
Now I solved setting the compare at 600, 1200, 1800, 2400, but this lead to another question, is there a lower bound for the compare?
To check the interrupt frequency I toggle a pin every compare event, and even if I should have always the same interrupt distance (because of the equidistant comapare settings) the pin toggle is not always at the same interval (I am using an oscilloscope to check).
Here&amp;#39;s the function code:
switch (event_type){&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	case NRF_TIMER_EVENT_COMPARE0:
			Hw_Interface_SetOutput1();
	
	case NRF_TIMER_EVENT_COMPARE1:
				Hw_Interface_SetOutput();
				
	case NRF_TIMER_EVENT_COMPARE2:
		Hw_Interface_ResetOutput1();

	case NRF_TIMER_EVENT_COMPARE3:
			Hw_Interface_ResetOutput();
	}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Is there something wrong, or any limit I should follow?
Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer Prescaler</title><link>https://devzone.nordicsemi.com/thread/36314?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2015 10:31:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe62d65f-3f3b-48e9-9b3b-6811436786c1</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;LFCLK_XTAL should have nothing to do with TIMERs,&lt;/p&gt;
&lt;p&gt;The define &lt;code&gt;TIMER1_INSTANCE_INDEX&lt;/code&gt; is index to the timer driver member, so 0 is fine if Timer0 is not enabled.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Looking at the behaviour it seems that calling the function: SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, false); it has some problem. While not enabling the timer1 it works correctly&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Can you please explain what &amp;quot;It has problems&amp;quot; mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer Prescaler</title><link>https://devzone.nordicsemi.com/thread/36313?ContentTypeID=1</link><pubDate>Fri, 23 Oct 2015 10:02:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c337327f-b37b-4c9c-b79c-86607ce36745</guid><dc:creator>Lorens</dc:creator><description>&lt;p&gt;Looking at the behaviour it seems that calling the function: SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, false);
it has some problem. While not enabling the timer1 it works correctly. The defines are the ones provided by Nordic SDK, the define
#define TIMER1_INSTANCE_INDEX      (TIMER0_ENABLED)
is 0 because there is no TIMER0 enabled&lt;/p&gt;
&lt;p&gt;If there are any other things you need to clarify the situation just ask.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer Prescaler</title><link>https://devzone.nordicsemi.com/thread/36312?ContentTypeID=1</link><pubDate>Thu, 22 Oct 2015 07:32:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1b9555b6-1016-4fae-8d2e-954589e85a79</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You code looks correct (except that i cannot see values of some defines)
What is the symptoms you are seeing? is your handler not triggering correctly with softdevice? You description in the question was not so clear about the problem&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer Prescaler</title><link>https://devzone.nordicsemi.com/thread/36311?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2015 14:41:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:feda3a31-c14e-48ca-94fd-e21e55134fdf</guid><dc:creator>Lorens</dc:creator><description>&lt;p&gt;I use Timer1, for the reason you mentioned.&lt;/p&gt;
&lt;p&gt;Here some parts of the Code:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define TIMER1_ENABLED 1

#if (TIMER1_ENABLED == 1)
#define TIMER1_CONFIG_FREQUENCY    NRF_TIMER_FREQ_1MHz
#define TIMER1_CONFIG_MODE         TIMER_MODE_MODE_Timer
#define TIMER1_CONFIG_BIT_WIDTH    TIMER_BITMODE_BITMODE_16Bit
#define TIMER1_CONFIG_IRQ_PRIORITY APP_IRQ_PRIORITY_HIGH

#define TIMER1_INSTANCE_INDEX      (TIMER0_ENABLED)
#endif
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here the initialization:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    Timer_DRV.p_reg 			= NRF_TIMER1;
Timer_DRV.irq					= TIMER1_IRQn;
Timer_DRV.instance_id = TIMER1_INSTANCE_INDEX;

Timer_DRV_Conf.frequency					= TIMER1_CONFIG_FREQUENCY;
Timer_DRV_Conf.mode								= TIMER1_CONFIG_MODE;
Timer_DRV_Conf.bit_width					= TIMER1_CONFIG_BIT_WIDTH;
Timer_DRV_Conf.interrupt_priority	= TIMER1_CONFIG_IRQ_PRIORITY;
Timer_DRV_Conf.p_context					= timer_struct;

nrf_drv_timer_init(&amp;amp;Timer_DRV,
                          &amp;amp;Timer_DRV_Conf,
                          timer_clk_handler);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And then configuration interrupt:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;            nrf_drv_timer_compare(&amp;amp;Timer_DRV, NRF_TIMER_CC_CHANNEL0, 60, true);
	nrf_drv_timer_compare(&amp;amp;Timer_DRV, NRF_TIMER_CC_CHANNEL1, 120, true);
	nrf_drv_timer_compare(&amp;amp;Timer_DRV, NRF_TIMER_CC_CHANNEL2, 180, true);
	nrf_drv_timer_extended_compare(&amp;amp;Timer_DRV, NRF_TIMER_CC_CHANNEL3, 240, NRF_TIMER_SHORT_COMPARE3_CLEAR_MASK,
                                    true);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Thank you&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer Prescaler</title><link>https://devzone.nordicsemi.com/thread/36310?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2015 14:39:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2f7841a-47c9-44c7-9acb-24e2815097d6</guid><dc:creator>Lorens</dc:creator><description>&lt;p&gt;Here there are a few character so I use an answer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timer Prescaler</title><link>https://devzone.nordicsemi.com/thread/36309?ContentTypeID=1</link><pubDate>Wed, 21 Oct 2015 11:30:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87c2cc35-7e27-4d27-a317-49a3efe1fcab</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Which timer did you use , Timer0 or Timer1? Timer0 is restricted and is used by softdevice. Applications cannot use it (unless you are using Timeslot API)&lt;/p&gt;
&lt;p&gt;can you put some code snippets for us to see what you are trying to do and what you want to achieve?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>