S12VR32 cannot wake up by the LIN

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

S12VR32 cannot wake up by the LIN

1,093 Views
ericka
Contributor I
         I have a question that when I use the S12VR32 ,I cannot wake up the MCU by the LIN when the MCU
is in stop mode。
 
        How can I do for it ?Do you have some code about it?
 
        Thanks ,best wishes for you!
Tags (1)
0 Kudos
Reply
4 Replies

698 Views
ericka
Contributor I

SCI0SR2_AMAP =1;
LPCR_LPE =0; //shutdown mode
LPCR_LPPUE =0; //The pullup resistor is high ohmic (330).
LPCR_RXONLY =0; // The LIN Physical Layer is not in receive only mode
LPCR_LPWUE =1; // In standby mode the wake-up feature is enabled
LPSLRM_LPDTDIS =1; // TxD-dominant timeout feature is enabled.
LPSLRM_LPSLR =0; // Normal Slew Rate (optimized for 20 kbit/s).
LPCR_LPE =1;
SCI0ACR1_RXEDGIE =1;
SCI0ASR1_RXEDGIF =1;//when I add this ,the code is ok ,but I donot know why.

PPSL_PPSL2 = 1; //rising edge interrupt
PIEL_PIEL2 = 1; //enable interrupt

asm(CLI);
asm(andcc #0x7f);
asm(stop);

LPCR_LPE =1;
SCI0ACR1_RXEDGIE =0;

lin_timeout_4s =500;
PIEL_PIEL2 = 0; //close PL2 interrupt

0 Kudos
Reply

698 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,

You need to set LPCR_LPWUE bit which will enable the receiver to pass wake-up events to the SCI.

If the LIN Physical Layer receives a dominant level longer than tWUFR followed by a rising edge, it sends a pulse to the SCI module which can generate a wake-up interrupt.

In the SCI module, set SCIACR1_RXEDGIE to enable interrupt generation on an active edge. And clear RXEDGIF flag in the SCI interrupt routine.

 

Regards,

Daniel

0 Kudos
Reply

698 Views
ericka
Contributor I

Hello Daniel,

      My code is as follows:

      


LPSLRM_LPDTDIS =0; // TxD-dominant timeout feature is enabled


LPSLRM_LPSLR =0; // Normal Slew Rate (optimized for 20 kbit/s)


LPCR_LPPUE =0; // The pullup resistor is high ohmic (330kOhm)


LPCR_RXONLY =0;// The LIN Physical Layer is not in receive only mode


LPCR_LPWUE =1;// In standby mode the wake-up feature is enabled

LPCR_LPE =1;// The LIN Physical Layer is not in shutdown mode

SCI0ACR1_RXEDGIE =1;

//PPSL_PPSL2 = 0; //falling edge interrupt
PPSL_PPSL2 = 1; //rising edge interrupt
go_sleep_cnt = 0;
PIEL_PIEL2 = 1; //enable interrupt


_asm andcc #0x7f;
_asm stop;

SCI0ACR1_RXEDGIE =0;
PIEL_PIEL2 = 0; //close PL2 interrupt

      I can awaken the mcu sometimes ,but it also will disable somtimes ,I donnot know why.

0 Kudos
Reply

698 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hi,
The SCI0ACR1 register is an alternative register.
Do you set SCISR2_AMAP = 1 before
SCI0ACR1_RXEDGIE = 1

Do you monitor ECLK frequency?
Or how do you know in which mode the MCU is?

Regards,
Daniel

0 Kudos
Reply