9 years, 7 months 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

9 years, 7 months 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

Accepted Answer

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 Gorazd Rosbach 30 Oct 2014