GetTime

TIM Get Time BLOCK

This block supports time measurement using Timer peripheral on STM microcontrollers.

Contents

Inputs

None

Outputs

  • TimeDiff – time difference between sequent executions of the block
  • Timer counter – actual timer counter value

Block parameters

  • Get time difference – choose time unit and timer (timebase source is used for miliseconds unit)
  • Enable output tick – enable timer counter block output
  • Timer – timer peripheral number
  • Timer clock (MHz) – timer base clock

CubeMX settings

  • Below settings apply only if chosen time unit is microseconds!
  • Timers->TIMx->Clock Source->Internal clock
  • Timers->TIMx->NVIC Settings Tab->TIMx global interrupt/TIMx update interrupt