<?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>GPIO/GPIOTE interrupts not triggered at every event</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/85841/gpio-gpiote-interrupts-not-triggered-at-every-event</link><description>Hi, 
 
 My goal is to generate a GPIO or GPIOTE interrupt and inside the ISR sample 8-bits from GPIO. 
 I tried modifying two sample projects to achieve this, the NRFX and the button projects, but I got similar results from both. I started by toggling</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 17 Mar 2022 11:30:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/85841/gpio-gpiote-interrupts-not-triggered-at-every-event" /><item><title>RE: GPIO/GPIOTE interrupts not triggered at every event</title><link>https://devzone.nordicsemi.com/thread/358612?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 11:30:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ad9d5e4-e563-4151-97bb-64168335ce47</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;The GPIO peripheral always runs on a 16 MHz clock, and so this clock is what is relevant for detecting changes etc. The CPU (app core) runs at 128 or 64 MHz as you noted, so while the interrupts are generated by a 16 MHz peripheral, all code executed (including in the interrupt routines) run with the normal CPU clock frequency. Then the CPU may be sleeping and waking up takes a bit of time (depending on state), and the ISR is entered and do some processing, as you would expect for any similar device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO/GPIOTE interrupts not triggered at every event</title><link>https://devzone.nordicsemi.com/thread/358519?ContentTypeID=1</link><pubDate>Thu, 17 Mar 2022 02:38:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:92fd67fb-a53d-4cd4-a734-06bdef642541</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Thank you. That solved the pin problem. But if I may, I still have a question that is related to the initial topic of this post.&lt;/p&gt;
&lt;p&gt;Q - If we are doing operations that are unrelated to the peripherals, these operations are controlled by the main clock (128 / 64 MHz in the case of the nRF5340), but what clock controls the process of entering and leaving the GPIOTE interrupt routine? Is it the main clock or the 16 MHz peripheral clock? Also, if we are executing operations (summation, multiplication) inside the GPIOTE interrupt routine, what clock is used to process these operations?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO/GPIOTE interrupts not triggered at every event</title><link>https://devzone.nordicsemi.com/thread/358396?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 11:42:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18b03713-f078-4ab6-adcf-d875d38e0add</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Ah, I did not notice this before, but the nrfx sample does not handle GPIO pins from port 1. When yo use a pin from port 1, the pin number should be 32 + the P1 pin. So for instance, P1.15 is pin 47. This is normally handled more elegantly when using the Zephyr GPIO API, but when using nrfx directly that is not the case. You can for instance to it like this, though:&lt;/p&gt;
&lt;p&gt;Specify the pin in an overlay file like you have before:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;amp;button0 {
	gpios = &amp;lt;&amp;amp;gpio1 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)&amp;gt;;
};&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Then you can check the port and add 32 as needed as shown in this diff from the nrfx sample in nRF Connect SDK 1.9.1:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/6180.main.c.diff"&gt;devzone.nordicsemi.com/.../6180.main.c.diff&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(I have kept the output pin as is here, but you can change that as well).&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO/GPIOTE interrupts not triggered at every event</title><link>https://devzone.nordicsemi.com/thread/358347?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 08:38:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eceac0b6-8e81-40af-acc9-0cc8a8944b06</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;I tried to change the INPUT_PIN via the .overlay file using other pins from the P0 port and the interrupt was triggered, but I couldn&amp;#39;t trigger interrupts using any pin from the P1 port. Is there something I need to change in the project to be able to use pins from port P1 as input?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO/GPIOTE interrupts not triggered at every event</title><link>https://devzone.nordicsemi.com/thread/358304?ContentTypeID=1</link><pubDate>Wed, 16 Mar 2022 00:06:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e67eeb5-339e-466b-85e6-b078cc1c400d</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
[quote userid="7377" url="~/f/nordic-q-a/85841/gpio-gpiote-interrupts-not-triggered-at-every-event/358295#358295"]With high frequencies you will not have time for many instructions in the ISR before you run out of time. So without having seen your code I expect that is the problem. What is the end goal here? Doing things in SW this rapidly does not generally seem like a good idea (and if you are able to do wat you want here, you would not be able to do much else if anything as the CPU is more or less always busy handling the GPIOTE interrupts.[/quote]
&lt;p&gt;So, what is seen in the pictures above is expected and can not be improved&amp;nbsp;by adjusting the configurations?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is how I changed the pin:&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;&amp;amp;button0 {
    gpios = &amp;lt;&amp;amp;gpio1 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)&amp;gt;;
};&lt;/pre&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;I noticed that if I use the preassigned pin (p0.23) the interrupt is triggered, but if I change the pin as above and connect the signal to p1.15 the GPIOTE ISR is not called.&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO/GPIOTE interrupts not triggered at every event</title><link>https://devzone.nordicsemi.com/thread/358295?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 19:20:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8e20a9a-b05e-4948-a12f-322a0ed9272a</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;With high frequencies you will not have time for many instructions in the ISR before you run out of time. So without having seen your code I expect that is the problem. What is the end goal here? Doing things in SW this rapidly does not generally seem like a good idea (and if you are able to do wat you want here, you would not be able to do much else if anything as the CPU is more or less always busy handling the GPIOTE interrupts.&lt;/p&gt;
&lt;p&gt;Regarding using a different pin you can for instance make an overlay where you map the sw0 alias to something else, and that should work out of the box. How have you selected another pin?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO/GPIOTE interrupts not triggered at every event</title><link>https://devzone.nordicsemi.com/thread/358110?ContentTypeID=1</link><pubDate>Tue, 15 Mar 2022 07:36:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a8e8c507-53e2-4c01-8d51-3e776e3ee09c</guid><dc:creator>Thiago</dc:creator><description>&lt;p&gt;Also, my application requires that the pin p1.15 be the one configured to trigger the GPIOTE IN interrupts.&amp;nbsp;At the NRFX example when I modified the input pin at the .overlay file I noticed that no interrupt was triggered at all. I tried modifying some values at the&amp;nbsp;&lt;span&gt;IRQ_CONNECT&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;) function without any success. What should I change&amp;nbsp;to generate interrupts from events at the p1.15 pin?&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>