<?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>Cannot capture high-speed GPIOTE interrupts</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/82978/cannot-capture-high-speed-gpiote-interrupts</link><description>Hello, I tried to use pin_change_example in SDK to catch Interrupts (at first line) but I&amp;#39;m missing lots of them. 
 How can I catch all the interrupt events without delay? At present, I am using the ble_app_uart template. 
 This is the code of GPIOTE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Dec 2021 20:48:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/82978/cannot-capture-high-speed-gpiote-interrupts" /><item><title>RE: Cannot capture high-speed GPIOTE interrupts</title><link>https://devzone.nordicsemi.com/thread/344688?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 20:48:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:876b3a72-33ed-4b93-9b4e-e30eab8e421c</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Perhaps there is something else in your application that is running on a higher or same priority that takes up the time in every 3rd event? Try disabling everything but the pin interrupt and see if it picks up more than 1 in 3 events.&lt;/p&gt;
&lt;p&gt;This being said, if you intend to use the softdevice for Bluetooth, and you want to get all of these events, it will be very tricky using this bit-banging. You will at certain points have the softdevice using the CPU for more than 4µs. As mentioned, up to several milliseconds if you are sending a lot of data. You should consider using the PPI for this. It is a bit tricky to understand at first, but if you like, you can check out the hands-on that I used at some point in time:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/edvinand/ppi_pwm_hands_on"&gt;https://github.com/edvinand/ppi_pwm_hands_on&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(solution in the src folder). If you are using the nRF5 SDK, just copy paste the main file into any example from the SDK, remove the printk() and replace the k_sleep() with nrf_delay_ms() (#include &amp;quot;nrf_delay.h&amp;quot;).&lt;/p&gt;
&lt;p&gt;PS: We are short staffed due to Christmas Holidays, so we expect some delay in our response time. I will be out of office from tomorrow until the beginning of January.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot capture high-speed GPIOTE interrupts</title><link>https://devzone.nordicsemi.com/thread/344645?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 14:54:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2796417-30f3-4492-9c3b-fdb7c8fef870</guid><dc:creator>Lin Bencheng</dc:creator><description>&lt;p&gt;Yes, I tried using SPI peripheral&lt;br /&gt;Yes, I only pick up 1 in 3 events consistently&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot capture high-speed GPIOTE interrupts</title><link>https://devzone.nordicsemi.com/thread/344642?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 14:52:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ebd952c9-c008-461b-bd65-244d63ead926</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;So have you tried using the SPI peripheral?&amp;nbsp;&lt;/p&gt;
[quote user="Edvin Holmseth"]Is it consistent that you only pick up 1 in 3 events? Or does it vary?[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot capture high-speed GPIOTE interrupts</title><link>https://devzone.nordicsemi.com/thread/344638?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 14:45:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d86623fb-5292-431b-a840-e85483c25180</guid><dc:creator>Lin Bencheng</dc:creator><description>&lt;p&gt;Thanks for your reply&lt;br /&gt;At present, I am trying to get sensor data via the SPI interface.&lt;br /&gt;On the sensor side, if data is ready to send, the DRDY pin of the sensor pulse is high to low.&lt;br /&gt;So I have to read the falling edge of the DRDY pin and start to read data via SPI on the nRF side.&lt;br /&gt;In this case, I want to get your kind suggestion to handle this issue perfectly.&lt;br /&gt;As I described I am using BLE_NUS for sending the acquired sensor data.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot capture high-speed GPIOTE interrupts</title><link>https://devzone.nordicsemi.com/thread/344637?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 14:37:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83d934fe-f635-4746-acea-b70a44e7c29a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Is it consistent that you only pick up 1 in 3 events? Or does it vary?&lt;/p&gt;
&lt;p&gt;It is fairly quick. What exactly is it you are trying to do? If you are trying to count pulses, I would recommend that you look into PPI + TIMER in counter mode. Especially if you intend to use the Softdevice, which it looks like you are going to since you started with a ble_app_... example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t use PPI, then you may miss a lot of these events, since the softdevice will occupy the CPU from time to time, up to a couple of ms in cases where it has a lot of data to send.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cannot capture high-speed GPIOTE interrupts</title><link>https://devzone.nordicsemi.com/thread/344456?ContentTypeID=1</link><pubDate>Tue, 21 Dec 2021 00:27:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:878074df-f7b6-43c9-a356-075c7e96b830</guid><dc:creator>Mehmet Nuri</dc:creator><description>&lt;p&gt;Do nothing in interrupt service routine if you dont want to lose data.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void DRDY_pin_handle(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{

//nrf_gpio_pin_toggle(RST2);
drdy_3 = !drdy_3;
nrf_gpio_pin_set(RST2);
__nop();
nrf_gpio_pin_clear(RST2);

}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Do this instead:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void DRDY_pin_handle(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
bool flag = true;

}

//somewhere in your code check for flag like this

if(flag){

//nrf_gpio_pin_toggle(RST2);
drdy_3 = !drdy_3;
nrf_gpio_pin_set(RST2);
__nop();
nrf_gpio_pin_clear(RST2);


}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;if this is not the issue, you may need to give some detail about your feed line to gpiote pin. Is there a cap for low pass filter or a schmidtt trigger to sharpen the edges and so on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>