2025-03-05 12:50 PM - edited 2025-03-05 12:51 PM
Hello
Need help, need to set PWM in a one pulse mode, so that at start timer there would be a low level output for a time equal to value of CCRx, after compare the output would be change to a high level and would remain so after overflow and stopping the counter.
Now I use PWM Mode 2 and active high level (tried PWM Mode 1 and active low level), as a result, after the counter stops, the output goes to low level, as shown on the screenshot:
2025-03-05 3:27 PM
Set up the timer so the pulse is high when CNT = 0 and low when CNT >= 1 (so CCRx = 1), then adjust ARR for the length of pulse you want. You will have 1 count of delay before the pulse starts.
2025-03-06 1:36 AM
Do I still need to set the channel as PWM mode for this?
In fact, I can't understand why there is a high level before the start timer, and a low level after the counter overflow, i.e. the timer tries to form the next period, but it is stopped and the stop occurs when the output is at a low level.