Timer usage
Timer usage
Hello,
I am trying to use the timer functionality on Y11/B0 and I don't seem to get it to work as on other pins.
t = pyb.Timer(1, freq=1000, mode=pyb.Timer.CENTER)
ch2 = t.channel(2, pyb.Timer.PWM, pin=pyb.Pin.board.Y11, pulse_width=(t.period() + 1) // 2)
The datasheet shows: PB0: TIM1_CH2N, TIM3_CH3, TIM8_CH2N
I think there is some configuration issue with inverted timer channels (TIM1_CH2N).
Did someone try this on Y11?
I am trying to use the timer functionality on Y11/B0 and I don't seem to get it to work as on other pins.
t = pyb.Timer(1, freq=1000, mode=pyb.Timer.CENTER)
ch2 = t.channel(2, pyb.Timer.PWM, pin=pyb.Pin.board.Y11, pulse_width=(t.period() + 1) // 2)
The datasheet shows: PB0: TIM1_CH2N, TIM3_CH3, TIM8_CH2N
I think there is some configuration issue with inverted timer channels (TIM1_CH2N).
Did someone try this on Y11?
Re: Timer usage
I've never tried the inverted channels. There is probably some additional setup that needs to be done.
Yeah - I see that there are separate functions in the HAL for turning out complimentary Output Compare and PWM modes.
Yeah - I see that there are separate functions in the HAL for turning out complimentary Output Compare and PWM modes.
Re: Timer usage
Do you think this could be an easy fix?
If not please let me know. Thanks.
If not please let me know. Thanks.
Re: Timer usage
I've got something coded up and it seems to be working. It needs some more testing.
Re: Timer usage
ok great. I will be waiting for your changes. Thank you.
Re: Timer usage
I created https://github.com/micropython/micropython/pull/900 if you want to try it out before it gets merged.