<?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/GPIO Required timing</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/65406/adc-gpio-required-timing</link><description>Hi, 
 
 We are looking for a guideline to trigger GPIO and SAADC sampling at the same time. 
 Our purpose is to sample every 20 m 
 Hi, 
 
 We are looking for a guideline to trigger GPIO and SAADC sampling at the same time. 
 Our purpose is to sample</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 31 Aug 2020 08:04:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/65406/adc-gpio-required-timing" /><item><title>RE: ADC/GPIO Required timing</title><link>https://devzone.nordicsemi.com/thread/267144?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2020 08:04:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6a325bd-53d5-4867-b557-8667e8979496</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If you sutup the GPIO using GPIOTE, you wan use PPI to toggle the pin when the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/saadc.html#topic"&gt;END event&lt;/a&gt; is generated by the SAADC peripheral, when your buffer is full.&lt;/p&gt;
&lt;p&gt;There is a &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/nrf_gpiote_example.html"&gt;GPIOTE example&lt;/a&gt; available in the SDK that shows how you setup this.&lt;/p&gt;
&lt;p&gt;You can also hook up the TIMER event to a second PPI channel to toggle the GPIO at the start of sampling as well, or you can control it from the code as you do now. Note that once the GPIO is setup with GPIOTE, you can only control it using &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.0/hardware_driver_gpiote.html#gpiote_out_simple"&gt;GPIOTE functions&lt;/a&gt;, not through the GPIO peripheral directly anymore.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ADC/GPIO Required timing</title><link>https://devzone.nordicsemi.com/thread/267142?ContentTypeID=1</link><pubDate>Mon, 31 Aug 2020 07:57:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4c0a0cd-dc6d-463c-8256-9baf577c2d81</guid><dc:creator>ran</dc:creator><description>&lt;p&gt;Correct text :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;We are looking for a guideline to trigger GPIO and SAADC sampling at the same time.&lt;/p&gt;
&lt;p&gt;Our purpose is to sample every 20 ms - 5 ADC channels, 16 samples for each channel, at total 80 samples &amp;ndash; sample rate of 25us.&lt;/p&gt;
&lt;p&gt;Upon enabling PPI we need to set a GPIO and when finish sampling clear the GPIO.&lt;/p&gt;
&lt;p&gt;For now, we are using NRF_DRV_TIMER, setting the timer channel in extended compare mode, configured to 20 ms. In the Event handler of the timer, we configure SAADC write buffer, enable the PPI channel and setting the GPIO.&lt;/p&gt;
&lt;p&gt;Upon getting the SAADC callback we disable PPI channel and clearing the GPIO, and wait for timer event and so on.&lt;/p&gt;
&lt;p&gt;Using this implementation we have latency between the ADC sampling and the GPIO, therefore we are looking for a proper way to sync between these 2 tasks.&lt;/p&gt;
&lt;p&gt;The picture below shows the required timing:&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>