<?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>GPIOTE pin change IRQ handler fired when UART data RX occurs</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76055/gpiote-pin-change-irq-handler-fired-when-uart-data-rx-occurs</link><description>Hello, in my project i simultaneously use MPR121 touch sensor controller and GPS module connected to UART0 of nRF52840 (custom board). To handle touch events, i use MPR121 IRQ line which is hooked up to GPIOTE pin IRQ: 
 void touch_IRQ_init(void) { ret_code_t</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Jun 2021 09:56:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76055/gpiote-pin-change-irq-handler-fired-when-uart-data-rx-occurs" /><item><title>RE: GPIOTE pin change IRQ handler fired when UART data RX occurs</title><link>https://devzone.nordicsemi.com/thread/314419?ContentTypeID=1</link><pubDate>Wed, 09 Jun 2021 09:56:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:942f20a0-8400-491f-86ca-5f5a56baa64b</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;span&gt;Wojtek,&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
[quote user="woytekm"]i&amp;#39;m not using internal pull up, as there is external pull up resistor present on this line.[/quote]
&lt;p&gt;Thank you for clarifying, and for the detailed descriptions and code - this is very helpful!&lt;/p&gt;
[quote user="woytekm"]I have found one error in my code: RX and TX pins for UART were swapped in my main program. After correcting that, i see that UART handler is triggered as expected. I still have a problem with touch IRQ handler being triggered along with UART handler though.[/quote]
&lt;p&gt;I am happy to hear that you were able to identify and resolve this particular issue! It still seems very strange to me that you are getting the UART RX event when the GPIOTE pin is triggered.&amp;nbsp;&lt;/p&gt;
[quote user="woytekm"]If there are no known bugs that can cause similar behavior, then i suspect that maybe there is some error on my custom board - maybe some short or crosstalk between these two pins - i will check this and i&amp;#39;ll get back with the results.[/quote]
&lt;p&gt;There is no known issue of this, no. I have never heard of any similar behavior either. Could you possibly try to change the pin you are using for your GPIOTE event, to see if the same happens then? if the same does not happen with another pin it is very likely that it is a hardware issue.&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><item><title>RE: GPIOTE pin change IRQ handler fired when UART data RX occurs</title><link>https://devzone.nordicsemi.com/thread/314329?ContentTypeID=1</link><pubDate>Wed, 09 Jun 2021 06:02:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56e57731-5827-4393-be07-8f1b5282b859</guid><dc:creator>woytekm</dc:creator><description>&lt;p&gt;I have found one error in my code: RX and TX pins for UART were swapped in my main program. After correcting that, i see that UART handler is triggered as expected. I still have a problem with touch IRQ handler being triggered along with UART handler though. If there are no known bugs that can cause similar behavior, then i suspect that maybe there is some error on my custom board - maybe some short or crosstalk between these two pins - i will check this and i&amp;#39;ll get back with the results.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE pin change IRQ handler fired when UART data RX occurs</title><link>https://devzone.nordicsemi.com/thread/314032?ContentTypeID=1</link><pubDate>Mon, 07 Jun 2021 19:09:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b37eb0af-e791-4256-8188-daaec088b3e2</guid><dc:creator>woytekm</dc:creator><description>&lt;p&gt;I&amp;#39;m attaching UART/GPS test program here - hope this helps. It basically initializes UART, turns GPS module on, sends a configuration string to GPS, then only listens to NMEA strings from GPS, and prints them using Segger RTT printf().&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/2728.main.c"&gt;devzone.nordicsemi.com/.../2728.main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My main program has several source files, so i won&amp;#39;t attach it here. It is basically a firmware for a device i&amp;#39;m building (in early stages of development). Among other functionalities, it includes MPR121 code, and i have just started to add UART code to interact with onboard GPS module.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE pin change IRQ handler fired when UART data RX occurs</title><link>https://devzone.nordicsemi.com/thread/314029?ContentTypeID=1</link><pubDate>Mon, 07 Jun 2021 18:47:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f031295-e05a-421e-925a-27ee6d3d9210</guid><dc:creator>woytekm</dc:creator><description>&lt;p&gt;Hi Karl, i&amp;#39;m not using internal pull up, as there is external pull up resistor present on this line.&lt;/p&gt;
&lt;p&gt;As to pin assignments, this is MPR121 IRQ line:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define TOUCH_IRQ_PIN NRF_GPIO_PIN_MAP(0,20)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt; Regarding UART, init routine is called like that:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;pre class="ui-code" data-mode="text"&gt;#define PIN_GPS_TXD NRF_GPIO_PIN_MAP(0,6)
#define PIN_GPS_RXD NRF_GPIO_PIN_MAP(0,26)

UART_config(0,PIN_GPS_TXD,0,PIN_GPS_RXD,UART_BAUDRATE_BAUDRATE_Baud38400,false);


&lt;/pre&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p class="p1"&gt;Regarding configurations - for my main progam i have used sdk_config.h from peripheral/template_project/pca10056/blank/config/sdk_config.h, and modified it as needed. One maybe important thing that is changed, is that i have set UART_LEGACY_SUPPORT to 0, as it was giving me &amp;quot;multiple definition of `UARTE0_UART0_IRQHandler&amp;#39;&amp;quot; error during compiling.&lt;/p&gt;
&lt;p class="p1"&gt;And for a UART/GPS test program, i think i have used sdk_config.h from uart example.&amp;nbsp;Is there any specific setting i should search for?&lt;/p&gt;
&lt;p class="p1"&gt;Regards,&lt;/p&gt;
&lt;p class="p1"&gt;Wojtek&lt;/p&gt;
&lt;p class="p1"&gt;&lt;/p&gt;
&lt;p class="p1"&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIOTE pin change IRQ handler fired when UART data RX occurs</title><link>https://devzone.nordicsemi.com/thread/313952?ContentTypeID=1</link><pubDate>Mon, 07 Jun 2021 13:43:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7aece294-e5bf-4e16-b302-699a1cba554d</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Which pins are you using for your GPIOTE detect, and your UART RX?&lt;br /&gt;Also, I notice that you have no pullup/pulldown on your GPIOTE pin, what is the reason for this? It likely has nothing to do with the issue here, but it could give you unexpected triggers.&lt;/p&gt;
[quote user=""]Same&amp;nbsp;UART code alone seems to work ok in a separate program dedicated to testing GPS interaction.[/quote]
&lt;p&gt;Could you elaborate on the differences between this UART testing program, and the program that you are seeing this issue in?&lt;br /&gt;Are all the configurations the same, etc?&lt;br /&gt;&lt;br /&gt;For future reference, please use the&amp;nbsp;&lt;em&gt;Insert -&amp;gt; Code&amp;nbsp;&lt;/em&gt;option when sharing code here on DevZone in the future. It makes the code a lot easier to read.&lt;br /&gt;&lt;br /&gt;Looking forward to resolving this issue together!&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>