Hi Radek,
Thanks for your reply.
Please find the answer for your questions.
- Did you enable watchdog?
Ans: Yes.
- How do you trigger watchdog?
Ans: Watch dog is served to ATM 6628. If ATM 6628 is not receiving with in around 150ms after it transfer, it will resets MCU.
- Which clock source is selected for watchdog?
Ans: I am using internal oscillator during Sleep mode.
CPMUPROT_PROT = 0;
CPMUCLKS_PLLSEL = 0;
CPMUPOSTDIV = 0x03;
CPMUOSC_OSCE = 0;
- How did you wake-up your MCU from stop mode?
Ans: I am using LIN interrupt and other 3 I/O interrupt (Total 4) for Wakeup from STOP mode. MCU is not resetting for I/O interrupts Wake up but it is resetting for LIN interrupt Wakeup.
Note: Following is the configuration I am using in my function 1 and Function 3:
{
/* disable SPI interrupt */
SPI0CR1_SPIE = 0u;
/* disable ADC interrupt */
ATDCTL2_ASCIE = 0u;
/* disable CLOSE_OVP_FET interrupt */
PIE1AD_PIE1AD1 = 0u;
/* Set micro into pseudo stop mode */
CPMUCLKS_PSTP = 1u;
CPMUCLKS_PRE = 0u;
/* Set API clock*/
CPMUAPICTL_APIFE = 0u;
CPMUAPICTL_APICLK = 0u;
CPMUAPICTL_APIEA = 0u;
CPMUAPICTL_APIES = 1u;
/* Clock configuration */
CPMUAPIRL = 0xFFu;
CPMUAPIRH = 0xFFu;
/* Enable API */
CPMUAPICTL_APIE = 1u;
CPMUAPICTL_APIFE = 1u;
/* Enable edge detect to wakeup on LIN Rx */
SCI0SR2_AMAP = 1u;
SCI0ACR1_RXEDGIE = 1u;
SCI0SR2_AMAP = 0u;
/* Enable internal clock source */
//Enable_Internal_Osc();
/* Place LIN transceiver in "sleep" mode */
/**/
PT1AD_PT1AD4 = 1u;
DDRS_DDRS1 = 1u; /* configure TXD as an output */
PTS_PTS1 = 1u;
PT1AD = 0u; /* falling edge of EN pin */
SCI0CR2_TE = 0u; /* re-enable TXD */
SCI0CR2_RE = 1u; /* re-enable RXD */
/* Skip going to sleep if a wakeup happens before we stop, but after we checked before */
if ( (!Get_LIN_Wakeup())
&& (!Get_OC_Wakeup())
&& (!Get_Charger_On_Wakeup())
&& (!Get_HW_OVP_Wakeup())
)
{
/* disable RTI interrupt */
CPMUINT_RTIE = 0u;
Enable_Internal_Osc(); /* Enable internal clock source */
asm andcc #$7f
asm STOP
}
}
Kindly let me know any of my configurations is wrong for LIN Wakeup.
Thanks and Regards,
Hareesha.