Go Down

Topic: I2C PWM controller? (Read 19791 times) previous topic - next topic

ill_switch

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


Sorry, maybe you missed this:

Quote
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.

daveg360

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

ill_switch

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:

Quote
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.

koyaanisqatsi

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:  http://effluviaofascatteredmind.blogspot.com/2010/02/arduino-pwm-on-all-pins.html.  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.

daveg360

Quote
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.

ill_switch

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


I'm driving HP LEDs. The chip you're referring to has a max drive current of 25mA. I need 700mA.

Quote
There were some discussions a while back on a software PWM solution that does PWM on any digital pin


I have no free digital pins, and my understanding is that the software approach is pretty resource-intensive and probably not possible if you're using the Arduino for other things (which I am).

Quote
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.


But what about the resistance of the driver I'm attaching to the circuit? Won't that totally throw the calcs out the window? An what if it doesn't want 10.6mA? Plus, the PWM frequency is still WAY too high on many of those LED ICs.

I appreciate the suggestions guys, but I guess if I say "I need X" I'd rather people just tell me about X, instead of questioning why I need it or offering Y. :) All I want is an I2C device in a hand-solderable package that can generate an "arduino-like" PWM signal. If that's not possible, I'll pursue other routes.

crc128

Ok, so a bit tangential, but one of ill_switch's comments has me all confused.  I'm a novice in this world, and I'm interested in using the arduino to control some LED lighting in my house.  However, I'm very sensitive to flicker, and was hoping to get very fast PWM.  I know that I don't really need more than 500 Hz, but the 97kHz chip mentioned seems very easy to use, plus the I2C is very nice.  Is there a specific problem with driving/dimming high-power LEDs at 97kHz?

sile

TI has some that I am using on my current project.  TLC49108  they have constant current and constant voltage versions.  The output pins are 17V tolerant so I can switch a 12V source with a resistor and a mosfet.  At least that is the plan.  I haven't actually tested it yet.


focalist

This may seem a little dense, but can't we create PWM on any pin via software?  I mean, you might have to do some lower-level work, but I would think that you can build a "PWM signal" yourself programmatically on any digital out and just use that?  The biggest pain the neck would simply be the timing, I would think...

koyaanisqatsi

Yes, this page: http://www.arduino.cc/playground/Main/GeneralCodeLibrary has links to "SoftPWM" and "PWMAllPins" which are solutions for that.  I haven't used either one myself, so I can't give any idea of what to expect with them.

focalist

#25
Oct 17, 2010, 11:54 pm Last Edit: Oct 18, 2010, 03:05 am by focalist Reason: 1
Aha!  So there you have it.

It just seemed that ought to be the case- and someone's already gone and written the library.  You should be able to import that library into your sketch, and go to town...  even if you discount 0,1 (rx and tx for serial) and 13 (cuz of the pesky LED) that ought to leave ten channels of potential PWM.

Glad I wasn't being so dense after all ;)

(edit:  I then read up, and somehow hadn't seen your previous post citing that.. hehe.  Therefore, I must admit, I should collapse into a singularity of infinite density..hehe)

sile

I just noticed i typoed that part #.  The TI part #'s are: TLC59108, TLC59108F, TLC59116, or the TLC59208F in my project I am trying to scale up to 32 channels.

The only problem with this chip is that it's in a TSSOP package,  wish I could get it in dip or at least ssop.

Anyone know of similar chip that comes in DIP or SSOP?

Ran Talbott

Quote
The only problem with this chip is that it's in a TSSOP package,  wish I could get it in dip or at least ssop.

You can buy adapter boards that convert SMT packages to through-hole.  Then (assuming you're like me,  and don't do SMT well/at all) you find someone who can do that one little part of the job for you.

Go Up