Jump to content

Options for driving common anode LED digits?


WickedBlade

Recommended Posts

Hello all.

I'm sorry if this has been asked before but I did a search and the answers I found were not quite satisfying.

I'm building a personal project (see my wiki page) were I want to drive a 2-digits 7-segment LED display with the DOUT. Nothing extraordinary there.

I originally thought to drive the 2 digits separately (non-multiplexed) because I have enough room to wire them separately on 2 different 74HC595 chips, and I figured that LED digits are just cleverly packaged LEDs.

My problem is that I got "common anode" digits instead of "common cathode". So to wire them correctly I would need to wire the anode to 5V and each cathode pin to a 74HC595 output pin. The corresponding segment would lit if the output pin is set to 0. But I understand that this would mean that the 74HC595 would act as current sink, and I'm not sure it will like that. I've seen the subject lightly discussed but with no clear answer (at least to me).

Please note that my digits use blue LEDs which are 3,3V/30mA, not the regular red/green type (I'm using 100R resistors instead of the 220R resistors used for typical LEDs).

So I'd like to know 2 things:

- can I, or shouldn't I, wire the digits as I said?

- if I can't and I have to do some kind of multiplexing (multimon-style), I'm afraid that the display will be darker than the other (single) LEDs I use in my project. Is this a valid fear? I mean, from the datasheets, I gather that the maximum current output from the 74HC595 is 35mA, which would be split between 8 segments, right? Is that not a bit low? Plus, there's the multiplexing thing...

I guess another option would be to use a darlington array, but I'd like to avoid complicating the hardware more than it already is...

Any advice?

Link to comment
Share on other sites

Thanks for replying :)

The thing is that in this diagram (from MIDIMON), the digits are multiplexed, and if you look closely, you'll notice that the common anodes are 'fed' by a 74HC595, so it can't be more than 35mA (maximum rating from datasheets). I'm afraid that this won't be enough and the digits will be too dim, or, conversely, that the digits will draw too much power to get properly lit and that it will fry the 74HC595. That's basically my second question...

Of course, if this works, I could basically wire each common anode to a separate pin and set it to 1, and I wouldn't have to worry about multiplexing, but I'm still in doubt about the power consumption and brightness, especially since my digits are blue instead of the regular red/green.

Link to comment
Share on other sites

Thanks for the suggestion. I'm at a point where I would rather avoid adding more stuff to the project (I'm over my budget  :( and the case is running out of space to fit more chips and boards).

I've tested a simple LED-resistor combo with 5V power supply just to make sure I had correct current estimates. It seems that a blue LED with a 100R resistor draws about 21mA, which is in the correct range for the HC595.

I've been thinking about the multiplexing technique again and there's something I don't quite understand, maybe someone can shed some light. I understand that LEDs don't switch off immediately when they're not fed, so I'm reassured that I won't notice artefacts with the technique (but maybe a less bright lighting?).

What I don't get is, I've read that there's a maximum current sinking rate that the 74HC595 can handle (I think I've read it's about 100mA but I can't find the thread where I read that). So, if one 74HC595 feeds the common anode of the digits, and all the segments of the digit are lit, I don't see how all of them can be fed to the correct value (that would be ~14mA for a red or green digit, ~21mA for a blue one). I mean, if all segments are lit, they need 14x7=112mA, which is above the sinking current max. Furthermore, if the common anode pin can only provide 35mA (according to datasheets), I fail to see how this can feed the digit correctly...

And yet, the MIDIMON project is evidence that this does work. So is there something I'm unaware of? Is there some software trick?

Link to comment
Share on other sites

Hey,

i read your post and just remembered the following thread. This (the user) did some extensive testing there, e.g. draining up to 35mA from 8 pins at once.

http://www.midibox.org/forum/index.php/topic,13460.msg115545.html#msg115545

Just in case you missed it in your search.

What i read from there is, that the maximum total current is mainly to make sure, the chip stays in specs for logic-1, which it is intended for. seems it actually even survives beyond 200mA total current.

Do you have the modules already built? then i would just give it a try :) According to the thread you will hardly be able to fry the chip, nor your led-digits. so there's no risk.

just my humble 2 Cents. i'm not really experienced in that stuff  :P

Cheers,

Alex

Link to comment
Share on other sites

Thank you. As a matter of fact I found this thread myself after posting my last question.

It is indeed very interesting, although it focuses mainly on current drawing and I'm interested more in current sinking. Well I'll guess I'll just have to try.

My project is in progress so it's not entirely built yet, I can't test anything as is... Considering the thread you mention, I guess I'll just try and see how it works, and try alternatives only if things look awry...

Link to comment
Share on other sites

I was thinking again (it's a curse I'm under) and thought, if I have enough shift registers to drive 2 digits (that is 2 RS), why would I multiplex them? Can't I just wire the common anode of the digits to +5V and be done with it?

Maybe by kind of multiplexing the segments to avoid putting too much sinking current through the RS, I mean trigger only segment a-b-c-dot one time and then d-e-f-g the other? Of course that would be done in software with clever masking, but that's nothing difficult...

Link to comment
Share on other sites

hehe, i know that curse  :P took me 2 weeks to come up with the "perfect" menu-engine in order to have tidy and small code. now i'm almost finished, my code is a real mess and the app with only the menu takes up 10kB  :o yet, it could have been worse and i'm really flexible with the menu, so it still paid :)

back to topic: i just glanced into the datasheet from st-microelectronics and found a little diagram of the output-stages on page 2. i don't know much about CMOS, but it's so perfectly symmetric, that i doubt, it bothers about being a source or a sink. isn't that, what they do for multiplexing as well?

about the multiplexing: did you take into account, that one of the SR has to supply current for 4 leds through one pin in the worst case? sounds worse than 8 leds through 8 pins in my opinion :P

i still believe, 1 digit through 1 SR is the best solution for you, if you have enough spare SRs.

you said, you have more blue LEDs connected apart from the digits. i guess they go 1 LED to 1 pin as well? if this works fine, why should it be different for the digits?

i hope i don't send you to thinking-nirvana with that :)

Cheers, Alex

Link to comment
Share on other sites

hehe, i know that curse  :P took me 2 weeks to come up with the "perfect" menu-engine in order to have tidy and small code. now i'm almost finished, my code is a real mess and the app with only the menu takes up 10kB  :o yet, it could have been worse and i'm really flexible with the menu, so it still paid :)

I don't think I'll go that far. If it fits in the PIC memory, it will do :)

back to topic: i just glanced into the datasheet from st-microelectronics and found a little diagram of the output-stages on page 2. i don't know much about CMOS, but it's so perfectly symmetric, that i doubt, it bothers about being a source or a sink. isn't that, what they do for multiplexing as well?

about the multiplexing: did you take into account, that one of the SR has to supply current for 4 leds through one pin in the worst case? sounds worse than 8 leds through 8 pins in my opinion :P

Yes, I noticed (I even mentioned it in a previous post). I think I'll just wire the common anode to +5V and alternately lit half the segments of a digit, then the other half to avoid too much sinking current at a time through the SR.

i still believe, 1 digit through 1 SR is the best solution for you, if you have enough spare SRs.

you said, you have more blue LEDs connected apart from the digits. i guess they go 1 LED to 1 pin as well? if this works fine, why should it be different for the digits?

Well I haven't wired and tested those LEDs yet either, but it seems to be standard practice for the MIDIBOX project, so I guess it works fine. I believe that I'll do some kind of alternating switching too to avoid too much load, and I think it will dim the LEDs a bit, which should be fine since at full power those LEDs are VERY bright (I bought the ultrabright variety).

i hope i don't send you to thinking-nirvana with that :)

Cheers, Alex

No worries, I'm already there. :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...