noofny

Help with LED matrix

50 posts in this topic

I've built my DOUT with the added ULN2003A's as per the attached circuit pic. This is to eventually achieve an 8x8 rgb led matrix. Everything works fine as far as the DOUT is working 100%. What I'm stumped with is that there is nothing coming from the output pins of the darlingtons?? For example I place a multimeter across +5v input pin of the DOUT and pin 1 (input) of the darlington and it measures 5v - which is right. Now I measure across the matching output pin and the same +5 input of dout and it measures around -2v. The chips are working and bought new and both are doing the same thing across all outputs. I've been reading and checking against circuits all over the net and I've wired them the same as everyone else (except haven't wired anything to pin 9 which it seems you dont have to);

http://www.midibox.org/forum/index.php/topic,10476.0.html

http://www.suckow.de/ralf/ledmatrix4x20/

http://www.edaboard.com/ftopic263469.html

Can someone please help out - I'm totally lost and have probably misunderstood something simple.

4273_8x8_LED_circuit_png1821af2c9e68c6a9

4273_8x8_LED_circuit_png1821af2c9e68c6a9

Share this post


Link to post
Share on other sites

Solved it - gotta love in-play school!

I thought you had to feed -v into the darlingon in's, but you feed in +v and it outputs -v. Still don't really understand how that happens but there's a lot of this going over my head - just glad it's sorted though.

So when setting the DOUT pins 1-8 I do MIOS_DOUT_PinSet1(x) where x is 1-8 and I do this in the Init() function. Then you call MIOS_DOUT_PinSet on/off for the r/g/b pins. Awesome...get it now!

:)

Share this post


Link to post
Share on other sites

I thought you had to feed -v into the darlingon in's, but you feed in +v and it outputs -v

Yeh that's transistors for ya :) I wasn't sure how darlingtons are configured so I didn't pipe up, figured I'd leave it for the experts... But a quick google will explain the inversion thing for ya.

So when setting the DOUT pins 1-8 I do MIOS_DOUT_PinSet1(x) where x is 1-8 and I do this in the Init() function.

Well you need to do it repeatedly, one row at a time (Edit: SRSet), not in the init function, and it's 0-7...

http://www.midibox.org/dokuwiki/doku.php?id=home:mbhp:module:din_dout_pin_list

Share this post


Link to post
Share on other sites

I've made up 2 8x8 RGB LED matrix boards using DOUTs (see attached circuit). When I connect a single matrix board to the core everything works 100% (for both of them). However when I chain both matrix boards together to the core, MIOS locks up on power up (and all LED's light up full). Both matrix boards work 100% on their own, just when I try chaining them together the cores lockup. Seems like the circuit is getting overloaded or something?

My PSU is supplying more than enough current (over 5 amps). I'm wondering if the core circuitry can handle both matrix boards connected? Is the problem with the SR's...do I need different SR's...the ones I'm using are just the standard 74HC595 ?? I'm just lost at where to start trouble shooting - would really appreciate if anyone can shed some light.

:(

4749_8x8_LED_circuit_png1821af2c9e68c6a9

4749_8x8_LED_circuit_png1821af2c9e68c6a9

Share this post


Link to post
Share on other sites

I wrote a simple routing that cycles through each row/column and turns on each LED.

1) I connect both matrix boards to the core and trigger the sequence....the first row of LED's for each matrix lights up and MIOS locks up.

2) Power cycle.

3) I only connect the RED annodes on the 2nd matrix board and trigger the sequence.

4) Works 100%.

5) I connect the RED & BLUE annodes on the 2nd matrix....MIOS locks up.

...hmmm it seems if I connect any more than 1 set of annodes on the 2nd matrix it locks up.

6) I connect only the RED annodes on the 2nd matrix.

7) I fire the sequence and half way through I also connect the BLUE annodes....works 100%.

8) Now with the 2 sets of annodes connected (RED & BLUE) I fire the sequence...MIOS locks up.

This is weird. There's no shorts or anything...the boards work 100% on their own...seems like a quirky SR behavior?

Share this post


Link to post
Share on other sites

So it works fine if only one colour column is connected at bootup, and after boot it works totally OK? Seems like it does something in the init functions that kills it?

Code?

Where's bugfight, he's BLM guru....

Share this post


Link to post
Share on other sites

yeh hold off guys it looks to be a software glitch....something in my C routines that is weirding it out. I'm trolling through it now.

I created another sequence which cycles through the columns first, then the rows...this doesn't lock up at all.

The orig sequence that cycles through rows locks up on the first row...anyways.

Once i get clearer i'll post more info and code...sorry jumped the gun a little.  :-)

Share this post


Link to post
Share on other sites

Nah...it's defiantly a hardware problem.

Whenever more than a constant number of SR outs are driving the annodes the core craps itself. It doesnt matter which SR pins, just over a certain amount of pins activated on both DOUT's will lock it up....must be a current/supply issue. I was reading Ralf's great doco here http://www.suckow.de/ralf/ledmatrix4x20/ on his matrix circuit and he mentions he used 74HCT595N instead of the standard 74HC595 because they support a greater current. I've searched Farnell and others for 74HCT595N but nobody sells them??

Can anyone shed their knowledge/opinion?

Share this post


Link to post
Share on other sites

Isn't that what the ULNs are for?

Share this post


Link to post
Share on other sites

yeah thats what i thought too....but I dont understand enough about it.

Could it just be a logistical thing whereby chaining the 2 matrix boards causes the total circuit to be physically too long/large for MIOS to scan? The longest cable from DOUT to LED group might be almost 2ft..?

Share this post


Link to post
Share on other sites

Should I be supplying the ULN's +5v directly from the +5v out on the PSU instead of through the CORE -> DOUT power chain ?

Share this post


Link to post
Share on other sites

I scrolled up to read the post about your PSU, and I couldn't find it... Then I thought maybe you'd deleted it or something, but I couldn't find my own posts either, so I went to your recent posts page and noticed you'd been crossposting. Please don't do that!

Yes, wire the ULNs direct.

Share this post


Link to post
Share on other sites

Thanks stryd_one...will give that a go - makes sense in retrospect.

Sorry about the cross post didn't realize. Thanks again for the quick responses.

:-)

Share this post


Link to post
Share on other sites

Good luck!

Don't sweat it, fortunately it all strung together well when merged - often they are all out of sequence and it makes for a really difficult read... and lots of edits required by a certain cranky janitor ;)

Share this post


Link to post
Share on other sites

where are your current limiting resistors?

Share this post


Link to post
Share on other sites

bugfight - thanks for the response and question - I omitted them because the LED's were too dim with them (I tested with ~30k on red, ~25k on green, ~20k on red )...I thought this was strange but never asked anyone about it - just left all resistors out - all seems very nice and normal without them until now. Do you think this could be the cause?

I think my problem is my ULN's are hooked up through the CORE>DOUT power chain. Shouldn't I be hooking up the ULN GND/COM to the power supply GND/+5V ?

I'll draw up a rough diagram tomorrow morning and attach it...might explain things easier.

Share this post


Link to post
Share on other sites

Heh, it's probably the resistors. I'm sorry I figured you just left them out of that pic for illustrative purposes. You do need them... How did you calculate those values you tested with? They seem verrry high...

Share this post


Link to post
Share on other sites

yes you need the resisters but they do need to be lower in value because the darlington has a fairly high voltage drop, so you only have somewhere near ~3.5 V instead of 5v (iirc).

it may well be that if your leds are not efficient enough you will need better leds or source supplies for each source pin as well (udnxxxx whatever it was). 

each pin of the 595 can easily supply 25mA or so for a high power led, but the total power with all 8 on at once is too high for the power rating of the 595. i planned on ~12mA max per pin.  if you have the datasheet for your leds, you can calc r as:

    R = (5 - Vuln - Vled) / Iled

where:

    Iled is target current in Ampere

    Vled is the voltage drop of the led at Iled

    Vuln is the voltage drop of the ulnxxxx

(this needs to be adjusted a bit if the timing characteristics of the leds cause them to dim when pulsed)

i made some guestimates to arrive at 150r (since i got my leds surplus), which does seem a bit dim thru the sparkfun buttons.

Share this post


Link to post
Share on other sites

What I dont understand though, is that I can have all pins active on a single DOUT (ie all annodes lighting up all LED's) and the dout/core handles fine. It's only when I chain the 2 douts from the core that it cant manage. The DOUT's themselves seem to be handling fine driving all LED's on at once and it's nice and bright.

I guess what you're saying is if in order to chain the 2 DOUT's I've gotta get all the currents correct and may have to use the resistors because of the greater load the 2nd set of SR's introduce to the core?

The other thing I'm not sure about is with the darlingtons - I have only connected the GND to the DOUT GND. There is nothing connected to the COM pins on the darlingtons. Should I be connecting the COM pins on the darlington to +5v from my power supply? I guess that also means I should connect the GND pins on the darlington to the GND on my power supply?

Appreciate all the help too guys.

Share this post


Link to post
Share on other sites

that is interesting, if you're 595s aren't overheating on one board with all lit, you must be ok.

maybe those leds like a +3v supply?  hm maybe i'll try mine with no res...

so in that case it must be a power supply problem or code.

is this a switching supply?

edit* i'm assuming you tried both singly.  how are you connecting the pair?

Share this post


Link to post
Share on other sites

The LED's are these;

http://www.besthongkong.com/product_info.php?products_id=41

DC forward voltage : VF (IF =20mA)

Green & Blue: 3.2V-3.4V Typ, 3.8V Max

Red: 1.9-2.1V Typ, 2.4V Max

DC reverse current : IR (VR =5V)

100uA

Wavelength : Wd (IF = 20mA)

Red: 625nm

Green: 525nm

Blue: 470nm

The psu is a switcher....not a cheap one...from farnell. The 5v rail is rated at like 6 amps so I guess there's plenty of available current to draw on. Not having any probs with pot values jittering or other signs of dirty power through the circuit.

I'm still wondering if the problem is related to the fact I haven't connected the COM pin on the darlingtons to anything ?

The DOUTs work singly yes...this is how I'm connecting them;

CORE J8  >  1st DOUT J1   

1st DOUT J2  >  2nd DOUT J1

Share this post


Link to post
Share on other sites

that may explain it, though you may be overloading the red ones.

i don't think you need common connected, its for reactive loads....

the fact that it's a switcher may be why current noise causes reboots though.

try a fat cap and a small cap on each array for psu decoupling

Share this post


Link to post
Share on other sites

ok so i can stop rambling about the darlingtons cheers!

not sure where you mean by those caps...i already put in the bypass caps shown here for the dout in and the sr's;

http://www.ucapps.de/mbhp_dout.html

Share this post


Link to post
Share on other sites

Other things I'm thinking it might be;

1) Length of cables going from SR outs to the LED's....longest ones are around 40cm.

2) Is my connection correct?  CORE J8 > 1st DOUT J1  then  1st DOUT J2  >  2nd DOUT J1

3) My dodgy code routines for driving the matrix (full code file attached)

4) Not possible - nobody else has ever ran 2 full 8x8 led matrix's off a single core?

5) Am I trying to bite off more than I can chew...too many electronics knowledge gaps?

ain64_din128_dout128_v2b_CORE_2.zip

ain64_din128_dout128_v2b_CORE_2.zip

Share this post


Link to post
Share on other sites

i took a quick look at the code, and there is much room for improvement.  first i would suggest to use Tick() or Timer() to handle your testing instead of inlining it in Init() and using MIOS_Delay(). there should be examples on uCApps. 

i don't know why this would cause a problem with one array and not the other, though, that does suggest a hardware problem.  try all the permutations (swapping cables, arrays and doutx4) and see if it behaves the same.  you might also try connecting the doutx4 for both arrays, but not the first array itself.

if you want some suggestions on code efficiency, i can give some, but that is another story...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now