Power on the Propeller
Ramboman
Posts: 101
I am building a 8*8*8 led cube for Xmas.
I planned to drive it like a 16*32 matrix.
Column of 16 driven by pins 0..15
Each·of 32 column being multiplexed from pins 16..20 thru two MMC74HC154 4-to-16 Line Decoders.
The last having very low output capacity, I planned to use four ULN2803APG Darlington Drivers.
That does not work...
Simplifying the whole design, I connected the ULN2803 directly to the Propeller...
It does not work either...
The Propeller lights a LED on, but with much less power than connected to the Propeller directly.
More, the Propeller is unable to shut the LED off.
I don't understand, HELP please.
If there is a compatibility problem, what should I use behind the Line Decoder to power up to 16 LEDs?
·
I planned to drive it like a 16*32 matrix.
Column of 16 driven by pins 0..15
Each·of 32 column being multiplexed from pins 16..20 thru two MMC74HC154 4-to-16 Line Decoders.
The last having very low output capacity, I planned to use four ULN2803APG Darlington Drivers.
That does not work...
Simplifying the whole design, I connected the ULN2803 directly to the Propeller...
It does not work either...
The Propeller lights a LED on, but with much less power than connected to the Propeller directly.
More, the Propeller is unable to shut the LED off.
I don't understand, HELP please.
If there is a compatibility problem, what should I use behind the Line Decoder to power up to 16 LEDs?
·
Comments
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Conversely, 512 leds @5ma = 2.56amps
Of course you could drop the average current to 1ma and 74AC595's and TPICs could handle it ok then.
P.S. Of course you probably wouldn't have all leds on but this approach allows that nonetheless. You will need to figure out the best configuration for the cube which has 6 sides, not 8.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
·· Hi,·Sounds like a very interesting and excellent project - I would like to see pictures when you are done.
· ·I think you may need to multiplex the display.· You will have a solid cube of 8 planes of 8 x 8 leds right?· It would be nice if you could multiplex only 1 dimension (a plane at a time) instead of 2 (8 columns by 8 planes or 64 columns).· The most LED's I have had on was 80 and that used up to 1.2A without resistors.
·· I have sucessfully driven 512 leds using 2 cogs from a propeller as 4 chips of 8x8 bi-color leds - each cog took care of a single color.
·· I found that brightness was best by sweeping 8-16 columns at a time.
·· I used hc595's or 374/574's as data lines and hc154 or hc138's as column drivers (active low)·- so in my case i needed 4 sets of (D, CCLK, RCLK) lines to the 595's and 4 column lines to the 154 for a total of 12 + 4 = 16 output lines.
·· Keeping the propeller isolated from driving either end of the LED's is important.
·· If you are carefull you will not need current limiting resistors using a 595/154 combination as there is enough resistance present to limit the current.· When the clock is off the single columns of LED's are very bright - but multiplexed they look fine.· The only issue is that without resistors - all 8 leds in a column share a single resistance - hence led brightness will slightly vary based on the # of lit leds on a column.
·· Here are photos of the 512 grid using TTL 74154's and a 3x8x8 grid using 374's with no resistors
·· thank you
·· /michael
Last year I have build a multicolored led ball with 40 bicolor leds driven by one propeller only.
The leds are driven as a 8*10 matrix.
This year, my wife would like a cube, a big large cube ;-]
With the 28 available pins, the largest matrix we can build is 14*14 i.e. 196, so the largest cube 5*5*5.
The power of the propeller is high enough for 16 leds at the same time.
So my idea is to do that and multiplexing 32 column 16*32 i.e. 512, a cube of 8*8*8.
I would prefer the hc154, because I understand it's use...
What I don't understand is the fact that the propeller is unable to drive a ULN2803...
What would be an appropriate replacement for the ULN2803?
My advice, skip the direct drive approach from the Propeller or from 74HC logic. The 154 is useless for any of this work but use it if you like punishing yourself. Use TPICs for the cathodes and TPICs to drive PNP transistors for the anodes and make sure you have a separate supply for this that is not a logic supply, maybe around 6V or so.
Use a common 2N2222 for switching instead of 2803s, you can drive them directly and they will have a lower saturation. There are a lot of other transistors better suited though.
BTW, shouldn't your matrix fit in with the 6 sides of a cube (or 5 if sitting on top of a surface)?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/build
My cube is based on eight 8*8 grids
The grids are connected as 16*32
By experience I now that I can drive 80 LEDs with one Propeller without add'l component
With the available pins I now I would be able to go up to 196
I want to keep electronics as simple as possible and to understand what I do
I am not an experimented programmer
May be an alternative would be to use a master and a slave propeller coupled with spi...
Using 24 i/o per propeller in a 24*24 matrix, I do it...
Keep It Simple and Stupid!
There is a nice object in the library to drive the 74HC595, I understand it (not the content)
May I suppose I can use the same object for the TPIC6595?
·
Anyway, just cascade the shift registers using the SER OUT pin to the next SER IN pin and change the 595 object to shift 16 bits of data.
Better idea!
You could just write a simple driver in Spin as you only want one column output on (low) at a time. Clear the shift register beforehand either directly or by clocking 32 zeros in quickly and load. To turn on one output at a time (just like a 154!) start by sending a single 1 then a clock pulse (high then low) after which the other 15 clock pulse have the data line set to zero. So every time you pulse the clock (and then pulse the load clock) you will find that the next output will turn on and the previous off.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
I can't upload my drawing, so I try to explain it:
-· two TPICs feeding the plus point of the LEDs from 2 LiFe (6.6V, 4500mAH)
-· rotating to feed one line of 32 LEDs·at a time
-· four·HC595 feeing the minus point of the LEDs thru a current limiting resistance
-· feeding up to 32 LEDs at a time
Is this·design OK?
For programming (in Spin):
-· a table of 16 LONGs, one bit per LED, managed by the main PUB
-· a multiplex PUB·in a new COG, running·the 2 TPICs and the 4 HC595s (2*3pins)
Thanks for your support
Roland
·
Ok, I hope the TPICs are going to the cathodes of the leds as they are open-drain and cannot source current. The HC595s are fine to source current so that's 32 source I/O with 32 resistors.The software should be straight-forward as a simple Spin loop can read out the new column of 32-bits of data and shift it in to the HC595s. One thing you have to have is the OE control to the TPICs so that you can blank them during this update period otherwise you will get ghosting. Then once the source registers are loaded you can also clock the TPICs once relying on the cascading bit to turn on one output at a time. I know I'm probably being a little terse but I don't want to confuse you with too much detail.
HC595
R
|>|
TPIC
I can draw a quick schematic if you like.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
I really would appreciate a drawing, I am afraid I have connected the TPIC to the anodes of the LEDs ;-(
I wrote the following program to test the logic one HC795...
{Cube test 1}
CON
··
· _clkmode = xtal1 + pll16x···························· ' Crystal and PLL settings.
· _xinfreq = 5_000_000································· ' 5 MHz crystal (5 MHz x 16 = 80 MHz).
· clock = 21
· latch = 22
· data· = 23
· size· =· 7··········································· ' 0..7, 15, 23 or 31
·
VAR
· long· stack[noparse][[/noparse]20]
· long· matrix
OBJ
'· pst··· : "Parallax Serial Terminal"·················· ' Serial communication object
PUB main | idx·································
'· pst.Start(115200)···································· ' Start the Parallax Serial Terminal cog·
· cognew(mpx,@stack)··················
· repeat
··· repeat idx from 0 to size
····· matrix~·········································· ' set to nul
····· matrix &= !|< idx································ ' set bit[noparse][[/noparse]idx] to "1"
····· waitcnt(clkfreq/5+cnt)
·····
PRI mpx | temp, idx
· dira[noparse][[/noparse]clock..data]~~
· outa[noparse][[/noparse]clock..data]~
·
· repeat
··· temp := matrix
··· outa[noparse][[/noparse]data] := temp[noparse][[/noparse]size]··························· ' set 1st bit
··· repeat idx from 1 to size
····· outa[noparse][[/noparse]clock]~~···································· ' shift data
····· outa[noparse][[/noparse]clock]~
····· temp <<= 1······································· ' shift temp also
····· outa[noparse][[/noparse]data] := temp[noparse][[/noparse]size]························· ' get new data
··· outa[noparse][[/noparse]latch]~~
··· outa[noparse][[/noparse]latch]~
··· waitcnt(clkfreq/500+cnt)
{ram 17.11.09}
·····
·····
···
···
··
You are missing quite a bit from the code. Essentially you have to set 32 source drivers with the next long from your led buffer then enable the outputs, wait, disable the outputs. You have to make the column driver shift to the next bit then and read the next long etc. I have included some code for you to see what I mean. This is a tip too, when you are writing code you want to be able to read it and understand it so it helps to factor out functions and give them a name. i.e. rather than tkaing an output high and then low you could factor this out into it's own routine and call it CLOCK if you like. Ayway, if you do it this way you will able to walk through the code mentally and so it's way easier to debug.
I'm really tired at the moment, see how you go with the code though in the meantime. There might be a few mistakes but basically it's ok.
P.S. changed LoadRow repeat loop to 32
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
*Peter*
Post Edited (Peter Jakacki) : 11/17/2009 3:53:50 PM GMT
Again, Thanks for your support
I understand I still have to learn a lot...
The only projects I finished to now are:
-· a flashing ball with 40 bi-color leds
-· a flashing message "stone" with a 14 segment display
-· a Xmas display with a oled
Together with the "led cube", I am working on an hexapod...
Managing 512 leds is pretty ambitious, but my wife is an artist; for her was my early design with 125 leds too small ;-)
125 is much easier because you need the propeller only, without additional electronics
First layer 8*8 is ready; I will be able to test logic on it!
Again THANKS
I rewrote the program, following your recommandations.
It's running very well with one 74HC595 and one TPIC6595 and the first 8*8 layer.
Extension to 8 layers will be straightforward.
Thanks again
The architecture is based on 32 1/16'' brass columns for the four 74HC595 and 16 more for the two TPIC6595.
Control board is cabled on strip board; relatively easy.
All the circuits are powered from 4 NiMh; plus a 3.3V regulator for the propeller.
Programming as recommended by Peter works very well.
Still one issue: sometimes it stops without apparent reason!
I guess I forgot to use 1K resistance between Propeller pins and xx595's ;-(
Some soldering work in perspective!
Again, THANKS PETER )
Past tense? Does that mean it is all working? I'd love to see a video demo of this.
8x8x8 ought to be capable of some groovy 3d simulations.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.smarthome.viviti.com/propeller
but after adding 1K resistances on all the pins, it does not work anymore...
I'll check
I inversed 2 wires when soldering, now it's OK.
Test program follows:
repeat
repeat col from 0 to 15
leds[noparse][[/noparse]col] := ?seed
waitcnt(clkfreq/10+cnt)
Just generating random light.
Now begins creativity )
I don't know what to do: the led cube stopped working...
Battery is OK, soldering seem OK, now there are 1K resistances between propeller and xxxx795's and 100nF cap across power.
It runs... it stops with some leds on, not flicking... it runs with half the leds flicking... it stops definitively ;-(
It' not a program issue!
I am not electronic engineer; what can I do?
HELP!
the TPIC has to drain a max of 32 leds at once
that is up to 32*20mA i.e. 640mA
the specs indicate 250mA continue...
-> one or two burned TPICs; i'll check!
If yes, I have to change the design or at least the program to avoid to light up to many leds at the same time.
Any comment?
I am afraid the TPIC cannot manage the power: 250mA per port for 32 leds ???
This cube is unpredictable...
I will try to limit the number of leds to 16 or 8 at a time to reduce the load on the TPIC.
If anybody had a suggestion to replace the TPICs with something more powerfull...
1. connect only the TPICs, return to V+: it should light 16 leds, one at a time, if program is OK; no overload with 1 led check current!
2. connect only the 74HSs, return to V-: with appropriate program, it should light 32 leds, one at a time.
3. connect the 4 G/ (enable) of the 74HSs to specific pins of the propeller; activate one at a time in the mpx loop so the max of leds on is 8 at once.
Mpx refresh may be an issue: 1/64 instead of 1/16; if current ok, may go up to 1/32, enabling 2 74HSs at once.
We will see...
The 8*8*8 cube is mapped in an array of 16 longs.
1/16 multiplexing gives enough light.
8*8*8 LED cube is operational for Xmas ;-)
Good work !