Unpredicted wake up after sleep MC9S12ZVLRMV1

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

Unpredicted wake up after sleep MC9S12ZVLRMV1

Jump to solution
740 Views
thexeno
Contributor I

Hi,
I am using this MagniV for a LIN application, in which shall go in standby (stop mode) when no traffic is present for few seconds.

In this condition, the MCU wakes up when a wakeup LIN condition is present on the bus (issuing a dominant bit for more than 150us).

 

Currently, most of the times which tries to go in stop mode when the LIN bus is idle, it wakes up again even if the bus is kept idle, then goes again in stop (after verifying that the bus is idle, but this is just my logic implemented after the wake up) and then goes in stop mode (because, of course, the bus was already in idle). Then, the stop mode is kept always correctly.

 

The sleep sequence is made with the folowing data, after there is no data for more than 2 seconds:
    SCI0ACR1_RXEDGIE = 1;
    SCI0CR2_RWU = 0x01;
    asm ANDCC #0x7F; 
    asm STOP;        

Alternatively, I tried by adding

SCI0ASR1_RXEDGIF = 1;

before or after the SCI0ACR1_RXEDGIE = 1

but is hasn't changed anything.

 

I am ssuming that it is an issue due to the RXEDGE because when the MCU wakeup unexpectedly, it jumps in the RX edge interrupt. This does not happens always, for that reason I suppose it could be something like IRQ latched and unserviced.

Is there anything that I need to stop on the SCI module to avoid this?

Thanks,
Enrico

Labels (1)
Tags (3)
0 Kudos
1 Solution
510 Views
thexeno
Contributor I

Modifying it to
SCI0CR1_WAKE = 1;

SCI0ACR1_RXEDGIE = 1;
SCI0CR2_RWU = 0x01;
does not solve the problem.
But actually solve it by clearing the interrupt flag (this improves the situation also w/out setting the wake, but seems that only in 10% of cases there is a fake wakeup request). At the end of the day the main issue was due to the interrupt flag that somehow is set.

The working configuration now seems to be this one:
SCI0CR1_WAKE = 1;

SCI0ACR1_RXEDGIE = 1;
SCI0ASR1_RXEDGIF = 1;
SCI0CR2_RWU = 0x01;

View solution in original post

0 Kudos
2 Replies
510 Views
iggi
NXP Employee
NXP Employee

Hi Enrico,

 

There is a note in the MC912ZVL Family Reference Manual, Rev. 2.00 (page 537):
"With the WAKE bit clear, setting the RWU bit after the RXD pin has been
idle can cause the receiver to wake up immediately."

What is your setting of WAKE bit? There are two wakeup methods.

I assume this can be the cause of the issue you are having. What do you think?

Regards,

iggi

0 Kudos
511 Views
thexeno
Contributor I

Modifying it to
SCI0CR1_WAKE = 1;

SCI0ACR1_RXEDGIE = 1;
SCI0CR2_RWU = 0x01;
does not solve the problem.
But actually solve it by clearing the interrupt flag (this improves the situation also w/out setting the wake, but seems that only in 10% of cases there is a fake wakeup request). At the end of the day the main issue was due to the interrupt flag that somehow is set.

The working configuration now seems to be this one:
SCI0CR1_WAKE = 1;

SCI0ACR1_RXEDGIE = 1;
SCI0ASR1_RXEDGIF = 1;
SCI0CR2_RWU = 0x01;

0 Kudos