Page 1 of 1

PWM on any pin

Posted: Fri Sep 07, 2018 2:06 am
by rhubarbdog
hi,
I'm following the example <a href="http://docs.micropython.org/en/latest/p ... ">here.</a> it all works well.
When i try to move it to new pin say X8 i run into problems.
I change timer to one on pin X8 but the channel on some is indicated as 1N, how do i present this identifier to pyb.Timer.channel ? which takes a (positive?) integer as it's first argument.
changing the first couple of lines to read
<code>
tim = pyb.Timer(8, freq = 100)
tchannel = tim.channel(1, pyb.Timer.PWM,
pin=pyb.Pin.board.X8, pulse_width = 0)
</code>
results in a flashing LED at about 1-2Hz, which i know isn't good as it should be channel 1N

Re: PWM on any pin

Posted: Fri Sep 07, 2018 5:03 am
by dhylands
Channel 1N is channel 1, but the output is a negated version of channel 1.

Re: PWM on any pin

Posted: Wed Jul 29, 2020 9:59 am
by fillofonta
hy, how do i use the negated channel? i need it in order to use a big BLDC motor that doesn't have a driver, i'm using a nucleo-f767zi
PS: how do i make a new post? I can't figure that out...