A fist full of LEDs for Christmas
Clemens
Posts: 236
Charlieplexing? Beauplexing? Desilvaplexing?
- Whatever you want to call it, it took me quite some time to figure out how it works... :-)
So here is a sample·8 column 7 row led display that only uses 8 pins.:
It's my first soldering project! (Obviously ;-))
Just wanted to show it to thank you people for sharing so much knowledge on this forum.
And..... , one question, but it's really basic stuff I'm afraid.
If I want to take one number to the power of another, how do I do this in spin?
I wrote a function:
Is that the correct way to do it, I have a feeling there is an easier way?
Thank you all and have a nice christmas if you're celebrating and just a good time if you don't.
Clemens
- Whatever you want to call it, it took me quite some time to figure out how it works... :-)
So here is a sample·8 column 7 row led display that only uses 8 pins.:
It's my first soldering project! (Obviously ;-))
Just wanted to show it to thank you people for sharing so much knowledge on this forum.
And..... , one question, but it's really basic stuff I'm afraid.
If I want to take one number to the power of another, how do I do this in spin?
I wrote a function:
PUB pow (num, pownum) | returnvalue if pownum==0 return 1 else returnvalue := num repeat pownum-1 returnvalue*= num return returnvalue
Is that the correct way to do it, I have a feeling there is an easier way?
Thank you all and have a nice christmas if you're celebrating and just a good time if you don't.
Clemens
Comments
I think your soldering is quite o.k.
I hope you do not mind when I post your images also to other places?
The LEDs seem to be quite bright, but they can only be powered by 0.7 to 0.9 mA.
What is the brightness rating? When you have taken some advertised with 5.000 mcd @20 mA then they should shine with 200 mcd., what is still 10 times more than an old fashioned LED..
Your "power loop" is not the fastest, but the simplest way to do it.
Note that the exponent cannot become VERY large. Lets say the basis is at least 2 it must be < 32, and the basis being around 16 it has be be <8
In cases with LONG numbers (with hundreds of digits) however, it will pay to analyse the binary factors of the exponent E.
E = 2**a + 2**b + 2**c + ....
Then the power B**E will be
B**(2**a) * B**(2**b) * ....
To compute each of the factors you will need a, b, or c multiplications, as: x1 := B*B; X2 := X1*X1; X3 := x2*X2;..)
So e.g. B**255 will take some time:
0+1+2+3+4+5+6+7 multiplications + 8 for all factors = 36 multiplications... but much less than the straight forward 254...
And B**256 it will only take 8 multiplications!!
This algorithm is best implemented in assembly language, where the binary decomposition is rather simple..
Post Edited (deSilva) : 12/24/2007 2:20:14 AM GMT
Couldn't keep the relatives out this year,
Kevin
sure you can distribute the images elsewhere.
I probably wouldn't even have needed the power-function as I only need powers of 2. I think I could have done it with shift.
It's actually just for defining the one pin that has to be skipped in each row of the display (the one that switches the columns). Well I was glad I got it running in spin, was hard enough for me, but I guess it could be a nice project to get started with assembler... I read potatoheads beginner tutorial and halfway understand it.
Much to explore in 2008.
Great job.
@ bambino: hm, multiplexing and pov together... Won't be much brightness left, at least not with those cheap leds.
@ forest: I had resistors in there while testing. But the LEDs now are only pulsed 1/8 of the time (duty cycle) to do the plexing, so no harm should be done to the prop or the leds.
(b) Yes that's the bottleneck. LEDs do no magic. 100mW in - 100mW out (if
I think it must be these ones: http://www.conrad.de/goto.php?artikel=184918
But it doesn't say anything about the brightness level there...
The brightness is fine with this duty cycle, but it rapidly get's lower at duty cycles·below 1/10.
I started with a smaller grid of 5x4 LEDs and checked what duty cycle would be still acceptable before I soldered the "BIG" one.
Would that one be a better candidate? ·http://www.conrad.de/goto.php?artikel=154295
A little beyond the budget perhaps... :-)
<G> Because of the "risk of eye-injury"
> A little beyond the budget perhaps...
Did you try a filter? If you don't intend to have multiple colors, it's much more effective to have a yellow (color of LED) filter in front of.
Nick
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Never use force, just go for a bigger hammer!
The DIY Digital-Readout for mills, lathes etc.:
YADRO
you buy at the wrong places
LEDs is a very transparent market.. Lots are sold through ebay. Look at CAR ADD-ONs ("Autozubeh
Post Edited (deSilva) : 12/24/2007 3:17:33 PM GMT
For the raise to the power question, you could use logarithms and exp. There's a set of ROM table's on the Propeller for that.
A^B
=EXP( B* LN(A))
=EXP( EXP(LN B + LN(LN(A))
Frank
It's amazing that a chip of the size less than 1 square Centimeter can keep my brains occupied for months and months. Does this speak for the chip or against my brains?
- And please, this last question was merely rethoric please don't answer!
all diodes right of it have to be shifted ("bent") one place to the left to make it "good looking"
----
Edit: I added a sketch which better shows the needed connections and leads
It is very sytematic but needs a lot of concentration
Post Edited (deSilva) : 12/25/2007 11:34:33 PM GMT
So I then put that into a matrix in eagle like so: (see attachment)·· Does that make sense? ·· I have included the eagle schematic and board layout for fun.· I am not an expert in eagle - as you can see.
Post Edited (OakGraphics) : 12/25/2007 11:39:42 PM GMT
I have a veroboard here for some time with horizontal stripes at the front side and vertical stripes at the back side.
This will simplify the task considerably; I think I need just 7 cuttings and 7 short patchwires... And 56 LEDs...
I have the LEDs.. I mean: SOLDERING 56 LEDs
You did well.. looks great . Merry Xmas to you and fellow Proppers..
There are a couple of really neat led games around..
One that I saw a guy here in OZ had· see link below
Based on a AVR 168..
http://www.youtube.com/watch?v=Q0VH-7gdFB4
A Propeller should eat this for breakfast...
Would be a great learning tool as well... a MINI HYDRA..???
cheers·· Ron·· Melbourne Australia
wouldent you need to 'isolate' each pin from either top-bottom when you don't want the two connected? Or will the act of not soldering the top seperate from the bottom layer? (i.e. wont the lead of the LED potentially make a contact between the two layers?)
Anywho - I kow veroboard is not popular in the US for some reason. I noted I could get some from http://www.futurlec.com/ProtoBoards.shtml for pretty cheap - but they don't seem to carry the one you were refering to.
The LEDs are on the opposite side off course. The blue wires are flat on the board, the red ones a little above.
With luck you buy for 4 to 8 Cents * 256 = $10 to $20 - and its monochrome.
It should not be Charlieplexed but refreshed line after line so you get any brightness at all.
- 16x anode current from the Prop @10mA each
- 16 (=2x ULN2803) cathode sinks @160 mA each
- 4:16 decoder
(=20 Pins)
I should prefer one of 4Ds OLEDs
I just found my double sided Veroboard, but it's midnight now and shall not start soldering LEDs on it now
Well, both sides have each second stripe only.. This is handy for any kind of matrix.. But it is rarely requested I am sure...
However I can no longer find them in one of the online stores I must have ordered it some months ago....Weird..
This is very cool project two thumbs up Clemens.
But the real question is : Who is Charlie???
This esplained by MAXIM in the datasheet where the 6 7-segment example comes from; and also in one of the Charlieplexing threads quite popular here 3 months ago..