<?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>SAADC with timer CC results in inconsistent period among boards</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/87112/saadc-with-timer-cc-results-in-inconsistent-period-among-boards</link><description>Working on 52832, with SoftDevice S132, SDK 17.0.2 Our boards have external 32MHz crystal as the source of HFCLK. 
 Our application samples the ADC periodically using the NRFX_SAADC_API_V2. 
 Codes look like this: 
 
 As we measure the sampling period</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Apr 2022 13:17:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/87112/saadc-with-timer-cc-results-in-inconsistent-period-among-boards" /><item><title>RE: SAADC with timer CC results in inconsistent period among boards</title><link>https://devzone.nordicsemi.com/thread/363957?ContentTypeID=1</link><pubDate>Wed, 20 Apr 2022 13:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:199b5403-275e-4d5c-a53f-03a4487bf14e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]Reading the DevZone posts saying the Softdevice will turn on and off the external crystal so wondering if this is the cause of the deviations.[/quote]
&lt;p&gt;If you are using &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html#saadc_operationmodes_continuous"&gt;the SAADC in continuous mode&lt;/a&gt;&amp;nbsp;then it will not matter what state the external crystal is in, since the SAADC will perform the sampling based on its internal timer.&lt;/p&gt;
[quote user=""]As we measure the sampling period of the 256 samples (raise a GPIO pin in NRFX_SAADC_EVT_READY event,&amp;nbsp;and turn it off in NRFX_SAADC_EVT_DONE, measure the interval), the period appears not consistent among several boards. We observed about 1% differences among boards.[/quote]
&lt;p&gt;I think the issue here might be with the way you are measuring it - could you elaborate on how the event is connected to the GPIO toggling? Is it done through CPU intervention, or through PPI?&lt;br /&gt;In case of the former you will not be able to guarantee that the CPU is free to handle the event (toggle the GPIO) at the time that the sampling actually finishes, since it may be busy in a higher priority interrupt.&lt;br /&gt;In case of the latter it would be great to see a more complete version of how you have implemented this in the code.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>