Other Parts Discussed in Thread: SYSCONFIG
Tool/software:
Hi,
I need to capture a PWM's rising edge and falling edge and do something during that period time.
Right now, I use the PWM's interrupt which is triggered by both rising edge and falling edge. Because there is no way to know it is a falling edge or rising edge in the ISR, I have to maintain a variable to store the last state and toggle the state in ISR. The method might easily cause errors.
These are the other ways I can think of:
1. If there is a bit from PWM's registers can represent the PWM output (high or low), I can directly use the value of this bit;
2. If there are two interrupts from the same PWM, one of which is from PWM's falling edge and another from rising edge.
If these two methods are available, it will make things easier.
So far, I didn't find such a bit from a Timer's registers. Also didn't find there are two interrupts that can be assigned to a timer for PWM.
I am wondering if I just didn't find either one. Or these two options are not available for this MCU at all.
Can you help confirm this? Or there are other ways for this MCU to achieve this goal?
Thanks!
Crane