<?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>How I can do this measure from square waves?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23370/how-i-can-do-this-measure-from-square-waves</link><description>Hi, I&amp;#39;d like to know if there is a way to subtract two different square waves that are coming from two different input pins and then measure the pulse width (or the frequency) of this resulting wave. Is it done by any specific function? 
 Thanks in </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Jul 2017 10:52:10 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23370/how-i-can-do-this-measure-from-square-waves" /><item><title>RE: How I can do this measure from square waves?</title><link>https://devzone.nordicsemi.com/thread/91872?ContentTypeID=1</link><pubDate>Mon, 10 Jul 2017 10:52:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfc25883-1e8f-4155-984d-1cc35bc00f9e</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;You will have to use the GPIOTE module to keep track of the state of the two input pins, i.e. configure it to generate interrupts whenever the input pins go from low to high or from high to low. In the interrupt handler you keep track of the state with two global variables and based on these two variable you can find the state of the two square wave subtracted form one another.  In order to measure the pulse width you will have to start a timer when the resulting square wave transitions from low to high and stop it when it goes from high to low.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>