<?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>ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27167/adc-conversion-using-4096hz-for-nrf52832-chip</link><description>Hello Sir, 
 We are using nRF52832 chip and Softdevice is S132. Is it possible to sample an analog signal using internal ADC conversion using 4096Hz?. Its look like it does at 3900Hz. 
 Thanks in Advance..</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 24 Nov 2017 12:27:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27167/adc-conversion-using-4096hz-for-nrf52832-chip" /><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107014?ContentTypeID=1</link><pubDate>Fri, 24 Nov 2017 12:27:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f57d979-49b6-49ef-87f1-cbea3fcbaa20</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You might need to get some better equipment than a multimeter for doing presice measurements of these quickly switching currents. I would recommend the &lt;a href="http://www.nordicsemi.com/eng/Products/Power-Profiler-Kit"&gt;Power Profiler Kit&lt;/a&gt;. I did some measurements on the &lt;em&gt;ble_app_uart__saadc_timer_driven__scan_mode&lt;/em&gt; code with timer and RTC, and did not see large differences in current (&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/current_5F00_ble_5F00_saadc_5F00_timer.png"&gt;TIMER&lt;/a&gt; - &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/current_5F00_ble_5F00_saadc_5F00_rtc.png"&gt;RTC&lt;/a&gt;). The timer in the example runs on PCLK1M, which gives the timer a run current of 5 µA typical + HFINT Clock run current of 60 µA. The &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/rtc.html?cp=2_1_0_24_10#unique_171864873"&gt;run current of RTC&lt;/a&gt; is 0.1 µA typical, pluss &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/clock.html?cp=2_1_0_18_3_2#unique_937965404"&gt;run current of LFCLK&lt;/a&gt; of 0.25-1 µA. There are some differences here, but compared to the total consumption of the application, this is not the part you should be concerned about. The ~2mA base current of the consumption comes from the EasyDMA current. You should consider if you need such a high sample frequency in your application, or if you could lower this and shut down the SAADC between sampling. This will save you much current.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107013?ContentTypeID=1</link><pubDate>Fri, 24 Nov 2017 10:23:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdd1a68c-cb66-42bc-91c0-93b37524b20b</guid><dc:creator>vishal</dc:creator><description>&lt;p&gt;I measure the current using multi meter which is connected serial of positive power supply. I measure 5.78mA current during advertising only when i reading ADC value at that it goes to 6-7mA with BLE connectivity in android apps. In new RTC code i am not set sampling rate only set frequency and CC value is 32768 and 8. So sir Can you guide me how i can reduce this high current consumption because my device is operate on AA battery cell. For long battery life is important for me. In my new RTC program where i need to define sampling rate, and also How i can control EasyDMA for less current consumption. You saying are upload my main program.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107015?ContentTypeID=1</link><pubDate>Fri, 24 Nov 2017 09:41:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:946d204c-644b-452c-b141-ea8ef9c9ccc3</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;How do you measure the current? If 5 mA is your average current consumption with only advertising, this seems quite high. switching to RTC for sampling should not increase your current consumption. Do you have approximately the same sample rate with both setups? The EasyDMA current (~2mA) enabled with the SAADC could be limited by disabling the SAADC between samples, as shown in the low power SAADC example, but with your samplerate, you might not gain much on this either. Could you upload your applications for debugging?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107012?ContentTypeID=1</link><pubDate>Thu, 23 Nov 2017 10:39:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84d9f209-a269-41f0-a9b4-27ef5d229c12</guid><dc:creator>vishal</dc:creator><description>&lt;p&gt;Thanks you so much Jorgen,
Now my program is working as per you refer me, But problem is current consumption. In my old program using Timer peripheral ADC the current consumption is 5mA with BLE advertising. But now when i implement my code into RTC over PPI current consumption is 5.78mA. If i use RTC the current consumption it will reduce because RTC is low power consumption instead of timer. Can you tell why current consumption increase in my device. My device is operate on battery so to reduce current consumption is important for me.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107011?ContentTypeID=1</link><pubDate>Thu, 23 Nov 2017 08:45:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15528b2e-76e2-48eb-bb40-003a4cb5accd</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I don&amp;#39;t know how you have setup RTC, but you should make sure you do not enable interrupt if you want to trigger the sampling through PPI. You also need to clear the RTC after getting the compare event. This can also be &lt;a href="https://devzone.nordicsemi.com/question/111930/is-it-possible-to-trigger-saadc-by-ppi-between-rtc-compare-event-and-saadc-sample-task/"&gt;done using PPI&lt;/a&gt;. I will edit my answer above with a working main.c file for ble_app_uart__saadc_timer_driven__scan_mode that implement sampling using RTC over PPI. Note that you need to include the nrf_drv_rtc.c source file, and enable RTC in &lt;em&gt;sdk_config.h&lt;/em&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107009?ContentTypeID=1</link><pubDate>Thu, 23 Nov 2017 06:20:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b303a526-b3a8-44a7-8343-28dc1b0a6dd6</guid><dc:creator>vishal</dc:creator><description>&lt;p&gt;Thanks Jorgen,
As per you told me i changed the function is&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t timer_compare_event_addr = rf_drv_rtc_event_address_get(&amp;amp;rtc,NRF_RTC_EVENT_COMPARE_0);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;it give error for &lt;code&gt;&amp;amp;m_timer&lt;/code&gt; unresolve So i uncomment in my code is&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static const nrf_drv_timer_t   m_timer = NRF_DRV_TIMER_INSTANCE(3); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but it for timer peripheral.  NRF_Timer frequency as sampling rate but this all parameter is use for timer peripheral is it write. What should i do for other parameter like NRF timer frequency sampling rate etc. If i set same as it is and sampling rate set is 125ms. Then i have test this function but it consume lots power it near about 5.56mA while BLE broadcasting. When transmitting adc value to android app at that time peak current is 7.2mA. Why this more power consume?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107010?ContentTypeID=1</link><pubDate>Wed, 22 Nov 2017 15:39:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd733986-8f55-4961-8cd9-ca65d15daa30</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;PPI sampling with RTC is setup very similar to PPI sampling with TIMER, if you use the drivers in the SDK. You only need to &lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples/blob/master/ble_app_uart__saadc_timer_driven__scan_mode/main.c#L732"&gt;change the function&lt;/a&gt; that get the address of the compare event from timer, into the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/group__nrf__drv__rtc.html?cp=4_0_0_6_9_19_1_14#gaf090934b73fde208dfefc84c713418bb"&gt;funtion that get the compare event from RTC&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;uint32_t timer_compare_event_addr = nrf_drv_rtc_event_address_get(&amp;amp;rtc,NRF_RTC_EVENT_COMPARE_0);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107008?ContentTypeID=1</link><pubDate>Wed, 22 Nov 2017 12:51:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eeb61303-6c82-488e-80bf-edcd7b3e9985</guid><dc:creator>vishal</dc:creator><description>&lt;p&gt;Hi sir, Can you tell me how i trigger sample though ppi on RTC. In my last program i am triggering sample through PPI on Timer peripheral. Where i need to changes in saadc_sampling_event_init(void) function for controlling PPI on RTC.
Thanks......&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107007?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 15:02:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed74e8bd-89ed-47df-85f8-592fdbf44687</guid><dc:creator>vishal</dc:creator><description>&lt;p&gt;I check in my sdk_config.h RTC0 is not enable RTC2 is enabled, now when i remove lfclk_config(void) function device is advertising and also connect with my phone. But when i sent command for start saadc my ADC value is not received in my apps, means no any data sent from nordic to UART. As per you refer me this above example in this no any PPI channel use. Can you tell me how i trigger PPI on RTC. In my code i use saadc_sampling_event_enable(); in main. my application is read 3-axis accelerator analog value one by one channel.  Thanks sir......&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107005?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 12:28:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3eba1a81-7dbc-4ac4-8ab2-30907372d615</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Make sure you are not using RTC0, as this is used by the softdevice. You can chose which RTC is enabled in &lt;em&gt;sdk_config.h&lt;/em&gt;. You do not need to initialize the lfclock when using the softdevice, as the softdevice already handles this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107004?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 12:00:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edd93cb3-6d78-4c10-989c-ac1965450cb4</guid><dc:creator>vishal</dc:creator><description>&lt;p&gt;Yes i debugging my code and it return error code is 133 can you tell me what is meaning of this error code. This error is in static void lfclk_config(void) function. I am using sdk 13.1 and soft device is S132 for nRF52832 using eclipse IDE. can you suggest me what should i do..
Thanks...for your quick reply.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107006?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 11:47:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec52c5bb-e05f-4eaa-96d8-8546718adbdf</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Are you using the correct softdevice/SDK version for the example? Have you tried &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;debugging&lt;/a&gt;, to see if any function calls return error codes?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107003?ContentTypeID=1</link><pubDate>Tue, 21 Nov 2017 09:50:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83e77cb3-4505-46de-8aca-ceac121e7303</guid><dc:creator>vishal</dc:creator><description>&lt;p&gt;Thanks sir for you valuable suggestion..
I changes in my program as per the given in above example using RTC. but now problem coming is when i upload this new program my board is not advertising. So i am unable to connect. I am using &lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples/tree/master/ble_app_uart__saadc_timer_driven__scan_mode"&gt;ble_app_uart__saadc_timer_driven__scan_mode&lt;/a&gt; this example. Can you tell me    where exactly i need to change for RTC.
Thanks....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107002?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 14:15:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41cbbdd5-d5b9-4f89-8ace-098d4b7ee3f4</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You are not using RTC in that code, you are using TIMER peripheral. Please have a look at &lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples/tree/master/saadc_low_power"&gt;this example&lt;/a&gt; on how to use RTC and PPI for triggering SAADC sampling. If you set the symbol &lt;code&gt;RTC_FREQUENCY&lt;/code&gt; in &lt;em&gt;main.c&lt;/em&gt; to 32768, the example should sample at 4096 Hz. Note that you should increase the calibration interval, or disable calibration for such a high sample rate.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107001?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 13:34:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c75e6f22-ce58-4ce1-94cb-3b18fdbbeef4</guid><dc:creator>vishal</dc:creator><description>&lt;p&gt;Please sir tell me what should i do for achieving 4096Hz sampling frequency. you told me set CC value is 8, but my cc value is microsecond you said me this value is millisecond or other.&lt;/p&gt;
&lt;p&gt;Thanks for your suggestion.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/107000?ContentTypeID=1</link><pubDate>Tue, 14 Nov 2017 13:30:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36d6545a-d1da-4f01-900c-c5ca36abcef0</guid><dc:creator>vishal</dc:creator><description>&lt;p&gt;Hi sir,
I trigger sample through PPI on an RTC, but it achieved 3900Hz. The following have my program function in saadc sampling event init:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;nrf_drv_timer_config_t timer_config = NRF_DRV_TIMER_DEFAULT_CONFIG;
timer_config.frequency = NRF_TIMER_FREQ_31250Hz;
err_code = nrf_drv_timer_init(&amp;amp;m_timer, &amp;amp;timer_config, timer_handler);
APP_ERROR_CHECK(err_code);
/* setup m_timer for compare event */
uint32_t ticks = nrf_drv_timer_us_to_ticks(&amp;amp;m_timer,SAADC_SAMPLE_RATE);
nrf_drv_timer_extended_compare(&amp;amp;m_timer, NRF_TIMER_CC_CHANNEL0, ticks, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK, false);
nrf_drv_timer_enable(&amp;amp;m_timer);

uint32_t timer_compare_event_addr = nrf_drv_timer_compare_event_address_get(&amp;amp;m_timer, NRF_TIMER_CC_CHANNEL0);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and in this function CC value is as per the following:
Sampling Rate = 256us&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;m_timer = NRF_DRV_TIMER_INSTANCE(3);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC Conversion using 4096Hz for nRF52832 Chip?</title><link>https://devzone.nordicsemi.com/thread/106999?ContentTypeID=1</link><pubDate>Tue, 10 Oct 2017 08:33:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63ade33b-2ef5-41d6-9c98-683d84a64b66</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you trigger sampling through &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/ppi.html?cp=2_1_0_21#concept_sxf_21l_1s"&gt;PPI&lt;/a&gt; on an &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/rtc.html?cp=2_1_0_24#concept_rvn_vkj_sr"&gt;RTC&lt;/a&gt; event, it should be possible to achieve 4096 Hz. The RTC runs at 32.768 kHz, and a CC value of 8 should give you your desired frequency. If you are triggering sampling from interrupt event, the softdevice might delay sampling if higher priority events occurs, giving you a lower sample rate than expected.&lt;/p&gt;
&lt;p&gt;Note &lt;a href="https://devzone.nordicsemi.com/question/119588/offset-in-saadc-samples-with-easy-dma-and-ble/?answer=166673#post-id-166673"&gt;this issue&lt;/a&gt; if you are triggering sampling through PPI, and have multiple SAADC channels enabled.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[EDIT]:&lt;/strong&gt; Added &lt;em&gt;main.c&lt;/em&gt; file that implements sampling triggered by RTC over PPI in &lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples/tree/master/ble_app_uart__saadc_timer_driven__scan_mode"&gt;ble_app_uart__saadc_timer_driven__scan_mode&lt;/a&gt; example: &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2772.main.c"&gt;main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>