<?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>NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69970/nrf52840-when-using-timer-and-ble-services-i-found-a-problem</link><description>when using the TIMER, I set the TIMER&amp;#39;s time_ticks=53328 which means that every 3.33ms, the TIMER will call its callback function and start ADC sample. However, when I use BLE services and TIMER at the same time, I found that ADC cannot be triggered every</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 07 Jan 2021 12:49:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69970/nrf52840-when-using-timer-and-ble-services-i-found-a-problem" /><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287955?ContentTypeID=1</link><pubDate>Thu, 07 Jan 2021 12:49:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eacb45c9-b358-4bdc-99af-e99ef7173232</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;and then I create a timer in the SDK&amp;#39;s example ble_template with the same period. when the ble connected,&amp;nbsp; the timer will control the LED toggle in 300HZ. I also found that the period of timer is not accurate and still has error occasionally, So that&amp;#39;s why I doubt the BLE will affect the timer&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287951?ContentTypeID=1</link><pubDate>Thu, 07 Jan 2021 12:42:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:446bbf17-ca00-42d0-af50-6a4954f21b06</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;Yes I didn&amp;#39;t start or stop the timer anywhere else, and i build a project use timer and saadc only without ble, the problem was gone so I wonder how often the ble will affect the timer. every period when timer started or just affect it ocassionally.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287941?ContentTypeID=1</link><pubDate>Thu, 07 Jan 2021 12:27:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf3b4a1f-772c-4094-a10e-72aab0b3dcca</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The BLE can affect the timing, but not by 10ms, the difference is more like ~100us.&lt;/p&gt;
&lt;p&gt;The code you refer to disable and enable the timer, you are not starting or stopping the timer somewhere also?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287821?ContentTypeID=1</link><pubDate>Thu, 07 Jan 2021 01:51:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2c0f3122-9985-4e78-bb99-5a5ed9775472</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;I comment out the places that I start the timer by accident, but the timer still varies occasionally&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1040.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1041.JPG" /&gt;.&lt;/p&gt;
&lt;p&gt;and I found that when I didn&amp;#39;t start the ble and use the timer only, the timer wouldn&amp;#39;t vary. However, when I start the ble and then open the timer, it will wary occasionally. So I thought that whether the ble will affect the timer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287688?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2021 11:06:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91ab1c08-8c8b-4092-bc8e-40eb34cd5d35</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I would double check that you don&amp;#39;t by accident stop/start the timer here somewhere in your code, for instance for test you can comment out all places where stop/start are done today.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287608?ContentTypeID=1</link><pubDate>Wed, 06 Jan 2021 01:20:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee301b2f-fc1a-4f9e-8855-7f492ad64aa6</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;it varies and the next period will be 320ms, it just occasionally turns to 330ms. I stop or start the timer when ble disconnected or connected.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1033.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1034.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1035.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1036.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1037.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;it&amp;#39;s random and I found that when only enable the timer and saadc and don&amp;#39;t use the ble the timer goes fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287558?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2021 15:19:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9bb0cf83-9878-4f10-a16e-a24268dfb237</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;This was quite a big delay (320ms-&amp;gt;330ms), is it consistently +10ms (330ms) when it occurs or does it vary? Also, what is the next period (310ms or 320ms)?&lt;/p&gt;
&lt;p&gt;Are you sure you are not START or STOP timer somewhere in your code?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287395?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2021 06:44:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:434abba7-086a-458c-af37-a42f31eecab6</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;I mean that the sample time I need is 320ms and it will be triggered by a hardware timer to ensure its accuracy. However, when I don&amp;#39;t change its frequency, It sometimes goes to 330ms which may affect the number of packs I receiving from ble sent to my PC device and that is my problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287387?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2021 06:01:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca17ac29-78fd-4649-8b01-660acca64ee5</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;Almost the ble case with softdevice. The examples are applied the RTC1 timer for timer handling ( Because SD occupied RTC0). I re-command that you may refer the time handling example.&lt;/p&gt;
&lt;p&gt;app_timer2.c&amp;nbsp;&lt;/p&gt;
&lt;p&gt;app_timer_init(()&lt;/p&gt;
&lt;p&gt;app_timer_create()&lt;/p&gt;
&lt;p&gt;app_timer_start()&lt;/p&gt;
&lt;p&gt;app_timer_stop()&lt;/p&gt;
&lt;p&gt;or the app_buton.c&amp;nbsp; button timer handling method that can fix your problems.&lt;/p&gt;
&lt;p&gt;But I doubt that if the ADC sampling timer is more longer. Why the value&amp;nbsp;&lt;span&gt;accuracy is bad?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287366?ContentTypeID=1</link><pubDate>Tue, 05 Jan 2021 02:09:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9ad59b6-08e2-41b4-9321-736499f71655</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;I mean that I put this function after the softdevice enabled but the problem about saadc sample time is still there&lt;span&gt;. I test the period of the saadc sample and it should be 320ms, while when using the ble services it will jump to 330ms ocassionally.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1024.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1023.JPG" /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/IMG_5F00_1022.JPG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287183?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 10:39:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc0ed971-9866-4ac4-a5bd-28452d55d921</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I am not sure what you mean by it doesn&amp;#39;t work. Does the&amp;nbsp;&lt;span&gt;sd_clock_hfclk_request() return an error? Are you calling this function after softdevice is enabled or are you not using a softdevice?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/287117?ContentTypeID=1</link><pubDate>Mon, 04 Jan 2021 05:32:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f28afa8-dd34-4cdf-bef2-956633e82679</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;it doesn&amp;#39;t work&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/286951?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2020 09:20:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6dc41f5b-426a-4bd0-996f-7f67e1e3a9c4</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;I have not used this function, should I add it to the main?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/286950?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2020 09:16:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7f1b591-6d23-40b8-a1e2-9be45e4c7d4e</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Have you also started the external hfclk by calling &lt;span&gt;sd_clock_hfclk_request()&lt;/span&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/286941?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2020 08:54:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a115fad-94a3-4384-859c-c5bb75e8f915</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;and start TIMER in the&amp;nbsp;ble_evt_handler function&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/286940?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2020 08:49:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed353c00-eb88-4810-b2a6-1551b893c4ba</guid><dc:creator>zk12312</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void saadc_sampling_event_init(void)
{
	  ret_code_t err_code;
	 // uint32_t time_ticks=53028;	
    uint32_t time_ticks=53672;//3.33ms tick=53328 TIME3=16MHZ,1ms tick=16000	
	
    err_code = nrf_drv_ppi_init();
    APP_ERROR_CHECK(err_code);
	  	
    nrf_drv_timer_config_t timer_cfg = NRF_DRV_TIMER_DEFAULT_CONFIG;
	  
    err_code = nrfx_timer_init(&amp;amp;TIMER_ADC, &amp;amp;timer_cfg, timer_adc_event_handler);
    APP_ERROR_CHECK(err_code);
   
    nrf_drv_timer_extended_compare(&amp;amp;TIMER_ADC, NRF_TIMER_CC_CHANNEL3, time_ticks, NRF_TIMER_SHORT_COMPARE3_CLEAR_MASK, true);
	   uint32_t timer_compare_event_addr = nrf_drv_timer_compare_event_address_get(&amp;amp;TIMER_ADC,
                                                                                NRF_TIMER_CC_CHANNEL3);
	
    uint32_t saadc_sample_task_addr   = nrf_drv_saadc_sample_task_get();
    err_code = nrf_drv_ppi_channel_alloc(&amp;amp;m_ppi_channel);
    APP_ERROR_CHECK(err_code);
	
	  err_code = nrf_drv_ppi_channel_assign(m_ppi_channel,
                                          timer_compare_event_addr,
                                          saadc_sample_task_addr);
																					
		APP_ERROR_CHECK(err_code);	 																		
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;this is my code about Timer and ppi init&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF52840 when using Timer and BLE services  I found a problem</title><link>https://devzone.nordicsemi.com/thread/286902?ContentTypeID=1</link><pubDate>Wed, 30 Dec 2020 02:31:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f7df712a-933f-43a3-92ad-a3cddc0fdfce</guid><dc:creator>Henry_Chou</dc:creator><description>&lt;p&gt;May you show your create timer ,start timer ,stop timer &amp;amp; timer callback handler procedure?&lt;/p&gt;
&lt;p&gt;Have you ever trigger timer with repeat mode?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>