• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Looking for recommendation of LED driver with individual LED PWM control

Status
Not open for further replies.

tdg8934

New Member
I'm starting to look into designing a single color LED module perhaps 16x8 (and later RGB). It is not going to be matrixed based just individual outputs of 16 LEDs or so. The biggest problem I have had to deal with is with SPI based LED driver chips that do not have PWM control built in. Figureing out from the manufacturer from how to create PWM (e.g. 256 shades) from /OE on these cascaded chips (e.g. 16 outputs per chip in a 16x8 module would be 8 chips for 128 LEDs) - has been extremely difficult to implement. I can only get the 'entire' 128 LEDs to shade and NOT individual LEDs via the SPI interface.

I have looked at datasheets from Allegro, Toshiba, and MBlock (china). However, today I saw the TLC59116 from Texas Instruments. This is I2C based not SPI and states in their datasheet that PWM is individually programmable per LED output. This sounds very promising.

http://www.electro-tech-online.com/custompdfs/2009/04/tlc59116.pdf


Lighting and Display Solutions - LED Drivers - TLC59116 - TI.com


Has anyone worked with this TLC59116 or have any other recommendations?

I am concerned that this chip can only connect up to (14) I2C TLC59116 chips. That is only 14 X 16 outputs or 224 LEDs. How would I get around this? I need to have 1000's of LEDs in 16x8 modules driven by a 'smart' PWM LED driver.

Thanks.
 
I'm starting to look into designing a single color LED module perhaps 16x8 (and later RGB). It is not going to be matrixed based just individual outputs of 16 LEDs or so. The biggest problem I have had to deal with is with SPI based LED driver chips that do not have PWM control built in. Figureing out from the manufacturer from how to create PWM (e.g. 256 shades) from /OE on these cascaded chips (e.g. 16 outputs per chip in a 16x8 module would be 8 chips for 128 LEDs) - has been extremely difficult to implement. I can only get the 'entire' 128 LEDs to shade and NOT individual LEDs via the SPI interface.

I have looked at datasheets from Allegro, Toshiba, and MBlock (china). However, today I saw the TLC59116 from Texas Instruments. This is I2C based not SPI and states in their datasheet that PWM is individually programmable per LED output. This sounds very promising.

http://www.electro-tech-online.com/custompdfs/2009/04/tlc59116-1.pdf


Lighting and Display Solutions - LED Drivers - TLC59116 - TI.com


Has anyone worked with this TLC59116 or have any other recommendations?

I am concerned that this chip can only connect up to (14) I2C TLC59116 chips. That is only 14 X 16 outputs or 224 LEDs. How would I get around this? I need to have 1000's of LEDs in 16x8 modules driven by a 'smart' PWM LED driver.

Thanks.
Thought that the shift register approach in previous post was all worked out, and the solution was at hand? Could not see how any sort of brightness could be conceived of such a scheme, but am willing to learn.

Pretty sure that the NXP PCA9635 was mentioned before. Other NXP offerings like the PCA9685 or PCA9622 may be worth a look too. Up to 126 devices at 16 bits gives you 2016 leds per microcontroller. Implement a master to slave micro bus (SPI or I2C) and expand accordingly for more colors/leds.

Have experimented with the PCA9635; it is very fast and works as advertised with the mono led's, and a single rgb led it was tasked with.

An example in Basic syntax how one would write to the PCA9635:

Code:
;Clear LEDn's to give chase effect
For index = 1 to 16
	write8bit(PCA9635write, PWM(index), 0x00)
Next
;wave pattern: A four segment section walked across display
For index = 1 to 13
	If index = 1 Then 
		write8bit(PCA9635write, PWM(index), 0xFF)
		wait waitled
		write8bit(PCA9635write, PWM(index), 0x96)
		write8bit(PCA9635write, PWM(index+1), 0xFF)
		wait waitled
		write8bit(PCA9635write, PWM(index), 0x63)			
		write8bit(PCA9635write, PWM(index+1), 0x96)
		write8bit(PCA9635write, PWM(index+2), 0xFF)
		wait waitled
	End If	
	write8bit(PCA9635write, PWM(index), 0x30)
	write8bit(PCA9635write, PWM(index+1), 0x63)
	write8bit(PCA9635write, PWM(index+2), 0x96)
	write8bit(PCA9635write, PWM(index+3), 0xFF)
	write8bit(PCA9635write, PWM(index), 0x00)
	If index = 13 Then
		Red = Random
		Green = Random
		Blue = Random
		threshold1 = 175
		threshold2 = 75
		If Red < threshold1 & Red > threshold2 then Red = 0
		If Green < threshold1 & Green > threshold2 then Green = 0
		If Blue < threshold1 & Blue > threshold2 then Blue = 0
		write8bit(PCA9635write, PWM(index + 1), Red)
		write8bit(PCA9635write, PWM(index + 2), Green)
		write8bit(PCA9635write, PWM(index + 3), Blue)			
	wait 1 s
			'write8bit(PCA9635write, PWM(index + 1), 0x00)
			'wait 10 10ms
			'write8bit(PCA9635write, PWM(index + 2), 0x00)
			'wait 10 10ms
			'write8bit(PCA9635write, PWM(index + 3), 0x00)			
	End If	
		;PWMvalue = (index * 16) - 1
wait waitled
Next
 

tdg8934

New Member
Excellent find!

Thanks so much. This is great! It looks very much like the TLC59116 by TI except that it can control 126 devices and not just 14. Wow.

I have been moving around from project to project and never had the PWM issue solved.

Thanks again!
 

tdg8934

New Member
Another question about the NXP I2C LED Drivers

I have another question about the NXP I2C LED Driver chip(s).

Since the PCA9635 can handle up to 126 I2C devices (e.g. additional PCA9635 LED drivers), this accounts for about (16x126 = 2016 LEDs). For an RGB version of my 16x8 LED module, it would have 128 * 3 LEDs = 384 LEDs. So that means I can have ~5 16x8 module (e.g. 2016/384 = 5.25 or ~5). OK so that means I can only have 5 modules left and right for my columns for RGB. I was thinking that for Rows of modules I would just use more ports on my AVR controller for the SCL and SDA lines for a separate I2C bus per module row.

However only having 5 modules for columns (eg left and right), it would not be enough for a large sign.

So my question is, How does one get around this limitation on the I2C bus?

Can a multiplexor be used for I2C? Any recommendations for this NXP part?

Should I just stick with SPI and clock the data out in an unlimited fashion. I like being able to control a specific LED output that can be easily done with I2C with PWM?
 
If using one color per I2C port, then you have 15 module width. Don't think it's a limitation of the I2C bus, as there has to be a practical limit on shift registers too. If you need more flexibility then just add more micro's, or up the micro to one that has multiple hardware I2C ports.

What AVR part will you be using, 8-16-32bit? One master, or one master-multiple slave AVR's to run your display? Software or hardware TWI? When you spell out your requirements, then your solution may very well present itself.

My experience with the NXP part is exactly as stated in previous post. Going billboard size would only be conjecture on my part. Personally I would rather buy a new development board, than invest in a bucket full of leds and drivers:), not that I haven't thought about it.
 

tdg8934

New Member
I don't have too much experience with I2C other than integrating in I2C EEPROMs (e.g. 24LC256) and using some example I2C coding using a Philips PCF8583 Real Time Clock (RTC) module on my MikroElektronika BigAVR2 board and MikroC Pro for the AVR. The BigAVR2 board has a great AVR chip (which I am still learning as well as C) called the ATmega2560. There is lots of I/O, RAM, etc.. on this one so it appears to be a good choice for this outdoor LED sign project. I have the current modules working but the current LED Driver from MBLOCK in China - MBI5024 doesn't have PWM capability so I would like to design my own 16x8 module with control of the PWM capability.

There are some "soft I2C" library commands and I suppose "TWI" library commands that could be used to control the I2C LED drivers. I use the "soft I2C" commands to control the I2C RTC I mentioned.

I hope that only a single ATmega2560 can handle this project using all of it's ports (maybe adding a PortExpander module too if needed). The module rows would just use additional SCL and SDA pins assigned from PORTB, C, E, etc.

Does this look doable?

So what you are proposing is that up to (15 * 8 = 120) I2C LED drivers (per module column) LEDs (left and right) using a single I2C bus. Then use additional ports from the AVR to control the module row LEDs (up and down) using additional I2C busses. Multiplexers would not be used then.

And of course anything using RGB would just have 3 times the amount of I2C busses. Hopefully everything will all talk with each other and we won't run out of resources.

Thanks.
 
Last edited:
Tried TWI with an atmega 168 in assembler once, and came up with a miss, will have to step up to the plate and try again. The previous posted code (GCBasic) was for a PIC 18f4620, using the hardware master I2C.

That atmega 2560 is a giant of a chip, and should have all the resources for at least your master? No clue if an all software I2C routine will handle the output, but it seems challenging. One thought is a modular/parallel approach, with one slave micro and three channels of I2C (one for each color) at the beginning of each row. Getting one module up and going, and then extrapolating the refresh requirements, could give the answer.

Surprised to see that Atmel only advertises 400khz two wire bus speed, as the NXP part will go to 1000khz (as will a PIC..hehe). Since it is a synchronous bus, it may very well be able to do it anyways?
 
Status
Not open for further replies.

EE World Online Articles

Loading
Top