I'm trying to get LPUART to work while CPU is in VLPS mode. I'm using the following code
CLOCK_EnableClock(kCLOCK_PortD);
PORT_SetPinMux(PORTD, 2U, kPORT_MuxAlt6);
PORT_SetPinMux(PORTD, 3U, kPORT_MuxAlt6);
CLOCK_SetLpuartClock(2U);
oscer_config_t oscerConfig;
oscerConfig.enableMode = kOSC_ErClkEnable | kOSC_ErClkEnableInStop;
oscerConfig.erclkDiv = 0;
OSC_SetExtRefClkConfig(OSC0, &oscerConfig);
lpuart_config_t config;
LPUART_GetDefaultConfig(&config);
config.baudRate_Bps = 115200;
config.enableTx = true;
config.enableRx = true;
LPUART_Init(LPUART0, &config, CLOCK_GetFreq(kCLOCK_Osc0ErClk));
LPUART_EnableInterrupts(LPUART0, kLPUART_RxDataRegFullInterruptEnable);
EnableIRQ(LPUART0_IRQn);
This only works while by debugger is connected and CPU is prevented from going to stop mode. If i enter stop mode, its not getting interrupts anymore. Are there any code examples that i can refer to?
Hi
See https://community.nxp.com/message/421247#421247
Regards
Mark
>
oscer_config_t oscerConfig;
oscerConfig.enableMode = kOSC_ErClkEnable | kOSC_ErClkEnableInStop;
oscerConfig.erclkDiv = 0;
This is enough?
OSC_SetExtRefClkConfig(OSC0, &oscerConfig);
Is the external Osc configured to work in the low power mode?
Which all power modes can the LPUART work? I was trying with VLPS which does not work, nor with Stop mode with "kSMC_PartialStop". It only works with "kSMC_PartialStop1" but by then the power consumption is very high(20mW vs <4mW)