2020-09-16 06:55 AM
I have to control several LED signals via PWM (up to 16), whose voltage and current can be above the max 5v tolerant and 20-25ma max current GPIO pins. These LED's can change and are not constant. Meaning they have different voltage and current requirements.
Was already using a digital pot with boost converter to handle the voltage requirements. But for sourcing was thinking then using a BJT to control each led, but because the led's can change, they require different resistor values attached to ground, so digital pot seemed like I good fit but to have 16 digital pots would mean I need 18 lines to control the digital pot (If SPI) and another 16 for PWM, is there another alternative to this setup I propose?
2020-09-16 09:17 AM
Digital pots have limited current capacity. Be sure you don’t exceed that.
there are a lot of constant current LED driver chips out there. I would use one of those instead.
I2C would be better than SPI here if you go with digital pots.
2020-09-21 12:21 AM
Thanks so much! This really helped a lot. @TDK why would I2c be better in this case?
2020-09-21 01:15 AM
With SPI I guess you're thinking of a separate select for each pot. I2C devices can often have different addresses, often pin-selectable.
But you don't need a separate select for each SPI device. You could mount several in series and clock the data to that group of them in order.
Or, as old-timers like me will remember, you might use the modern equivalent of a 74LS138 to have 3 "address" lines to select which of 7 or 8 SPI devices you next want to select.
Regards,
Danish
2020-09-21 06:48 AM
Right I see you save on pins by using i2C, but there is no other significant advantage.
2020-09-21 06:54 AM
Needing 2 lines instead of 18 seems like a fairly significant advantage in itself.
2020-09-23 08:31 AM