I2C PWM controller?

Hello all,

I'd like to find an IC that can produce 8 (or more) PWM outputs and run on an I2C bus. Bonus if it's in a DIP package (i.e. not SMD).

Something like the PCA9635 from NXP, but in a DIP package.

I have none in mind that would do.. but if everything else fails you could use a 2nd Arduino to do that job - yet you only had 6 PWMs...

Doesn't the TLC5940 do something like this? I have seen posts about it on this forum.

Edit: Just found a data sheet which says serial input, but probably not I2C.

I'm using some other I2C devices in my project, so I'd really like to stick with that (real time clock, and possibly an LCD controller). That said, I am a little miffed that I2C consumes two analog pins, so perhaps I should scrap it and go with a serial protocol that doesn't. Thoughts? If I did that, I'd have to find another way to communicate with my RTC, which is a DS1307.

Nachtwind, using another Arduino (or just an AVR chip) would work I suppose, but requires a few external components and doesn't get much (only 6 PWM channels). At that point I think I'd just suck it up and deal with an SMD IC like the PCA9635.

Still hoping someone has run into this before and has a good solution. It seems like there are plenty of options if you just need general purpose digital I/O pins, but not many if you need to PWM output (or analog input, for that matter.)

I suppose another alternative would be a Mega, but that just seems like a cop-out. :smiley:

I try to keep to i2c, it`s so simple to make a complex module and use only 4 wires to control and power it.

I use a BV4237 http://www.byvac.co.uk/bv/bv4237.htm

8 pwm port and 5 adc port , plus you get the rtc for free all in a very small package.

I think i read somewhere in the past days that here is a programmer who made an Atmel have all Pins do PWM. if you could do that and make a standalone run on 1Mhz - so not needing an oszillator - you would have some great chip for your needs ;0)

I`ve seen servo controller built on pic chips. eg :-

http://www.robot-electronics.co.uk/acatalog/Controller_Chips.html

This one only does 4 channels, but it's a "proof of concept" for using a micro as an I2C slave to do PWM.

There have also been some posts here about people who've turned Arduinos into I2C peripherals.

If you don't need a very high PWM frequency, you could program something like an ATTiny2313 to do it relatively cheaply.

Ran

I'm new enough to all this that I don't know what qualifies as a "very high PWM frequency" so who knows. :smiley: I am going to be using this to control several HB LED drivers, that work fine off whatever the arduino's standard PWM frequency is - around 500Hz, right? At any rate, the drivers have a limit of 1kHz.

So, it's looking like my only option is some sort of microcontroller as an I2C slave. Hmm. . . .

Hi!

Maybe a MAX7313 would work?

It has I2C, 16 PWM outputs, though they can only have 16 individually controllable brightness values.. I haven't quite gotten the hang of it. Check it out!

This has 10 PWM and constant current outputs:-

But you will struggle to find anything that is not surface mount with this sort of specification.

Digging this back up. My criteria have become less restrictive - minimum 4 channels would be OK. Still would like an "easy to hand solder" package, if not through hole. Thoughts anyone?

See as you're looking to use LED drivers.... how about an I2C LED driver?

This was the first one I found:
http://gb.mouser.com/ProductDetail/NXP-Semiconductors/SAA1064-N2112/?qs=sGAEpiMZZMu8%252bGBKj8XSFD6olyIc58G3EO%2FBuyB8U4c%3D

Hmm, that looks interesting but not sure if it does what I need. It appears that chip can turn each output ON or OFF, and has a constant current control on each.

I just want to tell the chip "turn output X on at Y duty cycle" - it doesn't look like that chip will do that, unless I'm reading the datasheet wrong.

Basically I just need more "stock Arudino" PWM pins. :smiley:

Edit - to clarify what I posted above, the LEDs are HP LEDs and I can't drive them directly from a chip like that. I have drivers; I just need to control the drivers with a PWM signal.

Sorry for the shameless plug for my own project, but would this be of any help to you?
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1258412419

It's not serial or I2C addressable, but it is 4 channels of PWM-able power LED drivers. ::slight_smile:

What is your project? You haven't eluded to what you want to do yet.

What is your project? You haven't eluded to what you want to do yet.

Sorry, maybe you missed this:

Basically I just need more "stock Arudino" PWM pins.

Edit - to clarify what I posted above, the LEDs are HP LEDs and I can't drive them directly from a chip like that. I have drivers; I just need to control the drivers with a PWM signal.

I've seen your shield but I need much more capacity, and I've already built drivers to run the HP LEDs. The drivers I have need a PWM signal to control dimming. The default PWM pins on the Arduino are just right in terms of frequency, etc. But, I need more than 6 PWM channels. Hence, I want the easiest-possible way to provide additional Arduino-like PWM pins.

If I'm not explaining something well enough please let me know.

Sorry wrong product I forgot you were after dimming too. They definitely do a I2C LED driver IC that control the brightness of up to 16 seperate LEDs. Think (as Grumpy M has already said) you're going to struggle to find it in a suitable package.
Something like:
http://www.nxp.com/documents/data_sheet/PCA9635.pdf

At this point I really wouldn't mind a weird package, but the frequency looks too high on that chip. Here's an excerpt from the datasheet of the IC I'm using for LED driving:

Accurate linear dimming is compatible with PWM frequencies from 100 Hz to 5 kHz for PWM duty cycle down to 1%. PWM frequencies up to 50 kHz can be supported for duty cycles greater than 10%.

So ideally I'd like to be in the 100Hz to 5kHz range. That PCA chip's individual pin dimming is at 97kHz.

Worst case I'm going to break down and slave a second Arduino-like device to get the PWMs from it, but that's way more overhead and cost than this sort of thing should take IMHO.

No prob. Just thought I'd throw it out there since you mentioned that 4 channels would work.

There were some discussions a while back on a software PWM solution that does PWM on any digital pin. I did a Google search for "site:arduino.cc software pwm" and this one looks promising: effluvia of a scattered mind: Arduino PWM on all pins.. But I've never tried it myself. There were several other results that had some good leads too.

Also, don't rule out the chips that are designed to drive LEDs directly with a constant current. It's not the cleanest way, but you can drive each LED output into a resistor load and pull a signal off the + side for your drivers. Configure the output so that you're getting the voltage you want at as low of a current as possible. For example, set the output current to 10.6mA and run it through a 470 ohm resistor to get a 5V output. Then you can read that with the PWM input on your driver. You need a chip that drives common cathode LEDs for this to work the way I just explained. Common anode might work too, but I can't see it off the top of my head.

At this point I really wouldn't mind a weird package, but the frequency looks too high on that chip. Here's an excerpt from the datasheet of the IC I'm using for LED driving:

But why would you need a LED Driver? the IC I referred to is specifically for that.