I'm reducing eCAP interrupts at higher speed by dynamically changing the prescaler value on the fly and doing the appropriate capture register scaling.
My position seems to be drifting however and I wonder if it's happening when changing the prescaler.
Does the prescaler zero itself out when changed and do you get the proper scaling on the first transition after or does it freerun and it takes one sample before everything gets in sync?
Thanks
Emil,I understand that you have found an interim workaround and restructured how you do the processing so it doesn't require changing the divider.After having some internal discussion on this we would like to understand what problem is that you are trying to resolve. There may be another method to achieve what you need.We would have to dig into this a big deeper, but when changing dividers it may actually take a few cycles for everything to smooth out in most cases. It seems it would also depend on if you are looking at the position relative to the last value (which may have been from a different prescaler) and where the event comes relative to the change.it would be good to get this understanding from you because to answer the question on the effects of modifying the input event prescalar dynamically, a deeper understanding of the eCAP module design will be important and we cannot neccesarily take your code and run some tests. It will be faster for our design team to look at the RTL of the module and determine the behavior of when the "new" divider value takes effect.