Hi John,
Let me clarify it.
According to your reply. the function Enter_Power_Save(void) can put the MCU enter the LLS mode with a 4 micro amp code if prior to remove the shutDownIO() , and however the consumption will increase too much after add the shutDownIO() in the the function Enter_Power_Save(void).
Does it correct?
void Enter_Power_Save(void)
{
shutDownIO();
while(1){
enter_lls();
//
// Do a partial restoration of I/O, enough to read the state of /ACOK
//
SIM_SCGC5 |= SIM_SCGC5_PORTB_MASK;
PORTB_PCR7 |= (uint32_t)(PORT_PCR_MUX(MUX_GPIO)); // nACOK
Delay_ms(200);
if(RUNNING_FROM_BATTERY){
//
// If we're still running on battery, shut down I/O port B, go back to sleep
//
PORTB_PCR7 &= ~(uint32_t)(PORT_PCR_MUX(MUX_MASK)); // nACOK
SIM_SCGC5 &= ~(SIM_SCGC5_PORTB_MASK);
} else {
//
// Looks like AC power is restored, exit this loop...
//
break;
}
}
}
Have a great day,
Ping
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------