6
\$\begingroup\$

I found this MCP23008 and its a nice little DIP GPIO expander over I2C. Is there a chip like this for PWM outputs?

Specifically I want this PWM generator to be used for the inputs on several L298Ns.

\$\endgroup\$
3
  • \$\begingroup\$ I won't make this an answer because I don't know it to be fact, but I highly doubt such an animal exists. What's the point of spinning silicon when a cheap existing micro could do the job? \$\endgroup\$
    – Matt Young
    Commented Jan 1, 2017 at 2:25
  • 2
    \$\begingroup\$ @MattYoung - wouldn't you have to code the cheap micro to listen to i2c and generate the pwm on its pins? Wouldn't the same be true for GPIO too? \$\endgroup\$
    – Justin808
    Commented Jan 1, 2017 at 2:47
  • 3
    \$\begingroup\$ What about PCA9685? It is 16 channel 12 bit PWM with i2c interface. Just what you are asking for. \$\endgroup\$
    – kostrunx
    Commented Nov 19, 2018 at 23:40

7 Answers 7

6
\$\begingroup\$

Here you go: MAX6966/MAX6967, MAX6946/MAX6947, TLC59401, MAX7313, PCA9685, SX1509.

\$\endgroup\$
1
5
\$\begingroup\$

I2c based port expanders with PWM output are typically designed as LED drivers. You can easily build a driver circuit using a npn transistor as an inverter, connected to the typically open - drain output of the i2c LED Driver. Many Texas Instrument ones note this setup in the datasheet, under using the output as a GPO.

\$\endgroup\$
1
  • 3
    \$\begingroup\$ A popular example: PCA9685. 16 channels of 12b PWM, programmable frequency 24 - 1526 Hz. \$\endgroup\$
    – uint128_t
    Commented Jan 1, 2017 at 19:11
1
\$\begingroup\$

You need high frequency for the L298N's, so shift registers won't do.

My suggestion is to use a separate AVR. Maybe ATmega328 - just buy an Arduino Pro mini clone, they're dirt cheap and need no additional components.
It has 6 PWM outputs (more info here) and can be programmed as an I2C slave or for whatever other communication you come up with.

It can also take some processing load off your main chip at the same time, process feedback from the motors, or something of the sort.

\$\endgroup\$
1
\$\begingroup\$

check out the adafruit servo board. (it can also handle LEDs but is designed as a 16 channel PWM expander over i2c including configurable i2c addressing via solder jumpers. And yes, there are plenty of china knock-offs)

\$\endgroup\$
1
\$\begingroup\$

you could checkout the sx1509 it has - gpio io - pwm output options with blink and breath options - supports keyboard matrix scan function

\$\endgroup\$
1
  • \$\begingroup\$ We don't expect every post to be perfect, but posts with correct spelling, punctuation, and grammar are easier to read. They also tend to get read and upvoted more frequently. Remember, you can always go back at any time and edit your post to improve it. See the site policy in Write to the best of your ability on the site's help pages. Welcome to EE.SE. \$\endgroup\$
    – Transistor
    Commented Jan 11, 2020 at 15:31
0
\$\begingroup\$

You can convert 3 output pins into an arbitrary number of PWM outputs using standard shift registers. (Of course the more PWMs you add, the lower the max PWM freqency will be.)

The setup looks like this... enter image description here

(Substitute your favorite MCU for the TEENSY - although the TEENSY is very nice!)

Here more info and an example of how the driver software might look...

https://www.pjrc.com/teensy/td_libs_ShiftPWM.html

\$\endgroup\$
2
  • 2
    \$\begingroup\$ This is a more complicated and specific way of saying "every GPIO expander is a PWM expander, you just have to keep changing the pins". \$\endgroup\$ Commented Nov 19, 2018 at 23:49
  • 1
    \$\begingroup\$ This will introduce a massive amount of software overhead and continuous SPI traffic. You would need to trigger an interrupt every time a timer increments in order to determine whether any of the outputs need to change, and then update all of the outputs accordingly. While this might be acceptable for LEDs, it would be a major issue for motors. \$\endgroup\$ Commented Sep 27, 2019 at 20:21
0
\$\begingroup\$

For anyone who runs across this some 5 years later... Look up "Serial Wombat 4B"

\$\endgroup\$

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