I'm in need of using Fast PWM on PB1, PB3, and PB4 for an RGB LED. I found that PB0 and PB2 are for SDA and SCL i2c communication which leaves only one hardware PWM pin. I was happy to find someone posted a solution that only needed modification of pins to make it work. The happy feeling was short lived when I discovered adding any i2c library out there causes a conflict with vectors in wiring.c from what I recall. I found that the problem seemed to be use of Timer 0 so I replaced Timer 0 with 1 and worked down the road of finding a suitable i2c library that would compile. Meanwhile I didn't realize that the Fast PWM was no longer functional due to the swapping of the Timers. The project compiled, but the RGB LED no longer lit up as it had before. I'm not able to find the cause of the issue since I don't have a debugger or an oscilloscope to troubleshoot with.
Attached are two files. One using Timer0 that worked and the other using Timer1 that fails. I'm looking for a solution that doesn't involve faking PWM since it probably will work terribly with an RGB LED.
FastPWMTimer0_NonI2CPins.ino (3.23 KB)
FastPWMTimer1_NonI2CPins.ino (3.41 KB)