Hi,
I am following below application note for PWM period calculation
https://www.nxp.com/docs/en/application-note/AN5303.pdf
For PWM period calculation, single edge capture mode is used, but Timer overflow is not considered .
Could you please tell me why timer overflow is not considered?
The PWM period is calculated by : In the interrupt routine, save the value of
the CnV register into a variable and make a difference between the current value and the saved value
from the previous interrupt routine.
My understanding is when the counter reaches 65535, it then again starts counting from 0. In such a case the current counter value can be lesser than the counter value saved in previous IRQ. So the difference will become negative and incorrect. How is this incorrect counter difference handled?
解決済! 解決策の投稿を見る。
You're right. We can add a software counter to the overflow interrupt to overcome this problem.
Unfortunately, the current SDK does not support this function temporarily, so you will be prompted about the limitations of the current settings
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
You're right. We can add a software counter to the overflow interrupt to overcome this problem.
Unfortunately, the current SDK does not support this function temporarily, so you will be prompted about the limitations of the current settings
Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Thanks for the reply