K22: Example for LPUART that can work in VLPS mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

K22: Example for LPUART that can work in VLPS mode

1,658件の閲覧回数
guest253456
Contributor II

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?

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,611件の閲覧回数
mjbcswitzerland
Specialist V
0 件の賞賛
返信

1,623件の閲覧回数
guest253456
Contributor II

>

oscer_config_t oscerConfig;
oscerConfig.enableMode = kOSC_ErClkEnable | kOSC_ErClkEnableInStop;
oscerConfig.erclkDiv = 0;

This is enough?

0 件の賞賛
返信

1,630件の閲覧回数
bobpaddock
Senior Contributor III
OSC_SetExtRefClkConfig(OSC0, &oscerConfig);

Is the external Osc configured to work in the low power mode?

0 件の賞賛
返信

1,616件の閲覧回数
guest253456
Contributor II

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)

0 件の賞賛
返信