<?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>Sampling ADC with PPI and Timer on nrf connect sdk</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/115914/sampling-adc-with-ppi-and-timer-on-nrf-connect-sdk</link><description>Description : I’m working on an nRF52 project where I need the SAADC to sample at a specified interval (5000 ms in this example) using a timer and PPI to trigger sampling. However, I’m observing that the sampling does not follow the timer’s rate, the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Oct 2024 19:51:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/115914/sampling-adc-with-ppi-and-timer-on-nrf-connect-sdk" /><item><title>RE: Sampling ADC with PPI and Timer on nrf connect sdk</title><link>https://devzone.nordicsemi.com/thread/508439?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2024 19:51:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:94642882-2a4f-42d5-a1b0-d614d1ea4407</guid><dc:creator>Jay99</dc:creator><description>&lt;p&gt;Figured it out, a silly mistake on my part, the default timer width is 16 bit, adding this line solved the problem.&lt;pre class="ui-code" data-mode="text"&gt;timer_config.bit_width = NRF_TIMER_BIT_WIDTH_32;&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sampling ADC with PPI and Timer on nrf connect sdk</title><link>https://devzone.nordicsemi.com/thread/508437?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2024 19:29:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:555c1e03-47ac-440a-b696-a3272eb612b4</guid><dc:creator>Jay99</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thank you for replying.&lt;/p&gt;
&lt;p&gt;I did get the logs:-&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v2.5.2 ***
[00:00:00.535,430] &amp;lt;inf&amp;gt; NRFX_TIMER: Function: nrfx_timer_init, error code: NRFX_SUCCESS.
[00:00.[00:00:00.535,491] &amp;lt;inf&amp;gt; NRFX_TIMER: Timer id: 1, capture value set: 5000000, channel: 0.
[00:00:00.535,522] &amp;lt;inf&amp;gt; NRFX_SAADC: Function: nrfx_saadc_init, error code: NRFX_SUCCESS.
[00:00:00.535,583] &amp;lt;inf&amp;gt; NRFX_PPI: Assigned channel: 18, event end point: 40009140, task end point: 40007004.
[00:00:00.535,644] &amp;lt;inf&amp;gt; NRFX_PPI: Function: nrfx_ppi_channel_assign, error code: NRFX_SUCCESS.
[00:00:00.535,675] &amp;lt;inf&amp;gt; NRFX_PPI: Function: nrfx_ppi_channel_enable, error code: NRFX_SUCCESS.
[00:00:00.535,705] &amp;lt;inf&amp;gt; NRFX_TIMER: Enabled instance: 1.
[00:00:00.535,705] &amp;lt;inf&amp;gt; ADC_CONSOLE: PPI channels enabled

[00:00:00.573,883] &amp;lt;dbg&amp;gt; ADC_CONSOLE: saadc_event_handler: SAADC buffer at 0x20000874 filled with 2 samples
data: 141
data: 145
[00:00:00.612,030] &amp;lt;dbg&amp;gt; ADC_CONSOLE: saadc_event_handler: SAADC buffer at 0x20000878 filled with 2 samples
data: 150
data: 158
[00:00:00.650,299] &amp;lt;dbg&amp;gt; ADC_CONSOLE: saadc_event_handler: SAADC buffer at 0x20000874 filled with 2 samples
data: 162
data: 159
[00:00:00.688,446] &amp;lt;dbg&amp;gt; ADC_CONSOLE: saadc_event_handler: SAADC buffer at 0x20000878 filled with 2 samples
data: 168
data: 173s
ata: 177
[00:00:00.764,801] &amp;lt;dbg&amp;gt; ADC_CONSOLE: saadc_event_handler: SAADC buffer at 0x20000878 filled with 2 samples
data: 174
data: 181
[00:00:00.802,947] &amp;lt;dbg&amp;gt; ADC_CONSOLE: saadc_event_handler: SAADC buffer at 0x20000874 filled with 2 samples
data: 179
data: 183&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In the logs I can see the buffer getting filled at around 100ms, even though the timer is set for 5000ms. And also when I changed the timer frequency from 1Mhz to 16Mhz, the samples were getting even faster. I suspect this bug is related to timer and not ppi and adc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sampling ADC with PPI and Timer on nrf connect sdk</title><link>https://devzone.nordicsemi.com/thread/508398?ContentTypeID=1</link><pubDate>Tue, 29 Oct 2024 15:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:702171b4-2d9a-412d-9dfe-96c9c3c41038</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Have you one any debugging on this on your end. It would be helpful if you uploaded some logs with some return codes so we can see what functions are actually running into the issues you&amp;#39;re seeing here.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-2-debugging/"&gt;Lesson 2 of the nRF Connect SDK Intermediate course&lt;/a&gt; should cover how you can enable debugging and get some logging info here.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>