Add PWM timers to a microcontroller externally

microcontrollerpwmtimer

I'm doing a project involving an LED matrix, and using PWM timers to be able to control the brightness. My microcontroller has 3 timers, and I need 4.

Is there a PWM timer circuit, perhaps using a 555 that I can connect outside the microcontroller to effectively add PWM timer?

I've seen this question, whose answers recommend servo drivers for PWM. However, I'm unsure how to use this to drive my LED's, as their output is for 3-wire servos. Looking at this pinout, would I just attach the signal wire to my LED(s)?

I'm also curious if there's a simpler circuit I could use to do this, if GPIOs are at a minimum (if I want to use one pin instead of the two that i2c would require). Alternatively, could I possible use a SIPO shift register to communicate over i2c with the servo module, using only one GPIO pin?

edit: Sorry, it's late, I just realized that using a shift register would use more pins than just using i2c would. maybe use some kind of i/o expander so that pins are no longer at a premium?

Best Answer

Yes, external PWMs can be added.

In fact, there are I/O expanders intended for LEDs where each output has its own PWM channel. The expander is controller through I2C.

PCA9532, MAX7313, for example. There is no shortage of LED drivers like that. Those datasheets will give you some keywords to find more.

There are also ICs specifically for driving segmented LED displays and matrices. I had some success with AS1115.