_time_delay_ticks() off by a factor of 10 K64 Freedom MQX 4.1.1

cancel
Showing results for 
Search instead for 
Did you mean: 

_time_delay_ticks() off by a factor of 10 K64 Freedom MQX 4.1.1

279 Views
razed11
Contributor V

When using _time_delay_ticks(10) I'm measuring 500 ms.

BSP_ALARM_FREQUENCY is 200 and when I call _cm_get_clock_configuration it returns BSP_CLOCK_CONFIGURATION_120MHZ.

0 Kudos
3 Replies

76 Views
razed11
Contributor V

Sorry folks. A downstream error on my part. All is well as Radek confirmed.

K

0 Kudos

76 Views
RadekS
NXP Employee
NXP Employee

I tested _time_delay_ticks(10) on my FRDM-K64F board and everything works correctly.

I measured 50ms – this fits to 10 tics per default 5ms.

I guess that you edit your clock settings and your MCU running ten times slower or you define somewhere different value of BSP_ALARM_FREQUENCY.

Default vale of BSP_ALARM_FREQUENCY is defined in frdmk64f.h file. This definition is used only in case when you didn’t define your own value (for example in user_config.h file).

Please search all instances with BSP_ALARM_FREQUENCY definition. When you don’t find anything wrong, please focus on your clock settings.


Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

76 Views
razed11
Contributor V

I actually didn't modify the clock settings or the BSP in any way except to take enable SWO. Thanks for verifying that it can work properly. I'll take a closer look.

0 Kudos