<?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>Can&amp;#39;t Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61961/can-t-get-an-interrupt-to-execute</link><description>Gentlemen: 
 I&amp;#39;m new to Nordic processors, but I have implemented projects with Silabs Gecko and ATTiny processors in the past. I&amp;#39;m working on a project for a consumer product with an Arduino Nano 33 BLE that uses the Nordic RNF52840 processor (I picked</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Jun 2020 20:36:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61961/can-t-get-an-interrupt-to-execute" /><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252848?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 20:36:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:db254e64-2fa1-417e-ace2-de107fc58064</guid><dc:creator>Don_Pez</dc:creator><description>&lt;p&gt;Brilliant gentlemen!&amp;nbsp; This was the problem.&amp;nbsp; I changed the interrupt number to that in the file you found (good work) and was able to get it to interrupt.&amp;nbsp; I also was turning the LED on in the ISR using the pin state, which was triggered by a rising edge, so the LED was always on...duh.&amp;nbsp; I fixed that and now it works.&lt;/p&gt;
&lt;p&gt;Thanks for all your help, both of you!&amp;nbsp; You saved the day.&lt;/p&gt;
&lt;p&gt;Don&lt;/p&gt;
&lt;p&gt;DG Devices&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252839?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 19:12:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6dd4027-2517-46cd-ba73-98f9abed154d</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;&lt;a class="internal-link view-user-profile" href="https://devzone.nordicsemi.com/members/hmolesworth"&gt;hmolesworth&lt;/a&gt;&amp;nbsp;is right.&amp;nbsp;Look at digitalWrite() and digitalRead() in&amp;nbsp;&lt;a href="https://github.com/sandeepmistry/arduino-nRF5/blob/master/cores/nRF5/wiring_digital.c"&gt;wiring_digital.c&lt;/a&gt;, you can see that GPIO pin number passes through remapping:&lt;/p&gt;
&lt;p&gt;ulPin = g_ADigitalPinMap[ulPin];&lt;br /&gt; &lt;br /&gt; Pin mapping is defined in &lt;a href="https://github.com/sandeepmistry/arduino-nRF5/tree/master/variants"&gt;variants&lt;/a&gt;&amp;nbsp;subdirectory, for BleNANO it will be in &lt;a href="https://github.com/sandeepmistry/arduino-nRF5/blob/master/variants/BLENano/variant.cpp"&gt;variant.cpp&lt;/a&gt;, where GPIO 2 corresponds to P0.10 in Nordic numeration. I don&amp;#39;t know exactly which variant corresponds to your board, but pin numbering in Arduino IDE and Nordic SDK files are definitely different.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252833?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 17:39:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:779e4083-a826-4e02-a469-f6fcd04c72dd</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;There are actually 48 i/o pins, not 32; nRF52840 has 2 i/o ports P0 and P1, nRF52832 has only 1 (P0).&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief Function for extracting port and the relative pin number from the absolute pin number.
 *
 * @param[in,out] p_pin Pointer to the absolute pin number overriden by the pin number that is relative to the port.
 *
 * @return Pointer to port register set.
 */
__STATIC_INLINE NRF_GPIO_Type * nrf_gpio_pin_port_decode(uint32_t * p_pin)
{
    NRFX_ASSERT(*p_pin &amp;lt; NUMBER_OF_PINS);
#if (GPIO_COUNT == 1)
    return NRF_P0;
#else
    if (*p_pin &amp;lt; P0_PIN_NUM)
    {
        return NRF_P0;
    }
    else
    {
        *p_pin = *p_pin &amp;amp; (P0_PIN_NUM - 1);
        return NRF_P1;
    }
#endif
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I&amp;#39;m helping here, I have no idea what those non-Nordic definitions are doing in relation to mapping pins, such as pinmode() for example, if no code is posted. Maybe others are familiar with them ..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252826?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 16:47:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c532cdfe-b46f-43ca-bc0f-cbb9da625052</guid><dc:creator>Don_Pez</dc:creator><description>&lt;p&gt;But If D2 works when directly connected to the LED, then shouldn&amp;#39;t it work when used to trigger an external interrupt? A pin is a pin, isn&amp;#39;t it?&amp;nbsp; If the mapping were different, it would cause serious problems.&amp;nbsp; In my code above (two posts ago) I used D2 (GPIO2) as an interrupt and it doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think there even is a &amp;quot;GPIO39&amp;quot;.&amp;nbsp; I tried this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int epin = 39;
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);                       //set built-in LED pin as output
  pinMode(epin, INPUT);                                  //set pin 39 as pullup input
}

void loop() {
 int pin39 = 0;
  pin39 = digitalRead(epin);
  if(pin39)
    digitalWrite(LED_BUILTIN, HIGH);
    else
      digitalWrite(LED_BUILTIN, LOW);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And nothing happens with any pin.&amp;nbsp; GPIO numbers are only supposed to be 0 to 31.&lt;/p&gt;
&lt;p&gt;Regardless of what is mapped to what, how can D2 operate the LED directly, but not generate an interrupt on the same GPIO?&lt;/p&gt;
&lt;p&gt;Don&lt;/p&gt;
&lt;p&gt;DG Devices&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252820?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 16:19:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:014bb89d-227f-4ee0-a62f-67cb7e269f1d</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Post the code for pinmode, digitalRead and&amp;nbsp;digitalWrite, maybe there is some mapping there. The Nordic functions such as&amp;nbsp;nrf_gpio_cfg_output deal with nRF52840 pin numbers P0.02 is pin 2 in that notation. GPIO39 is Nordic nRF52840 pin P1.11&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252816?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 16:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0c776a0-14bc-4afc-a3fa-749bf6c3d5b9</guid><dc:creator>Don_Pez</dc:creator><description>&lt;p&gt;I still don&amp;#39;t understand. If I run this code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int epin = 2;
void setup() {
  nrf_gpio_cfg_output(LED_BUILTIN);                       //set built-in LED pin as output
  nrf_gpio_cfg_input(epin, NRF_GPIO_PIN_PULLUP);  //set pin 2 as pullup input
}

void loop() {
 int pin2 = 0;
  pin2 = digitalRead(epin);
  if(pin2)
    digitalWrite(LED_BUILTIN, HIGH);
    else
      digitalWrite(LED_BUILTIN, LOW);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The LED will be on.&amp;nbsp; If I connect pin D2 to ground, the LED turns off, if I disconnect it, it turns back on.&amp;nbsp; No other GPIO pin will&amp;nbsp;affect the LED&amp;nbsp;but D2.&amp;nbsp; &lt;strong&gt;Doesn&amp;#39;t that mean that D2 is mapped to GPIO 2?&amp;nbsp; I don&amp;#39;t understand.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If D2 is mapped to P1.11, then what GPIO number do I use?&amp;nbsp; The GPIO number is an integer, not a P number.&lt;/p&gt;
&lt;p&gt;If I use the Arduino method I get the same result:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;int epin = 2;
void setup() {
  pinMode(LED_BUILTIN, OUTPUT);                       //set built-in LED pin as output
  pinMode(epin, INPUT);                                  //set pin 2 as pullup input
}

void loop() {
 int pin2 = 0;
  pin2 = digitalRead(epin);
  if(pin2)
    digitalWrite(LED_BUILTIN, HIGH);
    else
      digitalWrite(LED_BUILTIN, LOW);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand what you&amp;#39;re telling me.&amp;nbsp; The wiring schematic you refer to shows D2 connected to GPIO39, but GPIO&amp;#39;s only are supposed to go to 31. How can this be?&lt;/p&gt;
&lt;p&gt;All I need is to have six input pins that I can use for external interrupts.&amp;nbsp; If someone can tell me what pins to use and what GPIO numbers to use, that will get me by.&lt;/p&gt;
&lt;p&gt;Don&lt;/p&gt;
&lt;p&gt;DG Devices&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252806?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 15:30:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d7a77774-284b-483e-b96d-1183e2f4cb18</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;&amp;quot;D2&amp;quot; is P1.11 on the nRF52840 on the Nano 33 BLE, yet &amp;quot;epin&amp;quot; is defined as &amp;quot;2&amp;quot; which is a different pin, P0.02 which happens to be used on the Nano for AIN0 and SCL.&lt;/p&gt;
&lt;p&gt;The red/green/blue LEDs are active-low, so this code turns those LEDs off, not on (Yellow is active high, edit):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;  digitalWrite(LED, HIGH);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is the&amp;nbsp;&lt;a href="https://content.arduino.cc/assets/NANO33BLE_V2.0_sch.pdf"&gt;NANO33BLE_V2.0&lt;/a&gt;&amp;nbsp;schematic I referred to, in case I missed something in the posts above, hope this helps.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252804?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 15:26:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e5cc1f5-d46d-4710-ace0-43933fa25008</guid><dc:creator>Don_Pez</dc:creator><description>&lt;p&gt;I had originally tried the Arduino interrupt method.&amp;nbsp; I tried it again today to verify.&amp;nbsp; I even tried explicitly using the numeral &amp;quot;2&amp;quot; for the pin.&amp;nbsp; You can&amp;#39;t get any simpler than this...&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void setup(){
Serial.begin(9600); //start display serial
while (!Serial);

attachInterrupt(2, estring_ISR, RISING);
}

void loop(){
}

void estring_ISR(void){
Serial.println(&amp;quot;interrupt occurred&amp;quot;);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When run, this code refuses to interrupt when a signal is applied to pin 2 (literally jumping pin 2 to 3.3V and to ground).&amp;nbsp; I know the pin is not bad because I can use it elsewhere just fine.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s as if I&amp;#39;m using the wrong pin.&amp;nbsp; I looked over the Arduino core code that you posted and it looks like my code should work.&amp;nbsp; I can&amp;#39;t figure it out.&lt;/p&gt;
&lt;p&gt;Don&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252629?ContentTypeID=1</link><pubDate>Tue, 02 Jun 2020 07:34:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bd48ac5-3701-42b9-a1e2-538f45cefa1c</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;The handler for GPIOTE is defined in&amp;nbsp;&lt;a href="https://github.com/sandeepmistry/arduino-nRF5/blob/master/cores/nRF5/WInterrupts.c"&gt;arduino core&lt;/a&gt;&amp;nbsp;and used for &lt;span&gt;attachInterrupt/detachInterrupt.&amp;nbsp;&lt;/span&gt;&amp;nbsp;You cannot redefine it without changing core sources. I think you can use &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf52840%2Fegu.html&amp;amp;cp=4_0_0_5_7"&gt;EGU&lt;/a&gt;&amp;nbsp;peripheral to pass GPIOTE event to EGU interrupt handler that is not defined by core.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252587?ContentTypeID=1</link><pubDate>Mon, 01 Jun 2020 15:15:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40499de8-28d7-483d-a99a-cf2d5e15e106</guid><dc:creator>Don_Pez</dc:creator><description>&lt;p&gt;The Arduino compiler is based on C++, but I can&amp;#39;t get extern &amp;quot;C&amp;quot; to work at all.&amp;nbsp; I am dead in the water and I need to get this product prototype running soon.&amp;nbsp; No other development board has a small enough profile to fit in my application.&lt;/p&gt;
&lt;p&gt;Apparently the handler isn&amp;#39;t getting recognized (though I get no errors).&amp;nbsp; Isn&amp;#39;t there any other way of making the compiler execute the ISR?&lt;/p&gt;
&lt;p&gt;Don&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252566?ContentTypeID=1</link><pubDate>Mon, 01 Jun 2020 09:19:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38e2cc43-02b0-450e-a0da-9f14a0660cd8</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Do you use Arduino IDE? AFAIK its language&amp;nbsp;is a sort of C++, maybe you just have to add &lt;strong&gt;extern &amp;quot;C&amp;quot; { ... }&lt;/strong&gt; around your handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252539?ContentTypeID=1</link><pubDate>Sun, 31 May 2020 18:41:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34b57706-7e45-4726-bdbb-967b1625a671</guid><dc:creator>Don_Pez</dc:creator><description>&lt;p&gt;I had another Arduino Nano 33 BLE Nano, which also runs on a 52840.&amp;nbsp; I tried downloading the same two programs with the same results today.&amp;nbsp; So I don&amp;#39;t think it is a faulty processor.&lt;/p&gt;
&lt;p&gt;Don&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252536?ContentTypeID=1</link><pubDate>Sun, 31 May 2020 15:58:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:287f176d-2a44-4d99-910f-e2f37a7ef6a3</guid><dc:creator>Don_Pez</dc:creator><description>&lt;p&gt;I cut the code down to the bare minimum and ran it.&amp;nbsp; This is literally the entire program now:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;nrf.h&amp;gt;
#include &amp;quot;nrf_timer.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;

volatile uint32_t last_ecount = 0;                //last count values
const int epin = 2;                               //board pin D2, signal from E-wave
int LED = LED_BUILTIN;                            //built-in orange LED for debug
static void gpio_initialize(void);

void setup() {  

  nrf_gpio_cfg_output(LED);                       //set built-in LED pin as output
  nrf_gpio_cfg_input(epin, NRF_GPIO_PIN_PULLUP);  //set pin 2 as pullup input
   
  NVIC_EnableIRQ(GPIOTE_IRQn);                    //enable interrupts
  NRF_GPIOTE-&amp;gt;CONFIG[0] = 0x00010201;             //low-to-high, pin2, event mode
  NRF_GPIOTE-&amp;gt;INTENSET = 0x00000001;              //enable IN[0]   
  
  NRF_TIMER1-&amp;gt;TASKS_STOP = 1;
  NRF_TIMER1-&amp;gt;MODE = 0;
  NRF_TIMER1-&amp;gt;BITMODE = 3;                        //timer1 32-bit mode
  NRF_TIMER1-&amp;gt;PRESCALER = 0;                      //use full system clock for timer1: 16 MHz
  NRF_TIMER1-&amp;gt;TASKS_CLEAR = 1;
  NRF_TIMER1-&amp;gt;CC[0] = 0;                          //zero timer1
  NRF_TIMER1-&amp;gt;TASKS_START = 1;                    //start timer1
}

void loop() {
  
}
   
void GPIOTE_IRQHandler(void){                     //interrupts
  uint32_t count = 0;
  int avcount = 0;
  
  digitalWrite(LED, HIGH);
   
  if(NRF_GPIOTE-&amp;gt;EVENTS_IN[0] == 1){              //filter interrupt for E-wave
    NRF_GPIOTE-&amp;gt;EVENTS_IN[0] = 0;                 //clear interrupt flag
    NRF_TIMER1-&amp;gt;TASKS_CAPTURE[0] = 1;             //capture timer1 value in CC0
    count = NRF_TIMER1-&amp;gt;CC[0] - last_ecount;      //time elaspsed for one wave (CC0)
    last_ecount = count;                          //reset for next count
  }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I connect pin2 (epin = 2) to ground or to 3.3V I get &lt;strong&gt;nothing&lt;/strong&gt; on the LED.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However, when I move the LED output driver from the ISR to the loop() and control it directly with epin like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;nrf.h&amp;gt;
#include &amp;quot;nrf_timer.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;

volatile uint32_t last_ecount = 0;                //last count values
const int epin = 2;                               //board pin D2, signal from E-wave
int LED = LED_BUILTIN;                            //built-in orange LED for debug
static void gpio_initialize(void);

void setup() {  
  nrf_gpio_cfg_output(LED);                       //set built-in LED pin as output
  nrf_gpio_cfg_input(epin, NRF_GPIO_PIN_PULLUP);  //set pin 2 as pullup input
   
  NVIC_EnableIRQ(GPIOTE_IRQn);                    //enable interrupts
  NRF_GPIOTE-&amp;gt;CONFIG[0] = 0x00010201;             //low-to-high, pin2, event mode
  NRF_GPIOTE-&amp;gt;INTENSET = 0x00000001;              //enable IN[0]   
  
  NRF_TIMER1-&amp;gt;TASKS_STOP = 1;
  NRF_TIMER1-&amp;gt;MODE = 0;
  NRF_TIMER1-&amp;gt;BITMODE = 3;                        //timer1 32-bit mode
  NRF_TIMER1-&amp;gt;PRESCALER = 0;                      //use full system clock for timer1: 16 MHz
  NRF_TIMER1-&amp;gt;TASKS_CLEAR = 1;
  NRF_TIMER1-&amp;gt;CC[0] = 0;                          //zero timer1
  NRF_TIMER1-&amp;gt;TASKS_START = 1;                    //start timer1
}

void loop() {
  int pin2 = 0;
  pin2 = digitalRead(epin);
  if(pin2)
    digitalWrite(LED, HIGH);
    else
      digitalWrite(LED, LOW);
}
   
void GPIOTE_IRQHandler(void){                     //string interrupts
  uint32_t count = 0;
  int avcount = 0;
   
  if(NRF_GPIOTE-&amp;gt;EVENTS_IN[0] == 1){              //filter interrupt for E-string
    NRF_GPIOTE-&amp;gt;EVENTS_IN[0] = 0;                 //clear interrupt flag
    NRF_TIMER1-&amp;gt;TASKS_CAPTURE[0] = 1;             //capture timer1 value in CC0
    count = NRF_TIMER1-&amp;gt;CC[0] - last_ecount;      //time elaspsed for one vibration (CC0)
    last_ecount = count;                          //reset for next count
  }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I get a lit LED, which I can turn off by connecting pin2 to ground.&amp;nbsp; No other input pin does this but pin2.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t understand.&lt;/p&gt;
&lt;p&gt;Don&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252532?ContentTypeID=1</link><pubDate>Sun, 31 May 2020 09:59:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2be230ad-9134-46b8-ba2e-08c022d6b373</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Maybe you could put the whole project here? I don&amp;#39;t see anything wrong in your configuration.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;[quote userid="90729" url="~/f/nordic-q-a/61961/can-t-get-an-interrupt-to-execute/252524"]Another interesting thing is that I can&amp;#39;t get it to interrupt even if I explicitly set&amp;nbsp; NRF_GPIOTE-&amp;gt;EVENTS_IN[0] = 1; in the loop code.[/quote]&lt;/p&gt;
&lt;p&gt;This won&amp;#39;t work, you can only clear EVENTS register by software, not set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252524?ContentTypeID=1</link><pubDate>Sat, 30 May 2020 21:43:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5a4a08e-4e58-4792-8bd1-feada2a1b886</guid><dc:creator>Don_Pez</dc:creator><description>&lt;p&gt;You are right about making last_ecount global, but I haven&amp;#39;t gotten that far yet. I still need to interrupt.&lt;/p&gt;
&lt;p&gt;I verify the interrupt by putting&amp;nbsp;&lt;/p&gt;
&lt;p&gt;digitalWrite(LED, HIGH);&amp;nbsp; (Arduino method)&lt;/p&gt;
&lt;p&gt;Inside the ISR.&amp;nbsp; It never lights up when I connect pin2 to 3.3V or ground.&amp;nbsp; I also tried code to light the LED directly with pin2, which works, so I know my GPIO number is correct (2) and that the LED is functioning properly.&lt;/p&gt;
&lt;p&gt;Another interesting thing is that I can&amp;#39;t get it to interrupt even if I explicitly set&amp;nbsp;&lt;/p&gt;
&lt;p&gt;NRF_GPIOTE-&amp;gt;EVENTS_IN[0] = 1;&lt;/p&gt;
&lt;p&gt;in the loop code.&lt;/p&gt;
&lt;p&gt;So you can see my dilemma.&amp;nbsp; Is there some other enable for interrupts besides INTENSET or NVIC_EnableIRQ(GPIOTE_IRQn)?&lt;/p&gt;
&lt;p&gt;Don&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252521?ContentTypeID=1</link><pubDate>Sat, 30 May 2020 20:57:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c885c0dd-6c95-431e-a7d2-dca27f7c0a24</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;How did you found that your interrupt handler is not called? Did you set a breakpoint?&lt;/p&gt;
&lt;p&gt;The hardware seems to be configured ok. What I can see - last_ecount and&amp;nbsp;count are defined inside an interrupt handler and will be zeroed every time&amp;nbsp;the handler is called, they&amp;#39;re probably will be optimized out by the compiler&amp;nbsp;as well. You need to define &lt;span&gt;last_ecount&amp;nbsp;&lt;/span&gt;as global variable outside your handler.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can't Get an Interrupt to Execute</title><link>https://devzone.nordicsemi.com/thread/252515?ContentTypeID=1</link><pubDate>Sat, 30 May 2020 15:29:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e1817de7-586d-4de2-99c2-cc6308874574</guid><dc:creator>Don_Pez</dc:creator><description>&lt;p&gt;No errors?&amp;nbsp; Should I assume that the Nordic chip is faulty?&lt;/p&gt;
&lt;p&gt;Don&lt;/p&gt;
&lt;p&gt;DG Devices&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>