<?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, interrupt &amp;amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80481/gpio-interrupt-timer-latencies-larger-than-expected</link><description>I&amp;#39;m trying to implement communication protocol that involves clock and bidirectional I/O line. Clock signal is coming from an external device and expected to be in 1-5MHz range. I/O pin state is read or changed every N clock pulses. 
 So I expected to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Oct 2021 07:04:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80481/gpio-interrupt-timer-latencies-larger-than-expected" /><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/334481?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 07:04:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ae3ff6a-177b-4d1c-9bb1-679252f89c85</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="somename"]I experience exactly the same issue on a different MCU devboard from different vendor running different (but doing the same thing) test program, so most likely this should be EMI issue...[/quote]
&lt;p&gt;Did you try using a pull-resistor to see if this helps the scenario?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/334460?ContentTypeID=1</link><pubDate>Mon, 18 Oct 2021 01:46:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e0fde86a-2f95-48c4-b468-cac57f3017f8</guid><dc:creator>somename</dc:creator><description>&lt;p&gt;I experience exactly the same issue on a different MCU devboard from different vendor running different (but doing the same thing) test program, so most likely this should be EMI issue...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/334439?ContentTypeID=1</link><pubDate>Sat, 16 Oct 2021 11:49:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ccad46f-671f-4c69-8e99-ba5706b4d383</guid><dc:creator>somename</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/80481/gpio-interrupt-timer-latencies-larger-than-expected/334282#334282"]This handler looks to be empty, so no need to define it. It will cause the CPU to be interrupted on every input pulse:[/quote]
&lt;p&gt;changed gpio handler argument to NULL, no visible changes, still the same&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/334282?ContentTypeID=1</link><pubDate>Fri, 15 Oct 2021 08:49:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea4d6c65-b8e3-4678-a66d-1c45f75d8f49</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for confirming.&lt;/p&gt;
&lt;p&gt;This handler looks to be empty, so no need to define it. It will cause the CPU to be interrupted on every input pulse:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrfx_gpiote_in_init(INPUT_CLOCK_PIN, &amp;amp;clock_pin_conf, /*empty_gpiote_handler*/ NULL);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Unless you have an external pull-resistor on the pin, could you try to enable the pull-down resistor in the pin itself?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;  nrf_gpio_cfg(INPUT_CLOCK_PIN,
               NRF_GPIO_PIN_DIR_INPUT,
               NRF_GPIO_PIN_INPUT_CONNECT,
               /*NRF_GPIO_PIN_NOPULL*/ NRF_GPIO_PIN_PULLDOWN,
               NRF_GPIO_PIN_S0S1,
               NRF_GPIO_PIN_NOSENSE);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;not that important but: In function&amp;nbsp;timer_handler,&amp;nbsp;you can use the nrf_gpio_pin_toggle(OUTPUT_TEST_SIGNAL_PIN); instead.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/334231?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 16:53:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8df9dd9-1d3b-4a10-a1f4-ffb05554bf2c</guid><dc:creator>somename</dc:creator><description>&lt;p&gt;Yes, it equals 0x40006100&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/334179?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 13:15:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:97272787-9ded-43ed-ba19-431f886fd7b5</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="somename"]&lt;p&gt;Yes, I did, line 65 of the code example I provided:&lt;/p&gt;
&lt;p&gt;65: &amp;nbsp; *(volatile uint32_t *)(NRF_GPIOTE_BASE + 0x600 + (4 * 0)) = 1;//errata [155] GPIOTE: IN event may occur more than once on input edge&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;however, not sure if it is a right place.&lt;/p&gt;[/quote]
&lt;p&gt;It should be in the correct place, given that the GPIOTE IN channel 0 is being used.&lt;/p&gt;
&lt;p&gt;Could you check what the IN address is?&lt;/p&gt;
&lt;p&gt;uint32_t event_addr =&amp;nbsp;nrfx_gpiote_in_event_addr_get(INPUT_CLOCK_PIN);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This should return 0x40006100 if EVENTS_IN[0] is used:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpiote.html?cp=4_2_0_20_3#topic"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/gpiote.html?cp=4_2_0_20_3#topic&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333997?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 15:50:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:909534d7-f663-418d-a340-4f8e95d3ee0f</guid><dc:creator>somename</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/80481/gpio-interrupt-timer-latencies-larger-than-expected/333961#333961"]Did you apply the workaround described in this errata?[/quote]
&lt;p&gt;Yes, I did, line 65 of the code example I provided:&lt;/p&gt;
&lt;p&gt;65: &amp;nbsp; *(volatile uint32_t *)(NRF_GPIOTE_BASE + 0x600 + (4 * 0)) = 1;//errata [155] GPIOTE: IN event may occur more than once on input edge&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;however, not sure if it is a right place.&lt;/p&gt;
&lt;p&gt;I assume GPIOTE channel 0 is used, as no other GPIO pins are used in this code, and library code starts allocating from channel 0.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333961?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 13:25:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89ad5f77-68f3-42ed-9c17-ff92585d20c4</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="somename"]&lt;p&gt;1. Do you mean to have an empty event handler and pass false to disable interrupts in&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="background-color:rgba(255, 255, 255, 1);color:rgba(0, 0, 0, 1);"&gt;nrfx_gpiote_in_event_enable(INPUT_CLOCK_PIN, false);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;? Or there other ways to omit the handler too?&lt;/p&gt;[/quote]
&lt;p&gt;Sorry, I misunderstood your wanted behavior. If you want to get an event after ~96 us, then it should be OK, but please note that you&amp;#39;re now using the CPU to detect this scenario, and if you have other tasks running, like the bluetooth link, you can get interrupted.&lt;/p&gt;
[quote user="somename"]&lt;p&gt;Issue that I see here that output pulse period is not fixed and variates.&lt;/p&gt;
&lt;p&gt;If there is an input 4MHz clock, and timer compare value is set to 372,&lt;/p&gt;
&lt;p&gt;I expect output pulse width (time between two compare events) to be&lt;/p&gt;
&lt;p&gt;1/4000000*372 = 93 us, but shortest pulses visible on a picture are about 45us each,&lt;/p&gt;
&lt;p&gt;i.e compare event happens 2x more times than expected?&lt;/p&gt;[/quote]
&lt;p&gt;Did you apply the workaround described in this errata?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52832_Rev2%2FERR%2FnRF52832%2FRev2%2Flatest%2Fanomaly_832_155.html&amp;amp;cp=4_2_1_1_1_41"&gt;https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52832_Rev2%2FERR%2FnRF52832%2FRev2%2Flatest%2Fanomaly_832_155.html&amp;amp;cp=4_2_1_1_1_41&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333793?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 18:36:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1df9d661-382f-4969-bb04-bf6ef62cd7b0</guid><dc:creator>somename</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/80481/gpio-interrupt-timer-latencies-larger-than-expected/333712#333712"]* Lower the input frequency (let&amp;#39;s say 2 MHz) to see how it behaves then?[/quote]
&lt;p&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="background-color:#ffffff;color:#000000;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="background-color:#ffffff;color:#000000;"&gt;I used test signal from oscilloscope, it has 2KHz pulses, &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="background-color:#ffffff;color:#000000;"&gt;and at this frequency output pulse width is usually&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="background-color:#ffffff;color:#000000;"&gt;correct (i.e. if I count input pulses, they match timer compare value),&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="background-color:#ffffff;color:#000000;"&gt;but sometimes there are still shorter intervals between timer compare events&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333791?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 17:27:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1c589d2-32fa-412f-aefb-1fa39642100f</guid><dc:creator>somename</dc:creator><description>&lt;p&gt;1. Do you mean to have an empty event handler and pass false to disable interrupts in&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:monospace;"&gt;&lt;span style="background-color:#ffffff;color:#000000;"&gt;nrfx_gpiote_in_event_enable(INPUT_CLOCK_PIN, false);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;? Or there other ways to omit the handler too?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. Ok, tried this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3. I can&amp;#39;t control input frequency for this task, it is decied by other device. In this specific case it is 4MHz according to oscilloscope measurements.&lt;br /&gt;&lt;br /&gt;Here is the complete minimal compilable example that demonstrates the problem.&lt;br /&gt;There is an input 4MHz clock on clock pin 3, and output test signal is generated on pin 19. Both are recorded by oscilloscope.&amp;nbsp; Output pin is toggled in timer compare event.&lt;/p&gt;
&lt;p&gt;Is everything in this code ok?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#include &amp;quot;nrfx_ppi.h&amp;quot;
#include &amp;quot;nrfx_timer.h&amp;quot;
#include &amp;quot;nrfx_gpiote.h&amp;quot;
#include &amp;quot;nrf_delay.h&amp;quot;
#include &amp;quot;nrf_gpio.h&amp;quot;
#include &amp;quot;nrf_clock.h&amp;quot;
#include &amp;quot;nrfx_clock.h&amp;quot;


#define INPUT_CLOCK_PIN 3
#define OUTPUT_TEST_SIGNAL_PIN 19
#define TIMER_COMPARE_VALUE 372

static nrf_ppi_channel_t ppi_channel1;
const nrfx_timer_t clock_counter = NRFX_TIMER_INSTANCE(1);

static void  empty_gpiote_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
}

void empty_clock_event_handler(nrfx_clock_evt_type_t event)
{
}

static void timer_handler(nrf_timer_event_t event_type, void * p_context)
{
  if (event_type != NRF_TIMER_EVENT_COMPARE0)
    return;
  // toggle output pin on each timer compare event
  if (nrf_gpio_pin_out_read(OUTPUT_TEST_SIGNAL_PIN))
    NRF_P0-&amp;gt;OUTCLR = 1 &amp;lt;&amp;lt; OUTPUT_TEST_SIGNAL_PIN;
  else
    NRF_P0-&amp;gt;OUTSET = 1 &amp;lt;&amp;lt; OUTPUT_TEST_SIGNAL_PIN;
}

int main(void)
{
  NRF_POWER-&amp;gt;TASKS_CONSTLAT = 1;

  nrfx_clock_init(empty_clock_event_handler);
  nrfx_clock_hfclk_start();
  while(!nrfx_clock_hfclk_is_running());

  nrf_gpio_cfg(INPUT_CLOCK_PIN,
               NRF_GPIO_PIN_DIR_INPUT,
               NRF_GPIO_PIN_INPUT_CONNECT,
               NRF_GPIO_PIN_NOPULL,
               NRF_GPIO_PIN_S0S1,
               NRF_GPIO_PIN_NOSENSE);

  nrf_gpio_cfg(OUTPUT_TEST_SIGNAL_PIN,
               NRF_GPIO_PIN_DIR_OUTPUT,
               NRF_GPIO_PIN_INPUT_DISCONNECT,
               NRF_GPIO_PIN_NOPULL,
               NRF_GPIO_PIN_H0H1,
               NRF_GPIO_PIN_NOSENSE);

  nrfx_gpiote_init();

  nrfx_ppi_channel_alloc(&amp;amp;ppi_channel1);

  nrfx_gpiote_in_config_t clock_pin_conf = NRFX_GPIOTE_CONFIG_IN_SENSE_LOTOHI(true);
  nrfx_gpiote_in_init(INPUT_CLOCK_PIN, &amp;amp;clock_pin_conf, empty_gpiote_handler);

  *(volatile uint32_t *)(NRF_GPIOTE_BASE + 0x600 + (4 * 0)) = 1;//errata [155] GPIOTE: IN event may occur more than once on input edge

  nrfx_ppi_channel_assign(ppi_channel1,
                             nrfx_gpiote_in_event_addr_get(INPUT_CLOCK_PIN),
                             nrfx_timer_task_address_get(&amp;amp;clock_counter,
                                                            NRF_TIMER_TASK_COUNT));
  nrfx_ppi_channel_enable(ppi_channel1);

  nrfx_gpiote_in_event_enable(INPUT_CLOCK_PIN, false);

  nrfx_timer_config_t timer_cfg = NRFX_TIMER_DEFAULT_CONFIG;
  timer_cfg.mode = NRF_TIMER_MODE_COUNTER;
  timer_cfg.bit_width = NRF_TIMER_BIT_WIDTH_16;
  nrfx_timer_init(&amp;amp;clock_counter, &amp;amp;timer_cfg, timer_handler);

  nrfx_timer_clear(&amp;amp;clock_counter);
  nrfx_timer_compare(&amp;amp;clock_counter, NRF_TIMER_CC_CHANNEL0, TIMER_COMPARE_VALUE, true);

  nrf_timer_shorts_enable(clock_counter.p_reg, NRF_TIMER_SHORT_COMPARE0_CLEAR_MASK);
  nrf_timer_event_clear(clock_counter.p_reg, NRF_TIMER_EVENT_COMPARE0);
  nrfx_timer_enable(&amp;amp;clock_counter);

  while(1)
  {
  }

  return 0;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4MHz_5F00_372compare_5F00_devboard1_5F00_94us.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4MHz_5F00_372compare_5F00_devboard1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Issue that I see here that output pulse period is not fixed and variates.&lt;/p&gt;
&lt;p&gt;If there is an input 4MHz clock, and timer compare value is set to 372,&lt;/p&gt;
&lt;p&gt;I expect output pulse width (time between two compare events) to be&lt;/p&gt;
&lt;p&gt;1/4000000*372 = 93 us, but shortest pulses visible on a picture are about 45us each,&lt;/p&gt;
&lt;p&gt;i.e compare event happens 2x more times than expected?&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/45us_5F00_pulse_5F00_width.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/4MHz.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333712?ContentTypeID=1</link><pubDate>Tue, 12 Oct 2021 11:10:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ded689dd-09e7-4aff-af66-1e4e84271b56</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="somename"]basically I think about connecting clock line to SPIS CLK, leave MOSI, MISO unconnected, make some loop connection from one GPIO to chip select pin in order to emulate started transaction. And then count number of bytes received. Something like this.[/quote]
&lt;p&gt;If you always receive byte-aligned amount of pulses, that will work.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In your current design, could you try to:&lt;/p&gt;
&lt;p&gt;* Omit the GPIOTE event handler&lt;/p&gt;
&lt;p&gt;* Use TIMER SHORTS to clear the timer on COMPARE0 instead of a PPI channel&lt;/p&gt;
&lt;p&gt;* Lower the input frequency (let&amp;#39;s say 2 MHz) to see how it behaves then?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333595?ContentTypeID=1</link><pubDate>Mon, 11 Oct 2021 19:25:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e7a9566-d2dc-4837-a92d-92ba51f104c4</guid><dc:creator>somename</dc:creator><description>&lt;p&gt;basically I think about connecting clock line to SPIS CLK, leave MOSI, MISO unconnected, make some loop connection from one GPIO to chip select pin in order to emulate started transaction. And then count number of bytes received. Something like this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333594?ContentTypeID=1</link><pubDate>Mon, 11 Oct 2021 19:21:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64042dbe-bee3-415e-af91-1d9f0e768b5b</guid><dc:creator>somename</dc:creator><description>&lt;p&gt;What about possibility of using SPIS peripherial for counting incoming clock pulses?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333592?ContentTypeID=1</link><pubDate>Mon, 11 Oct 2021 18:38:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f936da3e-0d77-4e11-9f13-28be67eb3c3d</guid><dc:creator>somename</dc:creator><description>&lt;p&gt;Tried to apply,&lt;/p&gt;
&lt;p&gt;there is some effect, &lt;/p&gt;
&lt;p&gt;but timer compare events are still triggered at variable time periods&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333528?ContentTypeID=1</link><pubDate>Mon, 11 Oct 2021 13:01:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c27477c-3382-4ca1-b8e3-bc08067c418b</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you looked at errata #155 ?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_155.html?cp=4_2_1_1_1_41"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52832_Rev2/ERR/nRF52832/Rev2/latest/anomaly_832_155.html?cp=4_2_1_1_1_41&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;This is crucial that you apply.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GPIO, interrupt &amp; timer latencies larger than expected.</title><link>https://devzone.nordicsemi.com/thread/333345?ContentTypeID=1</link><pubDate>Sat, 09 Oct 2021 16:19:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0dea8a68-7578-4d2e-9abd-f881294ceca9</guid><dc:creator>somename</dc:creator><description>&lt;p&gt;Ok, second part of my post maybe stupid, &lt;br /&gt;gpio library functions have some overhead, and by writing directly to the GPIO ports I get up to 8MHz switching speed.&lt;br /&gt;But it is not relevant.&lt;br /&gt;&lt;br /&gt;Why the timer setup is not working as expected, and what is the max frequency of external signal that can be reliably detected by GPIOTE events mechanism? What is the latency of timer COUNT task and COMPARE event?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>