<?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>Analyzing a Demodulated Signal using Interrupt, capture and PPI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21993/analyzing-a-demodulated-signal-using-interrupt-capture-and-ppi</link><description>Hi, 
 I need to capture a demodulated, manchester encoded signal (16 bits long). The data rate is about 50kHz (give or take). Currently, I am configuring a PPI with timer1 and the pin interrupt. When the interrupt routine is generated, I retrieve the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 18 May 2017 14:39:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21993/analyzing-a-demodulated-signal-using-interrupt-capture-and-ppi" /><item><title>RE: Analyzing a Demodulated Signal using Interrupt, capture and PPI</title><link>https://devzone.nordicsemi.com/thread/86294?ContentTypeID=1</link><pubDate>Thu, 18 May 2017 14:39:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d15d7351-c769-4255-b00b-32e81d2debb8</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi James&lt;/p&gt;
&lt;p&gt;You actually don&amp;#39;t need to use two separate GPIO&amp;#39;s, just separate GPIOTE channels on the same pin.
I am also unsure how using two timers will help. I would assume just having one free running timer, and capture continuously to two different CC registers, should be equally efficient.&lt;/p&gt;
&lt;p&gt;Have you measured the worst case (minimum) time interval between two rising or falling edges?&lt;br /&gt;
Once the first edge is detected, do you always exit the interrupt, or do hang inside the interrupt waiting for more edges?&lt;br /&gt;
What is the typical activity rate of the interface in your application. Is it running continuously, or in bursts?&lt;/p&gt;
&lt;p&gt;I am suspecting that the nrf_drv_gpiote library is adding too much overhead, and not a good option in your case. Most likely you should just use the NRF_GPIOTE hardware directly, to keep the latency to an absolute minimum.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Analyzing a Demodulated Signal using Interrupt, capture and PPI</title><link>https://devzone.nordicsemi.com/thread/86295?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 13:14:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c0219dc-8b82-4c05-adef-7fdd81698e91</guid><dc:creator>James T</dc:creator><description>&lt;p&gt;When I call the function:&lt;/p&gt;
&lt;p&gt;nrf_drv_timer_capture_get(&amp;amp;timer, NRF_TIMER_CC_CHANNEL1);&lt;/p&gt;
&lt;p&gt;the delay in my ISR is too long and thus causing timing issues but I need the stored value before the next falling or rising edge (depending on the edge that triggered the interrupt).&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Analyzing a Demodulated Signal using Interrupt, capture and PPI</title><link>https://devzone.nordicsemi.com/thread/86296?ContentTypeID=1</link><pubDate>Tue, 16 May 2017 13:07:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cd51aaa-5139-4050-8bb0-ebe8ba14ef98</guid><dc:creator>James T</dc:creator><description>&lt;p&gt;Hi,
Thanks for the response.
I have enabled constant latency mode. I have removed any visible sleep function in my code.&lt;/p&gt;
&lt;p&gt;I have tried setting up individual events on rising and falling edge. I have the data stream going to two pins on the nrf52 (one set to interrupt on PosEdge and the other on NegEdge) in hopes that this would solve the issue.&lt;/p&gt;
&lt;p&gt;The system seems too slow consistently. The response time from the level changing to the ISR is about 8.5uS. Can you think of any other way I can speed this up? Any workaround ideas would also be greatly appreciated.&lt;/p&gt;
&lt;p&gt;Regards,
James&lt;/p&gt;
&lt;p&gt;...small update.&lt;/p&gt;
&lt;p&gt;I am using two PPI&amp;#39;s , two GPIO interrupts and two timers with capture enabled. One GPIO interrupt is generated on rising edge, the other on negative edge. Each interrupt generates a capture event using their respective PPI&amp;#39;s. The problem I now have is trying to get the data from these captures...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Analyzing a Demodulated Signal using Interrupt, capture and PPI</title><link>https://devzone.nordicsemi.com/thread/86293?ContentTypeID=1</link><pubDate>Fri, 12 May 2017 14:14:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9a3edf08-c5a8-4bf1-bd9f-a984879051fb</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi James&lt;/p&gt;
&lt;p&gt;Do you put the chip in system ON sleep mode while the data capture is occurring?
If so you might want to enable constant latency mode before entering sleep, and you should see quicker event response (at the cost of higher sleep current).&lt;/p&gt;
&lt;p&gt;Another trick to give you some more time is to set up individual events on rising and falling flank. Then you should have twice as long time (on average) to process the events.&lt;/p&gt;
&lt;p&gt;Would you say that the system is too slow consistently, or is it only during higher priority interrupts that you get issues (such as those generated by the SoftDevice during radio activity)?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>