2011-02-10 04:06 AM
PWM
2011-05-17 05:24 AM
but what do I need to do - to set the output to a constant level ( Low or High ) ?
You could always drive it as a GPIO. I haven't tried the 0, n-1 or n settings, are you seeing a pulse?2011-05-17 05:24 AM
clive1++:
At pwm value = 0 no pulses, the output line stays low (or high, if inverted). At value = max (0xFFFF) short pulses are present. The idea: 1. Init pwm GPIO output register to the state you need at pwm = max. 2. Switch pwm GPIO to AFIO to use it as pwm output. 3. As soon as the pwm value must be max, switch pwm output to GPIO - you got the output steady. Else (pwm value < max) switch pwm output back to AFIO and enjoy the pulses. 4. Do 3). in the match interrupt of the pwm channel (suggestion).