12 channel 8 bit PWM shift registers

Brian Z

New Member
I’m looking to use some shift registers on my next project to control about 24 RGB LEDs. It looks like the popular one to use is the TLC5940. The PWM data is 12 bit per channel, and I don’t need that much resolution, and it looks like 8 bit would be a lot easier to use with the shiftout command. Also, it would be nice to have a number of channels that is divisible by 3. There is the TLC5930, but I really need thru-hole mounting. I’ve read about a zillion datasheets. Does anybody have any suggestions? Is there an easy way to output 12 bits aside from running shiftout one and a half times?
 

westaust55

Moderator
More information would be good. Which PICAXE do you have/intend to use?

IF you have an X1/X2 part then SHIFTOUT command can handle whatever number of bits you may want.
Lets say you have three 12 bit variables in words w0, w1 and w2

Then first you must shift the word variables right 4 bits if you are using MSB_First method:
So use w0 = w1 << 4 and same for the other variables

Then use:
SHIFTOUT <sclk_pin>, <sdata_pin>, MSBFirst_L, ( b1/8, b0/4, b3/8, b2/4, b5/8, b4/4)
 
Last edited:

BeanieBots

Moderator
While you wait for the list of "my favourite devices" to arrive, have a think about your desire for a device with channels divisble by 3.
Depending on your application, it is quite popular when using coloured LEDs to include white LEDs. That would require RGBW. ie four channels.
 

InvaderZim

Senior Member
Also don't rule out surface mount parts. There are products like Schmartboard that let you use a tight SM package but still have access to large holes for wired interconnects. I've got a little 15-bit ADC that would fit on a pencil eraser surrounded by 0805 resistors and capacitors. Once that little guy was built, I wired the I2C to a standard Picaxe protoboard with standard solid-core jumper wire. It looks very professional, and works good too. It wouldn't have been nearly as easy if I limited myself to thru-hole parts.
 
Top