<?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>Read 8-bits from GPIO without intervention from the CPU</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85356/read-8-bits-from-gpio-without-intervention-from-the-cpu</link><description>Hi! 
 
 I am working with an nRF5340. 
 
 - Is it possible to somehow fill an array with values read from a GPIO OUT register using DMA or PPI? 
 
 - Is it possible to assign a function to an EGU event and call it at a GPIOTE event using PPI? 
 
 - Is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Mar 2022 12:37:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85356/read-8-bits-from-gpio-without-intervention-from-the-cpu" /><item><title>RE: Read 8-bits from GPIO without intervention from the CPU</title><link>https://devzone.nordicsemi.com/thread/358647?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 12:37:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99f36780-ab3c-44b6-80dc-64bb59c7c16d</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Thiago,&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;#39;&amp;#39;Using the SAADC is an interesting approach that I haven&amp;#39;t thought about before. Is it possible to trigger 8-pin SAADC sampling tasks using a single GPIOTE event?&amp;#39;&amp;#39;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you enable 8 channels in SAADC, one for each analog input and then trigger the sample task from GPIOTE, you will get result from all channels. But you will get result sequentially not simultaneously. GPIOTE has Port event (&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf9160/gpiote.html?cp=2_0_0_5_4"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf9160/gpiote.html?cp=2_0_0_5_4&lt;/a&gt;) where an event can be generated from multiple input pints (for example you 8 analog input from SAADC) using the GPIO DETECT signal.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read 8-bits from GPIO without intervention from the CPU</title><link>https://devzone.nordicsemi.com/thread/358166?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 10:31:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:006c70aa-0f54-4074-8ce6-e8ac1cdb92d5</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Hi! I hope you are feeling better now.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="108933" url="~/f/nordic-q-a/85356/read-8-bits-from-gpio-without-intervention-from-the-cpu/358159#358159"]Could you please share why do you would you like to use EGU to generate a new Event? The EGU is used to generate for hardware events. If you already have an event from GPIOTE, do you think it is relevant using EGU again to generate a new event? It may be redundant.&amp;nbsp;[/quote]
&lt;p&gt;I may be wrong, but I thought we could not use a GPIOTE event to trigger a read GPIO_IN task using PPI, so I was looking for alternatives that would allow offloading the CPU while reading the GPIO_IN register.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Using the SAADC is an interesting approach that I haven&amp;#39;t thought about before. Is it possible to trigger 8-pin SAADC sampling tasks using a single GPIOTE event?&amp;nbsp;I think this could solve my problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read 8-bits from GPIO without intervention from the CPU</title><link>https://devzone.nordicsemi.com/thread/358159?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 10:03:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61290d53-b597-40d1-9e8e-95c5c89be6bc</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;&lt;span&gt;Hello Thiago,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Sorry for late reply. I was sick last week.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. Sampling digital signals using the SAAD and timer should be possible, technically. You just need to decode the analog samples as high or low level based on sampled value. For example: sampled value above 0.7xVDD is for high and below 0.3xVDD is for low.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If you want data from multiple GPIO pins, you need to consider that there is only on ADC core, so sampling multiple analog inputs will happen sequentially (SCAN mode). Then there will be (T_acq + T_conv) &amp;#39;&amp;#39;delay&amp;#39;&amp;#39; between samples from each input. One thing, you have to consider that SADDC is quite high power (see the table below from our product electrical specification) when it&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt; is active.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;img height="241" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1647335920186v1.png" width="639" alt=" " /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Therefore it would not be a low power operation if this is you want&amp;nbsp;to implement, not involving the CPU.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;2. The EGU will not be able to perform any software functions without involving the CPU (&lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/egu.html?resultof=%22%45%47%55%22%20%22%65%67%75%22%20"&gt;https://infocenter.nordicsemi.com/topic/ps_nrf5340/egu.html?resultof=%22%45%47%55%22%20%22%65%67%75%22%20&lt;/a&gt;&amp;nbsp;). The EGU can be used for the PPI to link peripherals to custom callbacks. For example: you can use GPIOTE+PPI to trigger the STARTTX task of the UARTE peripheral to send a predefined buffer when the button is pressed.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Could you please share why do you would you like to use EGU to generate a new Event? The EGU is used to generate for hardware events. If you already have an event from GPIOTE, do you think it is relevant using EGU again to generate a new event? It may be redundant.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read 8-bits from GPIO without intervention from the CPU</title><link>https://devzone.nordicsemi.com/thread/356815?ContentTypeID=1</link><pubDate>Tue, 08 Mar 2022 10:02:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9aab3b3b-4a1e-40ae-af5e-426514c9e7d6</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;Thank you for your response.&lt;/p&gt;
&lt;p&gt;1 - My mistake. I meant to read from the GPIO IN register. the NRF SDK had examples of analog sampling using the SAADC and the timer, connecting both peripherals via the PPI. The SAADC could read many samples and fill an array with the sampled values. I would like to know if there is any way of doing something similar to that but sampling digital signals.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2 - &lt;span&gt;My mistake again.&amp;nbsp;&lt;/span&gt;I mean if is it possible to trigger an EGU task from a GPIOTE event using PPI. Ex: press a button (trigger a GPIOTE event) and print a message via UART (using an EGU task). I thought I could use this approach to sample digital data without the intervention of the CPU.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read 8-bits from GPIO without intervention from the CPU</title><link>https://devzone.nordicsemi.com/thread/356479?ContentTypeID=1</link><pubDate>Mon, 07 Mar 2022 07:40:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14978014-660c-485b-8e84-b0b3f29fe1f3</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hello Thiago,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Is it possible to somehow fill an array with&amp;nbsp;values read from a GPIO OUT register using DMA or PPI?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You want to read 8 bits from GPIO without CPU-is this 8 consecutive bits on the same pin or 8 bits in parallel on 8 pins (configured pin as input)? This may not possible. Could you please tell a bit elaborately why do you want to read the out register? GPIO out register is for setting the state of the pin when configured as an output; so this can not be assured it will reflect the actual state of the pin if it is configured as input. You may try out to see the result.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Is it possible to assign a function to an EGU event and&amp;nbsp;call it&amp;nbsp;at a&amp;nbsp;GPIOTE event&amp;nbsp;using PPI?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Could you please elaborate this question (better with an example) ? Each instance of The Event Generate event (EGU) implements a set of tasks which can individually be triggered to generate the corresponding event. So, EGU triggers event, it is not possible to connect event to events over PPI. Only events to task.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Is it possible to benefit from the two cores of the nrf5340 and continuously sample data in one core and use the other core for other types of processing?&amp;nbsp;&lt;/strong&gt;&lt;span&gt;&lt;strong&gt;Should the network core in the nrf5340&amp;nbsp; only be used for BLE matters?&amp;nbsp;When we send a BLE message using functions such as bt_nus_send(), does it interfere with the running of the application CPU, or is it fully handled by the network core (nRF5340)?&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The network core is basically restricted to the BLE stack. You should not use it for the application work if you want to use BLE.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanking you.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Read 8-bits from GPIO without intervention from the CPU</title><link>https://devzone.nordicsemi.com/thread/356078?ContentTypeID=1</link><pubDate>Thu, 03 Mar 2022 13:57:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84471688-9fd5-4bbb-9933-48fd0b301eec</guid><dc:creator>Kazi Afroza Sultana</dc:creator><description>&lt;p&gt;Hello Thiago,&lt;/p&gt;
&lt;p&gt;Thanks for your queries. I have started looking at your queries. I will reply you whenever the answers are ready.&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Kazi Afroza Sultana&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>