Hi,
I will give you a thougnt to measure the duty. Configure a gpio as a external interrupt source. The rising edge and falling edge is active. When the PWM's rising edge comes, we start the PIT. When the PWM's falling edge comes, we stop the PIT. Calculate the difference. Then the results is multiplied by the PIT's period. It is the high level duration. If you set the gpio that the rising edge only is active, you will get the PWM's period. We have the high level duration and PWM's period. Then we can calculate the duty.
Have a great day,
TIC
-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------