Read/write latency while dynamically adjusting counter phase
I want to be able to continuously adjust the phase of a timer output via input capture on another signal. I do not want the timer to be automatically triggered or reset by the external signal because I want some processing in the loop to determine how to react to the input capture value. The course I am taking right now is to adjust TIMx->CNT. The problem is that I am experiencing somewhat nondetermistic delays in reading/writing the count at my desired timer clock frequency such that something like TIMx->CNT-- or even TIMx->CNT = TIMx->CNT actually adjusts the phase by 8-12 counts based on input capture and scoped output. Is there a better way to more deterministically down- or up- adjust the timer count than essentially reading and writing back the CNT value?
