i2c LED Driver driving me nuts!

vshortt

Senior Member
Hi all,

I'm experimenting with a Texas Instruments TLC59116FIPWR 16 Channel LED Driver chip that is controllable via i2c. I can get the registers to config and using the code below I can read them back no problem. They all take just fine, but I can't get a single LED to light (using output7) and I need a fresh pair of eyes to look at this... where is my goof up? HELP!

HERE'S THE DATASHEET

AND HERE'S MY CODE

Code:
hi2csetup i2cmaster, %11000000 ,i2cslow,i2cbyte  ' Set up i2c com's
pause 250 
hi2cout [%11000000], 0x01, (%00000000)    ' address the chip, Set register 1 to defaults (dimming control)
hi2cout [%11000001], 0x09, (0xff)       ' address the chip, Dimming for output 7 register,  setfull power
hi2cout [%11000001], 0x12, (0xff)       ' address the chip, Group Duty Cycle to 255
hi2cout [%11000001], 0x14, (%10101010)    ' Turn on group 0 - no dimming control, just on
hi2cout [%11000001], 0x15, (%10101010) ' Turn on group 1 - no dimming control, just on
hi2cout [%11000001], 0x16, (%10101010) ' Turn on group 2 - no dimming control, just on
hi2cout [%11000001], 0x17, (%10101010) ' Turn on group 3 - no dimming control, just on
main:
hi2cin [0xC0],0x09,(B0)    ' Read back the configuration of LED7
hi2cin [0xC0],0x18,(B1)    ' Veriy the i2c Subaddress1
hi2cin [0xC0],0x1B,(B2)    ' Verify the "allcall" address
hi2cin [0xC0],0x12,(B3)    ' Read back Group Duty Cycle
hi2cin [0xC0],0x14,(B4)    ' Read back Group0 Config
hi2cin [0xC0],0x15,(B5)    ' Read back Group1 Config
hi2cin [0xC0],0x16,(B6)    ' Read Back Group2 Config
hi2cin [0xC0],0x17,(B7)    ' Read Back Group3 Config
hi2cin [0xC0],0x13,(B9)    ' Verify Group Freq.
hi2cin [0xC0],0x00,(B10)   'Read Back register 00h general Config
hi2cin [0xC0],0x01,(B11)   'Read Back register 01h general Config
debug
goto main
My Debug Screen verifies that ALL of the readbacks do, indeed contain the configurations that I put in. However, I cannot get a single LED to light. (yes, I've verified the LED works, I am using a 220K resistor, etc..)

Am I missing something here? Is there a definitave "on switch" that I'm missing?

I thought the configs for 0x14 through 0x17 would be enough to just turn on ALL the channels to full power. (I'm only using output 7 right now) surely turning them all on would garner a single led to light up... no?

It's driving me just plain batty!!!
 

Technical

Technical Support
Staff member
220K.... resistor value?

Your LEDs are between the outputs and V+ (open drain system), not 0V?
Output 7 needs to be LOW (0) for the LED to light.

Plus all your optional [address] are just wasting memory space, you can remove them all. The PICAXE knows how to set the bit0 for read/write automatically.
 
Last edited:

vshortt

Senior Member
Sorry, the resistor is 220 ohms.

Yes, it's an open drain system. LED's other lead is connected to +5v

I know that the the [addresses] are not necessarily needed, but this isn't going to be the only i2c item on the bus, so it's good practice for me to address them individually, it's not necessarily about setting the read/write bit. It's more about addressing the proper chip... am I not looking at what you're referring to?

As far as setting output7 low:

The default value of these registers is "00" - which would mean off, setting them to "01" for each register would turn them all "on - no dimming, no blinking (See page 14 of the datasheet)" - which from what I'm seing would open the gate on the integrated fet, opening the pathway to ground between the source (ground) and the drain (led)... am I reading that block diagram right? (block diagram on page 2)

Looking at my code, you can see that I'm setting every single LED Driver to "on - no dimming, no blinking" by setting 0x14 to 0x17 to %10101010 - each "10" group of bits represents a single LED output in that group of 4. There are 4 groups... thats all 16 led drivers... Unless I'm looking at the configuration of these registers wrong.
 

chigley

Senior Member
I know that the the [addresses] are not necessarily needed, but this isn't going to be the only i2c item on the bus, so it's good practice for me to address them individually, it's not necessarily about setting the read/write bit. It's more about addressing the proper chip... am I not looking at what you're referring to?
All Technical is saying is that you're wasting lots of program space by redefining the slave address value on every hi2cout/hi2cin command. You only need to do it once each time you want to communicate with a different device on the bus. Your code will still work, but it's just unnecessarily longer than it needs to be.
 

vshortt

Senior Member
I understand...

I'm willing to forgoe a smaller chunk of code for my own clarity, thats all. I know it's not needed by the system.
 

vshortt

Senior Member
Just out of curiousity, is it possible that I burned this chip up heatwise?

It was a bugger to solder since it's a tiny lead smd footprint. It took several tries to get is soldered properly using a hot air reflow station. I honestly don't remember what temp I had it set at.

After the final soldering (3 tries I think) I checked all the traces on my breakout board to make sure there were not bridges and it all checks out. I'm a little confused as to why the chip will accept configurations, but not switch the channels on and off like it's supposed to.

I'm really hoping someone will take the time give me a hand with this project. It's holding up a much larger project!

Many thanks in advance!



I know it's not pretty, but remember, it's TINY - it's the size of an eraser head and fenniel. I think I over-did the flux a little, but hey - no biggie.
 
Last edited:

chigley

Senior Member
I'd imagine you're just missing something in your code.

I spent the best part of an hour trying to get a different I2C LED controller to work, only to find out that I'd missed the very first command that had to be sent in order to wake up the device from shutdown mode!
 

Technical

Technical Support
Staff member
Page 14
10 (which you have) brightness controlled through PWMx register
01 (which we think you want) LED driver is fully on

so %01010101 not %10101010
 

westaust55

Moderator
Just started reading down thru the thread and pulled up the datasheet to compare with the program being tried.

Then as I went to respond, realised that Techncial had already given the answer.


datasheet page 14 states for registers $14 to $17 inclusive:
"LDRx = 01 : LED driver x is fully on
LDRx = 10 : LED driver x is individual brightness can be controlled through its PWMx register."

By default, the PWM registers $02 to $11 are all set at $00,
so duty cycle = 0% and no LED illumination
 

premelec

Senior Member
TLC5922 CC driver

@ vshortt - Thanks for this thread - I bought some TLC5922s 16 channel constant current drivers about 4 years ago and then concluded that with the 08Ms I was working with then I couldn't make up and send the data to them fast enough as well as not having any programming space left to work with - now I have 20x2s I may give it another try inspired by your post.... BTW is that a commercial adaptor board? [the TLC5922s have 32 pins... ]
 

vshortt

Senior Member
Technical, Thank you for the correction, you're right.. I have the 1's and 0's backwards.

Chigley... you got me going in the right direction there... I went back and looked closely at the config registers... guess what.. by default it powers up in "low power, no oscilator" - ugh! (P12, mode register 1, bit 4)

So, sent a quick config command bringing it out of sleep mode and voila! works like a champ - It would have been nice of Texas Instruments would have... SOMEWHERE.. mentioned that the chip boots up into sleep mode and you MUST bring it out....

oh well...Will play with dimming and blinking tomorrow. It's late.

premelec,

You're most welcome! No, thats not a commercial board. Just something I whipped up and etched. I'd be happy to send you a copy of the board or post a 1:1 image here if it would help you with your experimentation
 

premelec

Senior Member
@vshortt - Thanks for the offer however I've got some other prospects - also I recalled that I got some National LP3943 chips "16 LED Fun Light Driver" - I'm going to train some fleas to mount and solder this 4x4mm chip!
 

SAborn

Senior Member
Just a hint to get rid of the excess flux and make the board look neat, is to use an old toothbrush and metho, and give it a good wetting with metho and a scrub.

It will look like a bought one after.
 

John West

Senior Member
NO problem. I would have no idea how to solder something this tiny without a hot air rework station!
A fairly well known and very effective trick for soldering such tiny close together pins is to "blob solder" the entire row of pins - then solder-wick off all of the solder that doesn't stick to the pins. Solder surface tension will maintain a good solder contact beneath each chip leg and leave you with a professional looking soldering job.
 

premelec

Senior Member
@ John West... its a 4x4 mm 32 leads under the square with no pins exterior - needs to have the whole thiing heated. Toaster oven? :) Maybe I'll give it a try...
 

vshortt

Senior Member
premelec,

QFP's are definatley a challenge. If you don't have a hot air re-work station, the toaster oven is a great way to do it. I've done it that way before, works like a champ! just pre-tin the 32 leads, pre-tin the board, make sure you have them lined up (using flux to hold the chip in place) and pop it in the toaster oven.

Surface tension will cause the chip to "pop" into place when the solder melts and as long as you only have a reasonable amount of solder on the leads you should have no problem with bridging.
 

chigley

Senior Member
premelec,

QFP's are definatley a challenge. If you don't have a hot air re-work station, the toaster oven is a great way to do it. I've done it that way before, works like a champ! just pre-tin the 32 leads, pre-tin the board, make sure you have them lined up (using flux to hold the chip in place) and pop it in the toaster oven.

Surface tension will cause the chip to "pop" into place when the solder melts and as long as you only have a reasonable amount of solder on the leads you should have no problem with bridging.
I've been reading lots about SMT soldering recently, as I've got four SSOP-36s of my own that I need to solder. I found this article on SparkFun, which evaluates different methods (hot air, toaster, hot plate, etc.) and it concluded that the hot plate is better than the toaster!

Really not decided how I'm going to do them. I'm looking to experiment with PCB manufacture too, and I don't want to spend days getting a perfect PCB to then destroy it on a hotplate. We'll see how things go...
 

hippy

Ex-Staff (retired)
"Practice makes perfect" is usually the name of the game, so it makes sense to try a variety of techniques on material and components which are cheap and not essential first; find the technique which works best and suits you. There will be a cost involved and a number of failures unless you are lucky. That's simply the way it is. Hands-on experience is ultimately the only way to see how theory measures up to practice.

If making a PCB, perhaps include additional sections of circuit board which can be practiced on, look at eBay and elsewhere for cheap SMT components to practice with.

If a complicated board, consider dividing into smaller separate parts so if something does go wrong with one you don't lose the complete board. Perhaps buy more boards than you need as insurance against some failures. Sod's law says if you've only got one nail it will bend when you hit it with a hammer.
 

vshortt

Senior Member
I agree with what Hippy says.

I normally buy PCB blanks in bulk online. They're MUCH cheaper that way and really... can you have too many blanks? LOL

Normally when making a new circuit, I usually cut two boards at the same time, that way I have a backup and don't have to stop and make another one if I screw up the first one.

The down side is that if you're making a larger board and have something in the circuit wrong or cut it backwards or whatever, you've then screwed up TWO boards.. the good thing is that you then have two boards to practice on!!

I've also come to realize that buyig Ferrich Chloride is a waste of money. I normally mix my own etchant using Muriatic acid and Hydrogen peroxide. 12oz. of Ferric Chlorid is about $9.00 here - the same volume in "home brew" is less than a dollar to make PLUS it's environmentally friendly. I kinda break to normal rule of mixing and go 2 parts Hydrogen Peroxid to 1 part Acid. Works perfectly and always gives nice clean traces. The nice thing is that I can mix only as much as I need to use. When done I just toss it out.

I know there is a way to keep it around longer than just for a single use, but I've yet to find it. After about 2 weeks of storage, it stops etching altogether. BUT, I can etch 30 boards in one day with a fresh batch, depending on the size of the boards.

The acid is available at any hardware store and I get the Hydrogen Peroxide at wally world in the pharmacy section....

and yes.. I am SURE I am duplicating information found elsewhere on the board... it never hurts to type it out gain, just in case someone that is new to cutting boards find this post. I've never tried any method other than the "toner transfer" method simply because It always works perfectly for me. I see no need try anything else sice it works so well.
 
Last edited:

premelec

Senior Member
wear your safety glasses! and...

[I'm blind in one eye due to poor judgement in my youth] - I have some Bellin Dynamic Systems adaptor boards which are pretty universal - .4 mm on one side and .5 on the other out to DI format.... I've tried to attach a picture hereto - they have long tinned areas rather than spots that match the IC pattern - would this work to self-align when heated? - Intuitively it doesn't look likely and I don't want to waste parts! Thanks...
 

Attachments

vshortt

Senior Member
I don't think this will self-align, you would have to have a steady hand to get it work properlywith a QFP Packge. The reason a QFP will self-alight with properly formed pads is because of the wicking motion of the solder to the larger portion of the pad.

I think you would be better served to make a DIY board for QFP soldering unless you can find a commercial board specifically for QFP chips.
 

InvaderZim

Senior Member
Schmartboard makes a QFP product. Read about their EZ Process to make soldering easier. I haven't used this particular model, but I've used others and had great results. Though I did botch one and had to spend some time re-working. Definately have flux, some fine solder wick, a fine tip, etc. available to make life easy on yourself. I've never botched something so bad that it couldn't be fixed with a load of flux and some patience. SparkFun has some great tweezers for sale too, cheap. I've found rubbing alcohol cleans the type of flux I use nicely. You can do a lot on one of those little boards and make projects look very clean. Pick up some solid core wire and some thru-hole, 0805 or 0603 components and you're good to go.
 
Top