Hi,
I'm using PWM on a STM32L1 to generate 38kHz infrared pulse-trains. I use the PWM callback to determine how many pulses have been output, then disable the channel for a cool-down period and set a GPT timer for a few hundred uS to re-enable the channel.
What I am noticing, and I think it is by design, is that when a PWM channel is disabled, that seems to only mean that the output pin (controlled by the DIER register) is disabled. It seems that my channel callback is still being called even when the channel is disabled.
I saw a post that there may be an addition to the 3.2 release to give users the option to disable callbacks. Do I have any options in the current 2.6 series? The only thing I can determine is turning the whole PWM driver off globally (well, also having logic in my callback to determine if it should act or not).
Thanks,
Dave
PWM Driver
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: PWM Driver
3.0 already allows to enable/disable callbacks at runtime without stopping the driver.
Giovanni
Giovanni
Re: PWM Driver
Ahh, I guess it is time to think about porting to 3.0.
I notice there aren't I-Class functions for enabling/disabling the callbacks in the API. Is this planned? Or am I designing poorly by wanting to do this from within a GPT callback context?
Dave
I notice there aren't I-Class functions for enabling/disabling the callbacks in the API. Is this planned? Or am I designing poorly by wanting to do this from within a GPT callback context?
Dave
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: PWM Driver
Good point, I will add the I-class functions too. You may call the low level in the meanwhile.
Giovanni
Giovanni