cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling a timer after PeriodElapsedCallback is called

FFuma
Associate II

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?

1 REPLY 1
Khouloud GARSI
Lead II

Hello @FFuma​ ,

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

Khouloud.