3
\$\begingroup\$

I'm building a robotics project where I need to control a lot of DC motors. I picked the DRV8870DDAR H-bridge motor driver chip which needs 2 PWM input signals to control the speed and direction. Since I need a lot of PWM signals, I'm thinking of driving them with a TLC59116IPWR LED driver.

Unfortunately all LED drivers I found are built to sink constant current. To turn it into a digital signal I've added a 10K pull-up resistor to the signal line. Switching the "LED" on should then sink 0.5mA (at 5V) current from the resistor and output a LOW value. See the schematic below; the PWM0A line leads to the motor drivers:

LED driver as digital PWM output

  1. My question is whether this will work fine?
  2. If not, is there any alternative I should look for?

My worry is that the 0.5mA current I need to sink to output a LOW signal is too low for the chip to work. In the recommended section it mentions 5mA minimum output current, but that seems to be the lowest constant current target I can set via the REXT resistor. I don't know how the internals of the chip works, so I'm unsure if that's a problem.

enter image description here

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Based on the 5mA curve of fig. 2 of the TLC59118 data sheet, it seems like the output will get really close to zero volts when driving a 10kΩ load. You should be fine. If you have a scope check the rise time, which can be a little too high for 97kHz (depends on the capacitance on the net). If that's the case, lower the resistance to something like 3.3kHz or lower. \$\endgroup\$
    – joribama
    Commented Dec 7, 2019 at 1:54
  • 1
    \$\begingroup\$ What is your I2C master? I'm guessing you've already checked it does not have PWM out? Most MCUs have 2 PWM outputs available and the presence of I2C on your schematic makes me think you have some kind of intelligence to drive the LED driver. \$\endgroup\$
    – eeintech
    Commented Dec 7, 2019 at 14:39
  • \$\begingroup\$ @Cisco25 I'm using an ESP32 as the master and it does indeed have PWM outputs, but I need 48 of them at ultrasound frequency... \$\endgroup\$
    – csiz
    Commented Dec 7, 2019 at 19:39

1 Answer 1

2
\$\begingroup\$

Don't (ab)use an led driver for this purpose. Even though it'll probably work as push-pull-multiplexer (with little disadvantages though) there are dedicated ICs that do exactly what you want. Search for "24 channel SPI PWM controller" and you'll find a device I would recommend.

\$\endgroup\$
6
  • \$\begingroup\$ In his case I2C seems more appropriate? \$\endgroup\$
    – eeintech
    Commented Dec 7, 2019 at 14:34
  • \$\begingroup\$ I personally prefer SPI, but there are pwm ics with i2c for sure \$\endgroup\$
    – Sim Son
    Commented Dec 7, 2019 at 14:52
  • \$\begingroup\$ The IC in the first search links (TLC5947) seems to also be a current sink. But I do need I2C for the PWM driver as I also have other SPI chips and don't have any chip select lines left. \$\endgroup\$
    – csiz
    Commented Dec 7, 2019 at 19:46
  • \$\begingroup\$ Indeed, the chip I used once (PCA9635) to drive h-bridges is a constant-current sink, too. hmm, I wonder if there were pullups on that driver board. So you'll have to take your solution, which will work pretty sure. What frequency do you need for your ultrasonic application? And may I ask what you are building? Accoustic levitator?;) \$\endgroup\$
    – Sim Son
    Commented Dec 7, 2019 at 22:04
  • \$\begingroup\$ I'm controlling 20 DC motors for a robot hand. The high frequency requirement is just so the motors don't squeak; not audibly at least. \$\endgroup\$
    – csiz
    Commented Dec 7, 2019 at 23:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.