Hi,
Thanks for your reply.There is no problem disabling the timer interrupt in the application.
But there is still a problem confused me that : Do you mean when the __asm(STOP) is being executed suddenly an interrupt generated,then MCU go to stop mode failed?
STOP process //An interrupt between 1 and 6 will cause the STOP instruction to fail ?
1:(SP)-$0002 SP;
2:(SP)-$0002 SP;
3:(SP)-$0002 SP;
4:(SP)-$0002 SP;
5:(SP)-$0001 SP;
6: STOP ALL Clocks
ANDCC Description:
if the I mask bit is cleared,there is a 1-cycle delay before the system allows interrupt requests .This prevents interrupts from occurring between instructions in the sequences CLI,WAI and STOP.
I have used below programm ,it has the same problem that sometimes the the amount of current consumed is about 10Ma after receive LIN sleep command (0x3c)
void ecu_enter_sleep_mode(void)
{
SCI0ACR1_RXEDGIE = 1; /* Enable receive input active edge interrupt */
SCI0ASR1_RXEDGIF = 1;
//TIM0TIE = 0x00; //timer interrupt is enabled all the time.if i disable the timer interrupt during stop mode,MCU always work well.
port_set_low_power_mode();
DisableInterrupts; //from 0N22G ERRATA Shutdown sequence is not interruptible until STOP;
ADC0_stop_current_workaround();//from 0N22G ERRATA
ADC0CTL_0 = 0X00; //ADC is disabled
cpu_set_stop_mode(); //#define cpu_set_stop_mode() { __asm(ANDCC #0x6F); __asm(STOP); }
}