MM9Z1_J638 Wake from STOP Reason

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MM9Z1_J638 Wake from STOP Reason

710 Views
mike_sims
Contributor IV

Hello,

I am leveraging the Demo Project MM9Z1J638-Demo-APPSW.zip provided by NXP and am trying to add Low Power Modes.

I have added a STOP method (attached)

What I am finding is a great many times when the micro wakes, the WakeUpReason / B_PCR_SR is 0x0000.   I do not see anywhere in the D2D IRQ (or any other IRQ's) where B_PCR_SR is cleared, so I am confused by the differing results on wake.   Also, I am wanting to take some action based on the reason for waking, and the unknown reason is throwing me a curve.

Is there something I am missing in the prep for STOP or need to do in the wakeup to make the data in the B_PCR_SR more reliable??

Thanks in advance for your suggestions....

0 Kudos
2 Replies

673 Views
Q_man
NXP Employee
NXP Employee

Hi, I did reply to this thread yesterday, but its somehow lost!!! Sorry for that.

Let me try to recapture....

The PCR_SR should indicate the reason for the wakeup. If its not (= 0x0000) something is wrong. I expect some configuration is wrong and e.g. the device does not enter STOP mode and therefor no wakeup is indicated.

One specific issue with the software sent is that the following statement should be done when the TEN = 1: (please see //xx)

void WakeUpTimerInit(void)
{
	/* TIMER CLK 
	 * 
	 * When in STOP or SLEEP mode, this timer is clocked by ALFCLK
	 * ALFCLK is configured to be 1khz (1mS)
	 * 
	 */
	
	// PTB2 must be set to output
	B_GPIO_CTL = GPIO_CTL_PTB2_OUTPUT;

	// route Timer OC3 to PTB3
	B_GPIO_OUT2_TCOMP3 = 1;  

	// set Timer Ch3 to OC
	B_TIOS_IOS3 = 1;

	// force internal PTB3 to low
	B_TSCR1_TEN = 1;
	B_TCTL1 = 0x80;							// set OC3 for Falling 
	B_CFORC_FOC3 = 1;          				// force OC on OC3
//xx clearing must be done with TEN = 1	
	B_TFLG1_C3F = 1;						// Clear Irq Flag
	B_TSCR1_TEN = 0;
	 
	// setup a rising edge in 10s
	B_TCTL1 = 0xC0;							// set OC3 for Rising

	B_TC3 = B_TCNT + 10000;          		// reload 10s
//xx	B_TFLG1_C3F = 1;						// Clear Irq Flag

}

 

 

0 Kudos

690 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello,

It seems like the issue has been discussed privately already.

 

BR, Daniel

 

0 Kudos