<?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>nRF9E5 RTC &amp;amp; GPIO  Wake Up...</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41405/nrf9e5-rtc-gpio-wake-up</link><description>Hello , 
 This nRF9E5 wake up function is driving me slowly nuts... 
 How to distinguish whether the wake up is coming from RTC or from GPIO. 
 I have tried to read the wakeup status from RWSTA0, BIT8 RTC timer status and BITS 7-0 for pins P07-P00 but</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 14 Dec 2018 08:30:03 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41405/nrf9e5-rtc-gpio-wake-up" /><item><title>RE: nRF9E5 RTC &amp; GPIO  Wake Up...</title><link>https://devzone.nordicsemi.com/thread/161808?ContentTypeID=1</link><pubDate>Fri, 14 Dec 2018 08:30:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c2a9608-9d37-44c9-8da3-23b76783c039</guid><dc:creator>TeeGu</dc:creator><description>&lt;p&gt;About the interrupt processing&amp;hellip;.&lt;/p&gt;
&lt;p&gt;Table 36 describes the interrupt sources and priorities. I am using INT0_N and wdti (RTC).&lt;/p&gt;
&lt;p&gt;INT0_N natural priority is 1, so it is the highest and wdti (RTC) seems to be the lowest, natural priority 12.&lt;/p&gt;
&lt;p&gt;If I put the INT0 to low priority and wdti&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt; (RTC)&lt;/span&gt; to high, should the wdti &lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;(RTC) &lt;/span&gt;then override the INT0 ?&lt;/p&gt;
&lt;p&gt;Seems to be so that INT0 all ways overrides the wdt&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;i (RTC). I like to have situation where RTC interrupt overrides the INT0. Is that possible to implement???&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;BR and have a nice weekend&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9E5 RTC &amp; GPIO  Wake Up...</title><link>https://devzone.nordicsemi.com/thread/161543?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 20:22:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:795e4b10-e149-4b4e-87c8-72b3b860684f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;That is the same as&amp;nbsp;WDTI = 0 in my code, if you look at reg9e5.h you can find:&lt;/p&gt;
&lt;p&gt;/* EICON */&lt;br /&gt;sbit SMOD1 = EICON^7;&lt;br /&gt;sbit WDTI = EICON^3;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9E5 RTC &amp; GPIO  Wake Up...</title><link>https://devzone.nordicsemi.com/thread/161333?ContentTypeID=1</link><pubDate>Wed, 12 Dec 2018 06:23:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3bcfcfbf-74b3-4426-9c8d-bb03f77bbb03</guid><dc:creator>TeeGu</dc:creator><description>&lt;p&gt;Manual page 52 there is mentioned that EICON.3 can be polled to find the RTC wakeup&lt;/p&gt;
&lt;p&gt;&amp;quot;The wakeup timer is one of the sources that can generate a WDTI interrupt to the CPU. The programmer may poll the EICON.3 flag or enable the interrupt.&amp;quot;&lt;/p&gt;
&lt;p&gt;How ever the following didn&amp;#39;t work&lt;/p&gt;
&lt;p&gt;if(EICON &amp;amp; 0x08)&lt;/p&gt;
&lt;p&gt;How to handle those EICON bits ???&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9E5 RTC &amp; GPIO  Wake Up...</title><link>https://devzone.nordicsemi.com/thread/161144?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 09:23:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:227fce4d-8bc3-4acb-bb27-b9561c258d3f</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Maybe this can be of help:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/*= rtc.c ======================================================================
 *
 * Copyright (C) 2006 Nordic Semiconductor
 *
 * This file is distributed in the hope that it will be useful, but WITHOUT
 * WARRANTY OF ANY KIND.
 *
 * Author(s): Kenneth Meg&amp;#229;rd
 *
 * DESCRIPTION:
 *
 *   Example of RTC interrupt.
 *
 * COMPILER:
 *
 *   This program has been tested with Keil C51 V7.50.
 *
 * $Revision: 1 $
 *
 *==============================================================================
*/
#include &amp;lt;Nordic\reg9e5.h&amp;gt;

#define WRTCLAT 0x0A;

static void InitRTC(void)
{   
	while ( REGX_CTRL &amp;amp; 0x10);		// Write: Wait until REGX_CRTL.4 == 0 (i.e. not busy) 
	REGX_MSB = 0x3;					// RTC interrupt every 1 S.
	REGX_LSB = 0xe8;
	REGX_CTRL = WRTCLAT;

	while ( REGX_CTRL &amp;amp; 0x10);		// Write: Wait until REGX_CRTL.4 == 0 (i.e. not busy) 

	EWDI = 1;						// Enable the RTC timer interrupt.
}

void RTCISR (void) interrupt 12
{
	P0 ^= 0x01;						// Toggle LED.
	WDTI = 0;						// Clear the RTC interrupt.
}

void Init(void)
{
	P0_DIR = 0x20;					// P0.5 is an input, the rest are outputs.

	InitRTC();
	EA = 1;							// Enable Interrupts.
}

void main(void)
{
	Init();

	while(1);
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9E5 RTC &amp; GPIO  Wake Up...</title><link>https://devzone.nordicsemi.com/thread/161117?ContentTypeID=1</link><pubDate>Tue, 11 Dec 2018 07:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb3a04ef-da76-48a8-9ecc-b174f76d4ca2</guid><dc:creator>TeeGu</dc:creator><description>&lt;p&gt;Thaks for your responce.&lt;/p&gt;
&lt;p&gt;The main problem is that GPIO wakeup also triggers the RTC interrupt. What I like to have is that RTC interrupt lives completely its own life. No RTC interrupt action when GPIO interrupt occurs&amp;hellip;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9E5 RTC &amp; GPIO  Wake Up...</title><link>https://devzone.nordicsemi.com/thread/161035?ContentTypeID=1</link><pubDate>Mon, 10 Dec 2018 14:46:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4aabd688-0751-425a-ba6d-8af08680b703</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;There have been no update to the nRF9E5 for the last 12-15years, so I doubt we can prioritize investigation on this specific request. I did find an old example, unfortunately it only show how to setup wakeup on RTC and pin, not check the actual reset source. However maybe it still can be useful for others.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; 

/*=====================================================
*
* Copyright (C) 2006 Nordic Semiconductor
*
* This is distributed in the hope that it will be useful, but WITHOUT
* WARRANTY OF ANY KIND.
*
* Author(s): KME 
*
* DESCRIPTION: Powerdown and wakeup demonstration.
* Powerdown start on press on P01 (SW1).
* Wakeup after 3s or on press on P03 (SW2).
* Blink all LED 2 times on wakeup.
*
*====================================================*/

#include &amp;lt;Nordic\reg9e5.h&amp;gt;

void init(void)
{
IE |= 0x80; 
// Table 37 IE Register – SFR 0xA8 
// Enables interrupt
EIE |= 0x10; 
// Table 41 EIE Register – SFR 0xE8 
// Enables wakeup interrupt.
P0_ALT = 0x00;
P0_DIR = 0xAA;
}

void delay(volatile unsigned char n)
{
unsigned char i;
while(n--)
for(i=0;i&amp;lt;175;i++)
;
}

void wakeup_blink(void)
{
P0 &amp;amp;= 0xAA; 
delay(250);
P0 |= 0x55; 
delay(250); 
P0 &amp;amp;= 0xAA; 
delay(250);
P0 |= 0x55;
// Blink all LED 2 times on wakeup
}

void powerdown(void)
{
// This part will initialize wakeup after 3s
TICK_DV = 0x03; // Init value -&amp;gt; 1ms tick
while(REGX_CTRL &amp;amp; 0x10) // Wait until not busy
;
REGX_MSB=0x00;
REGX_LSB=0x00;
REGX_CTRL=0x09; // Address 1001b -&amp;gt; WGTIMER
while(REGX_CTRL &amp;amp; 0x10)
; 
REGX_MSB=0x0B;
REGX_LSB=0xB8;
REGX_CTRL=0x0A; // Address 1010b -&amp;gt; WRTCLAT
while(REGX_CTRL &amp;amp; 0x10)
; 

// This part will initialize wakeup on keypress on P03 (SW2)
REGX_MSB=0xC0; 
REGX_LSB=0x00;
REGX_CTRL=0x0C;
while(REGX_CTRL &amp;amp; 0x10) 
;

CK_CTRL = 0x04; // Enter power down
}

void main(void)
{
init();

while(1)
{ 
if(P01==0) // Start powerdown if P01 (SW1) is pressed
{
while(P01==0)
; 
powerdown(); // Wakeup after 3s or on keypress on P03 (SW2)
wakeup_blink(); 
}
}
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>