AnsweredAssumed Answered

_time_delay in low power clock configurations (CW10/MQX/Kinetis)

Question asked by TugboatCaptain on Mar 14, 2013
Latest reply on Mar 22, 2013 by TugboatCaptain

Should the _time_delay function cause a task to sleep for roughly the same duration in any clock mode and/or in VLPR mode?

 

i.e. should the following _time_delay calls all delay for approximately the same amount of time?

 

    _time_delay(10);

    _lpm_set_clock_configuration(BSP_CLOCK_CONFIGURATION_2MHZ)

    _time_delay(10);

    _lpm_set_operation_mode(LPM_OPERATION_MODE_WAIT)  //VLPR

    _time_delay(10);

    _lpm_set_operation_mode(LPM_OPERATION_MODE_RUN)

    _time_delay(10);

    _lpm_set_clock_configuration(BSP_CLOCK_CONFIGURATION_DEFAULT)

    _time_delay(10);

 

(actual code does check for error returns, question assumes no other ready tasks, BSP_ALARM_FREQUENCY==200 so it is understood delay resolution is 5ms)

 

It seems like the systick_config() call within _bsp_set_clock_configuration() does this compensation for the clock configuration.  And it appears _lpm_set_operation_mode keeps idle task from hanging.

 

note: I am using CW10.2 and MQX3.8  with Kinetis k60f and I understand from the MQX4.0 release notes there are known prior code issues with VLPR, but I need to know if by design the time delay should stay consistent in these modes.

 

Thanks.

Outcomes