• My first guess is that this may have been a casualty of the switching-around of which timers were used for which pins to prevent analogWrite() on different pins from fighting with eachother.

    B3 is on TIM_2, while B4/5 are on TIM3, which can also be used on A6,A7,B0,B1 - possibly the Espruino is not switching the timer to B4,B5,C8,C9.

    In the past, the Espruino chose which timers to use for which PWM pin in an almost perverse manner, resulting in timers fighting with eachother. I think in his fix for this, Gordon tightened the logic around which timer would be used on a pin with multiple timers. Maybe he set TIM_3 to always be on A6,A7,B0,B1?

    (iirc, I advocated making A6-B1 always use TIM_3, on the grounds that B4/5 were usually going to be used for network connectivity anyway, and C8/9 have TIM_8 (C6/7/8/9), so better to get reliable PWM that's guaranteed not to fight with other PWM on 4 pins (A6/7, B0,1) than on 2 (B4/5) that will often be used for something else anyway. )

    Of course, if you're trying to do PWM on one or more of the pins A6/7,B0/1, AND B4/5, that's not expected to work, because you can't have a timer on two banks of pins at once.

    I recommend your first-line banks of pins for PWM be - C6-9 (TIM_8, 5v tolerant, and can't do anything other than GPIO and PWM), A0-A3 (TIM_5) is good and on mostly useless pins too. A6-B1 (TIM_3) and B6-9 (TIM_4) should also work without issues, though they're on more useful pins.

    A8 works. I don't know if you still need to poke() a register to get UART1 off of A9/10 to use those. Finally, there's B3/B10/B11, with TIM_2, but all those pins are fancy pins with other useful functions.

About

Avatar for DrAzzy @DrAzzy started