Skip to main content
FFuma
Associate
October 31, 2018
Question

Disabling a timer after PeriodElapsedCallback is called

So I have two timers, one in OC mode and one in IC mode. The IC waits until the OC toggles, it registers the value and waits for it toggle again to record a second value. What I want to do is after the OC timer has toggled twice is for it to disable (basically I want that timer to run once). I tried disabling it by disabling it's clock instide the PeriodElapsedCallback function but things get messy, I'm pretty sure it never returns from the callback if I do it that way.

My question is, what's the proper way of stopping a timer after it's finished counting from 0->Period?

This topic has been closed for replies.

1 reply

Khouloud GARSI
ST Employee
November 1, 2018

Hello @FFuma​ ,

You have to enable the One Pulse Mode. This will disable the timer after reaching the period value.

Khouloud.