Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 1 month ago.
How to fire interrupt, when WPM goes from 0 to 1?
Hi,
may be a strange question; but how can I trig an interrupt when the PWM value goes from lo level to hi (or vice versa)? One option is to hard wire the PWMout pin with a InterruptIn pin, but I belive that there should be also an software way to do it. I would be grateful for any hint.
RGDS
1 Answer
10 years, 1 month ago.
Hi, there's no method which would allow you to do it in the PWM class. Would this help http://developer.mbed.org/users/pHysiX/code/PwmInRC/ ?
You can do what you proposed, using InterruptIn class.
Regards,
0xc0170
Hi, thank you for your response. The lib you suggest is not exactly what I'm looking for. Maybe I should mess around TOP value of PWM timer - to check when the TOP value is reached? Otherwise I will hardwire the PwmOut to an interrupt input pin. That should be the simplest way. Thank you anyway.
RGDS
posted by 30 Oct 2014