[KW36] Which low power mode supports RTC_CLKOUT?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[KW36] Which low power mode supports RTC_CLKOUT?

Jump to solution
1,471 Views
ayden
Contributor II

Dear NXP support,

When I checked RTC_CLKOUT with FRDM-KW36 board, it did not work normally in low power mode.

The test environment and results are as follows.

Board : FRDM-KW36

Source : frdmkw36_wireless_examples_bluetooth_hrs_freertos + frdmkw36_driver_examples_rtc

Modified Source: 
#define mNoOfPinsDisabledInLowPower_c (15) //Modify

const gpioPinId_t maPinsDisabledInLowPower[mNoOfPinsDisabledInLowPower_c]={
{gpioPort_A_c, 16},
{gpioPort_A_c, 17},
{gpioPort_B_c, 1},
{gpioPort_B_c, 2},
//{gpioPort_B_c, 3}, //Modify
{gpioPort_C_c, 0},
{gpioPort_C_c, 1},
{gpioPort_C_c, 3},
{gpioPort_C_c, 6},
{gpioPort_C_c, 7},
{gpioPort_C_c, 16},
{gpioPort_C_c, 17},
{gpioPort_C_c, 18},
{gpioPort_C_c, 19},
{gpioPort_A_c, 0},
{gpioPort_A_c, 1}
};

 

void BOARD_InitPins(void) {
CLOCK_EnableClock(kCLOCK_PortB); /* Port B Clock Gate Control: Clock enabled */
PORT_SetPinMux(PORTB, PIN3_IDX, kPORT_MuxAlt7); /* PORTB3 (pin 19) is configured as PTB3 */
}


void BOARD_ReInitPins(void)
{
BOARD_InitPins();
}


void BOARD_WarmbootCb()
{
...
BOARD_ReInitPins();
}


void BOARD_RTCInit(void)
{
rtc_datetime_t date;
rtc_config_t rtcConfig;

BOARD_InitPins();
RTC_GetDefaultConfig(&rtcConfig);
RTC_Init(RTC, &rtcConfig);
#if (defined(EXAMPLE_CAP_LOAD_VALUE) && EXAMPLE_CAP_LOAD_VALUE)
#if (defined(FSL_FEATURE_RTC_HAS_OSC_SCXP) && FSL_FEATURE_RTC_HAS_OSC_SCXP)
/* Change the RTC oscillator capacity load value. */
RTC_SetOscCapLoad(RTC, EXAMPLE_CAP_LOAD_VALUE);
#endif /* FSL_FEATURE_RTC_HAS_OSC_SCXP */
#endif /* EXAMPLE_CAP_LOAD_VALUE */

/* Select RTC clock source */
RTC_SetClockSource(RTC);

/* Set a start date time and start RT */
date.year = 2014U;
date.month = 12U;
date.day = 25U;
date.hour = 19U;
date.minute = 0;
date.second = 0;

/* RTC time counter has to be stopped before setting the date & time in the TSR register */
RTC_StopTimer(RTC);

/* Set RTC time to default */
RTC_SetDatetime(RTC, &date);

/* Enable RTC alarm interrupt */
RTC_EnableInterrupts(RTC, kRTC_AlarmInterruptEnable);

/* Enable at the NVIC */
EnableIRQ(RTC_IRQn);

/* Start the RTC time counter */
RTC_StartTimer(RTC);
}

 

void main_task(uint32_t param)
{

...

LED_Init();

BOARD_RTCInit();

}

 

1) cPWR_DeepSleepMode 4/5/8 

=> Not working

2) cPWR_DeepSleepMode 3

 2-1) Idle state

=> 1Hz output

llvs_idle.PNG

 2-2) Advertising state

==> 1 Hz output, square wave not normal

llvs_advertising.PNG

 

Please check if 1Hz square wave can be used through RTC_CLKOUT in low power mode.

Best regards,

Ayden Hong

 

Labels (1)
0 Kudos
Reply
1 Solution
1,452 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @ayden

Hope you are doing well.

According to the Bluetooth Low Energy Demo Applications User Guide (inside KW36 SDK documentation folder > docs > wireless > Bluetooth), the application should switch between LLS and VLLS power modes by default.

KW38 Reference Manual, Section 8.5 Module Operation in Low Power Modes describes modules/clocks availability depending on the power mode.

EduardoZamora_0-1671221744174.png

In LLS and VLLS power modes, RTC should be fully functional with alternate clock source, provided the selected clock source remains enabled:

EduardoZamora_1-1671221744176.png

Could you please take a look at KW36 - Trimming adjust of 32kHz RTC external oscillator and confirm if this is helpful for your application? Also, please consult Kinetis MKW36 Power Consumption Analysis, here you can find how the hardware is designed and optimized for low-power operation and the expected behavior of BLE applications and the device under low-power modes (Section 4.2.2 shows a partial scenario using HRS demo and describes the main events and phases).

Regards,
Eduardo.

View solution in original post

0 Kudos
Reply
3 Replies
1,453 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hello @ayden

Hope you are doing well.

According to the Bluetooth Low Energy Demo Applications User Guide (inside KW36 SDK documentation folder > docs > wireless > Bluetooth), the application should switch between LLS and VLLS power modes by default.

KW38 Reference Manual, Section 8.5 Module Operation in Low Power Modes describes modules/clocks availability depending on the power mode.

EduardoZamora_0-1671221744174.png

In LLS and VLLS power modes, RTC should be fully functional with alternate clock source, provided the selected clock source remains enabled:

EduardoZamora_1-1671221744176.png

Could you please take a look at KW36 - Trimming adjust of 32kHz RTC external oscillator and confirm if this is helpful for your application? Also, please consult Kinetis MKW36 Power Consumption Analysis, here you can find how the hardware is designed and optimized for low-power operation and the expected behavior of BLE applications and the device under low-power modes (Section 4.2.2 shows a partial scenario using HRS demo and describes the main events and phases).

Regards,
Eduardo.

0 Kudos
Reply
1,442 Views
ayden
Contributor II

Hello Eduardo Zamora,

 

Thank you for your reply.

I've already read all the documents you told me.

What I want to know is whether RTC_CLKOUT is not available in VLLS[1/2/3] mode.

And is there a way to prevent the signal of RTC_CLKOUT from shaking when switching to the wake-up state?

 

Regards,

Ayden.

 

 

0 Kudos
Reply
1,431 Views
EduardoZamora
NXP TechSupport
NXP TechSupport

Hi,

RTC remains functional in all low power modes, but please consider that PTB3 is connected to LED3 and this LED is used by BLE demos as indicator for some application states. The code may be configuring PTB3 as GPIO for this purpose and continuously modifying the state of the pin.

Please, take a look at LED_Init() function, inside ApplMain.c, this function configures pin routing for LED pins.

Regards,
Eduardo.

0 Kudos
Reply