<?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>Cause of wake-up</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12215/cause-of-wake-up</link><description>I have programmed the system_off with 2 causes of wake-up on 2 different pins. 
 When the device is woken up, how can I check which pin is the wake cause ? 
 Thanks for your help !</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Nov 2016 09:38:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12215/cause-of-wake-up" /><item><title>RE: Cause of wake-up</title><link>https://devzone.nordicsemi.com/thread/46218?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 09:38:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce1b6ca3-ea49-4587-b7ca-3c5a1c3b4b71</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;similar discussion &lt;a href="https://devzone.nordicsemi.com/question/101581/set-2-pins-to-wakeup-from-system-on-and-off-and-know-which-pin-was-pressed/"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cause of wake-up</title><link>https://devzone.nordicsemi.com/thread/46219?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 09:26:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a81575de-035f-4668-bb17-9d44f65fcfd1</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;True, does not look very optimum because after the wakeup and before you read the pins, their status might have changed. For example if the wakeup is caused by a button connected to a gpio, then we hope that the button is still pressed after the wakeup till we read the button status.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cause of wake-up</title><link>https://devzone.nordicsemi.com/thread/46213?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2016 17:09:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9243539-09a5-43a4-a90f-dff59650051e</guid><dc:creator>Manu</dc:creator><description>&lt;p&gt;I only used the pin status reading on wake up. It was sufficent to decide the option to take .&lt;/p&gt;
&lt;p&gt;Thanks at all !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cause of wake-up</title><link>https://devzone.nordicsemi.com/thread/46217?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2016 14:39:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1205932f-c368-4fe7-86a4-a9a58836ed65</guid><dc:creator>John</dc:creator><description>&lt;p&gt;The only issue here is that the NRF_GPIO-&amp;gt;IN register is 32 bits and POWER-&amp;gt;GPREGRET is 8 bits according to the reference manual I am looking at. You may need to come up with a way to translate the GPREGRET contents to pin numbers and vice versa.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cause of wake-up</title><link>https://devzone.nordicsemi.com/thread/46216?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2016 10:20:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb0d5512-0a94-4431-aaab-8f9b91e49239</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;pin_status1    = (NRF_GPIO-&amp;gt;IN &amp;amp; (1 &amp;lt;&amp;lt; pin1_no) &amp;amp; (1 &amp;lt;&amp;lt; pin2_no));&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cause of wake-up</title><link>https://devzone.nordicsemi.com/thread/46215?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2016 09:54:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89f11134-2277-4999-a300-cade489ee4cd</guid><dc:creator>Manu</dc:creator><description>&lt;p&gt;What do you call the GPIO pin status ? Is it  IN ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Cause of wake-up</title><link>https://devzone.nordicsemi.com/thread/46214?ContentTypeID=1</link><pubDate>Tue, 01 Mar 2016 08:53:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e007a91-5204-4522-aa10-e1494f0dedce</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;If you see the &lt;a href="http://projecttools.nordicsemi.no/infocenter/index.jsp?topic=%2Fnrf51%2Fpower.html&amp;amp;cp=1_0_16_9&amp;amp;anchor=unique_1998539241"&gt;Reset behavior&lt;/a&gt; chapter, you will see that the GPIO is not reset on wake up from System off. So the below solution should work.&lt;/p&gt;
&lt;p&gt;read and store(persistently or in GPREGRET register) the GPIO pin status  before going to system off and then read again after waking from system off and compare them.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>