cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get Timer8 Compare to toggle an output pin?

LMorr.3
Senior II

Working with TIM8; I have enabled one-time-pulse, set 'Channel1' to 'Output Compare CH1', set the Output Compare Channel 1 Mode to 'Active Level On Match', and Pulse to 0. I set the timer's ARR = 65535, and set the Compare Register to 20000. I have PC6 set as TIM8_CH1 Alternate function but do not see that pin toggling when I run the timer and CNT matches 20000. Any ideas on what I could be doing wrong?

Thanks!

2 REPLIES 2

Which STM32?

TIM8 is an Advanced Timer, you have to​ set TIM8_BDTR.MOE.

JW​

Thanks, that did the trick!

Now I have another minor issue: I have it set to one time pulse mode, and the output pin stays high when the timer's CNT register wraps back to 0. I would like the pin to go high for the CCR1 period ( MODE 1 ) and then go low. Do I need to set the pin low manually?