Searching \ for '[PIC:] Multiplexing seven segment displays, correc' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Multiplexing seven segment displays, correc'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] Multiplexing seven segment displays, correc'
2004\03\17@030401 by Andre Miller

flavicon
face
Hi,

For the display of my project I'm using four seven segment displays (common
anode), using 8 IO pins for the segments, and another 4 to drive the
individual displays. The four displays are driven through a BC557 transistor
(with a 1K resistor on the gate), and each segment is connected to an IO pin
through a 330 Ohm resistor (all segments are common to all displays, going
through the same resistor. I hope this is all clear :-)

To drive the displays I repeat the following via a timer interrupt
(Prescaler set to 1:1, 8 bit timer, 4 Mhz clock):

1) Turn on display X, turn off all other displays
2) Set the correct segments for display X
3) Add one to X
4) If (X > 4), set X = 1

So each time the ISR executes it turns on the next display, etc.

Problem is, the segments on the displays are very dim if I do this. If I
only have one display on, then it is the correct brightness. This is
understandable since each display is only on for 1/4 of the time now. I was
thinking maybe I could just use a quarter of the value resistor instead
(replace 330 Ohm with 100 Ohm, for example). But then, won't it draw too
much current even if its only for a fraction of second, or will it all
average out? Also, if something happens which cause the pic to stop
multiplexing the displays, there is the possibility of only one display
being on for a long period of time (clocking stops, transistor failure,
etc).

Any suggestions on how to overcome this?
________________________________
       
André Miller        

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@042156 by hael Rigby-Jones

picon face
{Quote hidden}

You need to drive the displays with a higher current to compenstate for the
duty cycle they are working at.  In this case you would need around four
times the current.  You have to make sure that you do not exceed the
specifications of the displays, but generaly LEDs can take much higher than
normal currents if the current is only flowing for a brief period.

Also, you should may think about modifying the sequence you have listed
above:

>1) Turn on display X, turn off all other displays

At this point, digit  X will have the same segments illuminated as the
previous digit.

>2) Set the correct segments for display X

Now it's displaying the correct segments.  However, the wrong segments were
illuminated for a short time, this will tend to reduce the contrast of the
display.  A better sequence would be something like:

1) Turn off all digits
2) Set the segments for digit X
3) Turn on digit X

Regards

Mike




=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to
postmasterspamKILLspambookham.com.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@050422 by Spehro Pefhany

picon face
At 10:03 AM 3/17/2004 +0200, you wrote:
>
>Hi,
>
>For the display of my project I'm using four seven segment displays (common
>anode), using 8 IO pins for the segments, and another 4 to drive the
>individual displays. The four displays are driven through a BC557 transistor
>(with a 1K resistor on the gate), and each segment is connected to an IO pin
>through a 330 Ohm resistor (all segments are common to all displays, going
>through the same resistor. I hope this is all clear :-)
>
>To drive the displays I repeat the following via a timer interrupt
>(Prescaler set to 1:1, 8 bit timer, 4 Mhz clock):

Better if you turn off all displays, set correct segments, then
turn on display X. Prevents "ghosting".

{Quote hidden}

Use a better filter in front of the display, use more average current,
or use a better display. Don't exceed the PIC specifications. Usually if
you run a good display at a fairly conservative current you'll get good
brightness and no worries if the multiplexing stops (say someone touches
the crystal leads), at least for a short period of time at room
temperature.

Here's the ones we have:
http://www.trexon.com/leds/trexon_led_display.pdf

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
.....speffKILLspamspam.....interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@051834 by Howard Simpson

flavicon
face
Andre Miller wrote:
{Quote hidden}

 If you have the time to spare, leave the leds on for a while, few mS,
then switch to the next segment, and so on.
 In other words, increase the "on" time compared to the off time.
 Only works if your chip hasn't much else to do.
regards
Howard.

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@052249 by Spehro Pefhany
picon face
At 08:12 PM 3/17/2004 +1000, you wrote:

>  If you have the time to spare, leave the leds on for a while, few mS,
>then switch to the next segment, and so on.
>  In other words, increase the "on" time compared to the off time.
>  Only works if your chip hasn't much else to do.

He's using interrupts, so his program can walk and chew gum at the
same time, no problem. It shouldn't use more than a couple percent
of the processor throughput.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
EraseMEspeffspam_OUTspamTakeThisOuTinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@055232 by Andre Miller

flavicon
face
Hi,

If I increase the 'on' time for a display, wont this then also increase the
'off' time for the other displays, thereby negating the benefit? I should be
able to get this same effect by increasing the prescaler on my timer
interrupt that drives the displays. I tried changing this and the lower
frequency of updating didn't seem to make a difference, except that it
starts to flicker noticibly when its too low :-).

 _____
André Miller        


{Original Message removed}

2004\03\17@075058 by bertrand.rozier

flavicon
face
Hi,

I think there is not possiblity to improve that in soft.
Could you confirm that you can not add a 7-segment drivers?

BR
Bertrand Rozier
http://www.pragmatec.net
PICOS18 Solutions

Selon Andre Miller <andre.millerspamspam_OUTBLUERIVER.CO.ZA>:

{Quote hidden}

> {Original Message removed}

2004\03\17@082911 by Andre Miller

flavicon
face
I probably can, but doing it this way is more fun :-).

I'm just going to lower the resistor values to get the correct brightness
then (without exceeding the PIC ratings of course).
 _____  
André Miller        

{Original Message removed}

2004\03\17@150434 by Byron A Jeff

face picon face
On Wed, Mar 17, 2004 at 10:03:16AM +0200, Andre Miller wrote:
>
> Hi,
>
> For the display of my project I'm using four seven segment displays (common
> anode), using 8 IO pins for the segments, and another 4 to drive the
> individual displays. The four displays are driven through a BC557 transistor
> (with a 1K resistor on the gate), and each segment is connected to an IO pin
> through a 330 Ohm resistor (all segments are common to all displays, going
> through the same resistor. I hope this is all clear :-)

Perfectly.

>
> To drive the displays I repeat the following via a timer interrupt
> (Prescaler set to 1:1, 8 bit timer, 4 Mhz clock):
>
> 1) Turn on display X, turn off all other displays
> 2) Set the correct segments for display X
> 3) Add one to X
> 4) If (X > 4), set X = 1

Typical.

>
> So each time the ISR executes it turns on the next display, etc.
>
> Problem is, the segments on the displays are very dim if I do this.

Expected for the reason you list below.

> If I
> only have one display on, then it is the correct brightness. This is
> understandable since each display is only on for 1/4 of the time now. I was
> thinking maybe I could just use a quarter of the value resistor instead
> (replace 330 Ohm with 100 Ohm, for example). But then, won't it draw too
> much current even if its only for a fraction of second, or will it all
> average out?

It'll draw too much current (Somewhere in the ballpark of 30ma). Bad idea.

> Also, if something happens which cause the pic to stop
> multiplexing the displays, there is the possibility of only one display
> being on for a long period of time (clocking stops, transistor failure,
> etc).

Yup. A dangerous possibility.

>
> Any suggestions on how to overcome this?

The way I'd generally handle this is to add more hardware to the mix. One
of my favorites for driving displays is the 7445 BCD to decimal decoder.
While you can only drive one segment at a time with it, it'll drive that
segment with 80ma of current. So you can hook it up this way:

1) Tie 4 I/O pins to the BC557 via the 1k as you have. But now transfer the
  current limiting resistor (which can now be 47 ohm) between the collector
  and the anodes of the display. Keep the emitter tied to Vdd as before.

2) Now wire each segment cathode of the display to a output on the 7445.
  You'll even have two left over output to tie to individual LEDs or use
  to read switches if you like.

3) Take the DCBA input of the 7445 and tie to 4 more I/O pins.

One reason I like this setup is because you save 4 I/O pin and can drive
the entire display from a single 8 bit port.

Your algorithm is slightly more complex now. Also to prevent bleed some
rearranging is in order:

0) Turn off all displays. Prevents bleed.
1) Set the correct segment for display X by incrementing segment count (SC) on
   7445 DCBA input. I'd normally use a shadow register for this but I'm
   paranoid.
2) Check to see if the segment is supposed to be on.
3) If it's supposed to be on, then turn on the display
4) If SC > 7 then SC = 0 and X = X+1
4) If (X > 4), set X = 1 [You can also do this by shifing a 0 through
   the 4 bits assigned to the BC557.

Clock speed should be fine. Note that you should delay for each segment
whether or not it is turned on or off.

As for display protection it's harder than you think. The question is if the
OSCOUT for the PIC is guaranteed to operate even if the PIC code is wandering
in the weeds. If so then you can make an external watchdog using a ripple
counter and some OR gates. Clock a counter like a 74HC4020 with the OSCOUT
gated through an OR gate (more on this in a minute). Then take an output of
the counter that represents the MAX on time you want to allow and tie it to
the input of two more or gates, and the OSCOUT OR gate's other input. Next
pick a lower output and tie it to the RB0/INT pin of the PIC. Then separate
the D and C inputs of the 7445 from the PIC, wire those PIC outputs to the
other input of the two OR gates above, and wire the outputs of the OR gates
back to the D and C inputs of the 7445. I still have one thing to figure out
so I'll come back to it in a minute but presume for the moment that another
PIC I/O pin is tied to the active high reset of the counter.

Here's how it works. The OSCOUT will clock the counter at 1 Mhz. The MAX output
of the counter is the timeout. When it goes high it forces each of the three
OR gates that it's connected to to go high. The gated clock will stop and the
D and C inputs to the 7445 will go high. The 7445 is designed to ignore
invalid inputs. With DC both high the count will be 12 or above. So all of the
outputs of the 7445 turn off, turning off the display.

The interrupt output of the counter can give you a steady stream of pulses
to interrupt the PIC. All you have to do in the interrupt routine is to
reset the counter to set up the next interrupt and to reset the external
watchdog.

The only part I don't have figured out is the fact that reset needs to be
edge driven instead of level driven. A flip flop is in order, but I'd like
to figure out how to do this without adding another chip to the mix. The
behavior should be: the reset I/O pin of the PIC goes high (or low as needed)
and the counter resets. Since the interrupt that generated the reset was tied
to a high output pin on the counter, that pin will go low. The falling edge
of that pin going low should release the reset, so even if the reset from the
PIC I/O remains set, the counter doesn't remain in reset.

But it's a bit of real estate to pull off. Maybe trusting the PIC watchdog
is the right answer.

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@151051 by Byron A Jeff

face picon face
On Wed, Mar 17, 2004 at 03:28:11PM +0200, Andre Miller wrote:
> I probably can, but doing it this way is more fun :-).
>
> I'm just going to lower the resistor values to get the correct brightness
> then (without exceeding the PIC ratings of course).

See my other post. I don't think you'll get there. Presuming a 1.7V drop
the absolute lowest resistance is 3.3/.024 -> 137 ohms. And that's pushing
the edge of the PIC I/O current drive capability. But the brightness will
still only seem to 137*4 -> 548 ohms. So it won't seem too bright.

My suggestion is to add a 7445 BCD to decimal driver will allow for 70 ma sink
through a 47 ohm resistor, though you can only light 1 segment at a time
instead of one display at a time.

BAJ.
>
>   _____
>
> Andr? Miller
>
> {Original Message removed}

2004\03\17@163617 by Andre Miller

flavicon
face
Thanks Byron,

I read your other post, very informative!

What I have done in the meantime is change the algorithm as you and others
have suggested to get rid of 'ghosting'. It actually helped quite a bit to
increase the contrast. I didn't even realise it was ghosting till I took a
closer look at the 'off' segments.

Unfortunately I had already built a proto/dev board without the display
driver. But if I were to build a new one I will definitely look into using
the method you suggested. Although I guess I could just put the driver
between that board and my PIC.

One question though (I guess I can just go read this in the 7445 Datasheet!)
the driver presumably has a fixed number of 'shapes' it can display, say,
0-9, a-f. I wouldn't be able to make custom shapes, or use it to drive the
decimal point, right?


_____  
André Miller        

{Original Message removed}

2004\03\17@164234 by John N. Power

flavicon
face
> From:         Andre Miller[SMTP:@spam@andre.millerKILLspamspamBLUERIVER.CO.ZA]
> Sent:         Wednesday, March 17, 2004 5:51 AM
> To:   KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU
> Subject:      Re: [PIC:] Multiplexing seven segment displays, correct resistor values?

> Hi,

> If I increase the 'on' time for a display, wont this then also increase the
> 'off' time for the other displays, thereby negating the benefit? I should be
> able to get this same effect by increasing the prescaler on my timer
> interrupt that drives the displays. I tried changing this and the lower
> frequency of updating didn't seem to make a difference, except that it
> starts to flicker noticibly when its too low :-).

>  _____
>
> Andre Miller

The duty cycle for each display is 1/4, and this is the only part of
the switching which affects brightness. Changing the frequency
while keeping the duty cycle at 1/4 will only change the overall
appearance of flickering. The only other factor controlling brightness
is the current per segment.

John Power

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@164627 by Byron A Jeff

face picon face
On Wed, Mar 17, 2004 at 11:35:00PM +0200, Andre Miller wrote:
> Thanks Byron,
>
> I read your other post, very informative!

No problem.

>
> What I have done in the meantime is change the algorithm as you and others
> have suggested to get rid of 'ghosting'. It actually helped quite a bit to
> increase the contrast. I didn't even realise it was ghosting till I took a
> closer look at the 'off' segments.

It definitely happens.

>
> Unfortunately I had already built a proto/dev board without the display
> driver. But if I were to build a new one I will definitely look into using
> the method you suggested. Although I guess I could just put the driver
> between that board and my PIC.

Correct. That would be the right place for it to go.

>
> One question though (I guess I can just go read this in the 7445 Datasheet!)
> the driver presumably has a fixed number of 'shapes' it can display, say,
> 0-9, a-f. I wouldn't be able to make custom shapes, or use it to drive the
> decimal point, right?

You missed the point a bit. The 7445 is a 1 of 10 BCD decoder. So you put in
a 4 bit BCD number from 0-9 and the part drives one (and only one) of 10
outputs low with up to 80 ma of sink current.

So by connecting 8 of the outputs to the 8 cathodes of the display you can
select each one of the segments, but only one at a time.

So it isn't like a 7447 or 7448 which translates a 4 bit value into a 7 segment
translation. So to answer your questions:

1) No it doesn't have a fixed number of shapes.
2) It can display 0-9 and a-f
3) You can make custom shapes.
4) And you can drive the DP of any display.

In addition you'll have two loose outputs that you can repurpose say for
an individual LED or somesuch.

If it turns out you don't need those extra two outputs then you can get away
with 3 input pins into the 7445 and still drive all seven segments + DP.

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@170238 by Jan-Erik Soderholm

face picon face
Hi.
Another alternative to drive 4 displays can be found here :
http://www.voti.nl/shop/products_1.html#IC-MM5450

Drives 4 displays directly without multiplexing with
serial input (uses just a few PIC pins).

Jan-Erik

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@170657 by Andre Miller

flavicon
face
Hi Byron,

Thanks, I guess I should have gone and read that datasheet. I just assumed
you meant a BCD to 7 Seg display driver. I understand now what you meant.

I'll add the driver chip and implement the algorithm you suggested and come
back if I have more questions :-).

> Your algorithm is slightly more complex now. Also to prevent bleed some
rearranging is in order:
>
>  0) Turn off all displays. Prevents bleed.
>  1) Set the correct segment for display X by incrementing segment count
(SC) on
>     7445 DCBA input. I'd normally use a shadow register for this but I'm
>     paranoid.
>  2) Check to see if the segment is supposed to be on.
>  3) If it's supposed to be on, then turn on the display
>  4) If SC > 7 then SC = 0 and X = X+1
>  4) If (X > 4), set X = 1 [You can also do this by shifing a 0 through
>     the 4 bits assigned to the BC557.
>
> Clock speed should be fine. Note that you should delay for each segment
whether or not it is turned on or off.


 _____  
André Miller        


{Original Message removed}

2004\03\17@171731 by Spehro Pefhany

picon face
At 12:05 AM 3/18/2004 +0200, you wrote:
>
>Hi Byron,
>
>Thanks, I guess I should have gone and read that datasheet. I just assumed
>you meant a BCD to 7 Seg display driver. I understand now what you meant.
>
>I'll add the driver chip and implement the algorithm you suggested and come
>back if I have more questions :-).

Actually, I strongly suggest that if you want to add a driver, you just put
a ULN2803 in there and invert the segment lines. *Much* kinder to the LEDs
than trying to run them at 32 times the desired average current. In fact
you may not get any real improvement at all with the 7445.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
RemoveMEspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@173259 by Andre Miller

flavicon
face
Hi,

Sorry to reply to my own mail, but I just had another thought.

Won't using this algoritm change my 'duty cycle' from 1/4 to 1/32 since now
I can only have one segment on at a time. Will the 80ma I can now supply
that single segment make up for the change in duty cycle?
Also, could the algorithm be modified to the following:

Segment Count, SC = 0

1) Turn off all displays
2) Turn on SC segment with 7445 driver.
2) For each display (1 to 4), see if this segment is on or off
3) Turn on those displays that have that segment on
4) Increment SC
5) If (sc > 7), se SC = 0
6) Delay for fixed time

That should change the duty cycle to 1/8, right?

 _____  
André Miller        


{Original Message removed}

2004\03\17@174337 by Spehro Pefhany

picon face
At 12:31 AM 3/18/2004 +0200, you wrote:
>Hi,
>
>Sorry to reply to my own mail, but I just had another thought.
>
>Won't using this algoritm change my 'duty cycle' from 1/4 to 1/32 since now
>I can only have one segment on at a time. Will the 80ma I can now supply
>that single segment make up for the change in duty cycle?

No, because the PIC can supply 25 * 8 = 200mA vs. 80mA. Thus your display
will be much dimmer.

{Quote hidden}

Yes you can do this, and it is better. You must move the resistors to
the anodes from the segments (so there are fewer of them). But the
total display current is still limited to 80mA, so the net result is
that you've added a part which draws 50mA all by itself, and have a
display that is about 1/3 as bright, but save 4 port pins and 4 resistors
(or 1/0.5 network).

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spamBeGonespeffspamBeGonespaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\17@184842 by Jinx

face picon face
part 1 905 bytes content-type:text/plain; (decoded 7bit)

Andre, I use this circuit when I need a really bright display.
Refresh rate is ~200Hz. It can consume up to 350mA (but
is very visible). By using further outputs of the 4017 it can be
extended to 10. Note optional decimal points and blanking

Data is presented in ABCD (ie a nybble) form to the 4543
buss and the digit selected. This could be reduced to just 2
pins for 10 digits, or more if 4017's are daisy-chained, by

a) using an RC filter on the 4017's Clock/Reset so that a
long pulse resets it, a short one clocks it. Or simply clock
through unimplemented digits and forget Reset

b) using a parallel-serial shift register for the data

Straying a little from your original question but it's an alternative

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads




part 2 4747 bytes content-type:image/gif; (decode)

2004\03\17@190125 by Byron A Jeff

face picon face
On Wed, Mar 17, 2004 at 05:51:17PM -0500, Spehro Pefhany wrote:
> At 12:31 AM 3/18/2004 +0200, you wrote:
> >Hi,
> >
> >Sorry to reply to my own mail, but I just had another thought.
> >
> >Won't using this algoritm change my 'duty cycle' from 1/4 to 1/32 since now
> >I can only have one segment on at a time.

That is correct .

> >Will the 80ma I can now supply
> >that single segment make up for the change in duty cycle?
>
> No, because the PIC can supply 25 * 8 = 200mA vs. 80mA. Thus your display
> will be much dimmer.

OK. Let's work through the numbers and see if there's a breakeven anywhere
here.

First off the 25ma is an absolute rating. Not a smart idea to actually
try to draw 25ma of current through a pin (or the 200ma through a port) .

Next with the 330 ohm resistors in the original circuit (and presuming a
1.7V LED drop) each segment is only getting 9.6 ma of current each.

So in the original circuit (which may be fixable BTW) the average current
through each segment is 9.6ma/4 -> 2.4 ma.

Now with the single segment getting 80ma at a 1/32 cycle the average cycle
is 80ma/32 -> 2.5 ma

So Spehro is right, not a whole lot of advantage.

{Quote hidden}

The display should be just about as bright as the original.

But running the numbers indicates that you can drop the resistance
significantly and still be in the PIC's current rating. This is a case
where it's important to take the LED's forward voltage drop into account.
Let me give the nickle explanation: The current limiting resistor in an LED
circuit is designed to cap the total amount of current flowing through
the circuit. Also each node of the circuit (LED and resistor in this case)
have the same amount of current flowing them. Finally the LED will consume
(called dropping) a portion of the voltage provided. This forward voltage
is determined by LED type, temp, and current flowing through it. However
at room temp it's pretty fixed for each type of LED.

So the upshot of the explanation is that the current flowing through the
circuit is determined by the resistance and the voltage drop. The current
is computed using Ic = (V - Vled)/R where V is the supply voltage, Vled the
LED voltage and R the resistance. Solving for R gives R = (V-Vled)/Ic.

So let's plug in some numbers. 20 to 22 ma is pushing the PIC. I'll pick 22.
Presume that the LED drops 1.7V (IIRC that's red LEDs typical drop).
Assuming a Vdd of 5V. SO...

R = (5-1.7)/0.022 -> 3.3/0.022 -> 150.

Bingo! Put in 150 ohm resistors. The PIC I/O leads will sink 22ma and the
average current will be 22/4 -> 5.5 ma which is more than twice the
brightness of either the original, or my 7445 solution.

Now the truth of the matter is that the really right way to do it is to
wire in 8 NPN signal transistors (2N2222 or BC equivalent) along with
8 2.2K base resistors and tie them between the cathodes of the segments
(collector), the current limiting resistor (after the cathode) to GND.

Then you can drop the resistance down to the current limit of what the
BC547 or the LED's can handle at 25% duty cycle.

But I'd drop the resistors to 150 ohms first and see if it's bright
enough. If so then call it a day.

BAJ

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads

2004\03\18@001153 by William Chops Westfield

face picon face
On Wednesday, Mar 17, 2004, at 14:01 US/Pacific, Jan-Erik Soderholm
wrote:

> Another alternative to drive 4 displays can be found here :
> http://www.voti.nl/shop/products_1.html#IC-MM5450
>
> Drives 4 displays directly without multiplexing with
> serial input (uses just a few PIC pins).
>
Yuck.  It's huge.  The circuit described by the OP is used in lots of
projects that I've seen.  With only 4 digits, it "ought" to be bright
enough.  Maybe you need to look for a brighter display :-)

BillW

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\03\18@001158 by William Chops Westfield

face picon face
> drive 4 displays

Just as an outside chance, have you measured the actual current you're
getting through the displays when they are in "ON" state?  Perhaps it
is lower than you expect due to other problems...

BillW

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\03\18@001203 by William Chops Westfield

face picon face
On Wednesday, Mar 17, 2004, at 15:59 US/Pacific, Byron A Jeff wrote:

> Now with the single segment getting 80ma at a 1/32 cycle the average
> cycle is 80ma/32 -> 2.5 ma

Don't forget that psychological effects enter the picture at some
point.  An LED pulsed at 8x current 1/8th of the time LOOKS brighter
than one just getting 1x current continuously.  (I don't recall whether
that helps with things like daylight visibility, or whether it's just a
perceptive phenomenon.)

BillW

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\03\18@050642 by Howard Simpson

flavicon
face
Spehro Pefhany wrote:
> At 10:03 AM 3/17/2004 +0200, you wrote:
>
>>
>> Hi,
>>
>> For the display of my project I'm using four seven segment displays
>> (common
>> anode), using 8 IO pins for the segments, and another 4 to drive the
>> individual displays. The four displays are driven through a BC557
>> transistor
It would seem I was hasty with my suggestion of timing the led "on"
time, due to it being some months since I did it.
I have dug out some of the code, and reproduce it here.
All those with more experience ten ine welcome to pull it to bits.
Regards
Howard
 led_lookup
;----------
;
;rb7=d, rb6=c, rb5=e, rb4=g, rb3=f, rb2=a, rb1=b, rb0=interrupt
       addwf   pcl,f   ; Jump into the correct location
;                 dcegfab(int)
       retlw   b'00010000'     ;       0
       retlw   b'10111100'     ;       1
       retlw   b'01001000'     ;       2
       retlw   b'00101000'     ;       3
       retlw   b'10100100'     ;       4
       retlw   b'00100010'     ;       5
       retlw   b'00000010'     ;       6
       retlw   b'10111000'     ;       7
       retlw   b'00000000'     ;       8
       retlw   b'00100000'     ;       9
       retlw   b'11111110'     ;       blank
;--------------------------------
       ;seven segment patterns, based on clear to light segment
       ;so segments not lit are set
       ;bits 1 to 7 are for leds
       ;bit 0 not used for leds, it's the wheel interrupt
       ;NOTE!!! So as not to have to fuck with the upper PC byte
       ;this routine must be in the first 256 bytes of prog memory
;----------------------------------
;-------
;       RA0 is thous driver, RA1 is hunds, RA2 is tens, RA3 is units, ; RA5 is
Dec'Point
;       0 bits are switched on.  1 bits are switched off
;       dpflag is set to show dec point
;--
       call    timer0          ;start timer
       movfw   units           ;load with units digit
       call    led_lookup
       movwf   led_segs        ;copy to led_segs
       movlw   b'000111'       ;default decimal point on
       btfss   dpflag          ;skip to show decimal point
       movlw   b'100111'
       movwf   porta
       call    timer_end       ;wait for timeout
;--
       call    timer0          ;timer stops "leakage" between digits.                          ;slows multiplexing
       movfw   tens            ;load with tens digit
       call    led_lookup
       movwf   led_segs        ;copy to port b (bit7 will be zero                                              ;because digit
is always 9 or less
       movlw   b'001011'       ;default decimal point on
       btfss   dpflag          ;skip to show decimal point
       movlw   b'101011'
       movwf   porta
       call    timer_end       ;wait for timeout

       ;keep going for the rest of the digits

;--------
;---------------
timer0
;---------------
                               ;set for one millisecond
       bcf     intcon,t0if
       clrf    tmr0
       return
timer_end
loop02  btfss   intcon,t0if
       goto    loop02
       return
;--------------------------------

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\03\18@082058 by Michael Johnston

picon face
Hi
Has anyone used the max7219 led display chip from maxium? It will drive 8 -
seven segment displays  plus the decimal point or 64 individual leds. I am
using one in my clock that an aquantance of mine designed a few years back
Michael Johnston
{Original Message removed}

2004\03\18@083340 by Koen van Leeuwen

flavicon
face
On Thursday 18 March 2004 05:58, William Chops Westfield wrote:
> On Wednesday, Mar 17, 2004, at 15:59 US/Pacific, Byron A Jeff wrote:
> > Now with the single segment getting 80ma at a 1/32 cycle the average
> > cycle is 80ma/32 -> 2.5 ma
>
> Don't forget that psychological effects enter the picture at some
> point.  An LED pulsed at 8x current 1/8th of the time LOOKS brighter
> than one just getting 1x current continuously.  (I don't recall whether
> that helps with things like daylight visibility, or whether it's just a
> perceptive phenomenon.)
>

Depending on the LED construction, the luminous intensity goes linear,
exponential or piecewise decreasing linear with current. Look at the curves,
for example, in this datasheet: (luminous intensity vs. forward current)
http://www.avc.ru/binaries/16395/TC1211HWA.pdf
So, depending on the LED type, pulsing with 8*the current with 1/8 duty cycle,
will give a higher, equal or lower luminous intensity :o)

All depends on the specific leds inside.

Koen

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\03\18@085257 by Spehro Pefhany

picon face
At 02:36 PM 3/18/2004 +0100, you wrote:


>Depending on the LED construction, the luminous intensity goes linear,
>exponential or piecewise decreasing linear with current. Look at the curves,
>for example, in this datasheet: (luminous intensity vs. forward current)
>http://www.avc.ru/binaries/16395/TC1211HWA.pdf
>So, depending on the LED type, pulsing with 8*the current with 1/8 duty cycle,
>will give a higher, equal or lower luminous intensity :o)
>
>All depends on the specific leds inside.
>Koen

Yes, modern LEDs generally don't show much difference. At least above the
flicker fusion frequency, which, of course, is where a display would be
operating. For visual indicators such as alarms you can get more apparent
brightness per average mA by flashing at a high peak current.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
TakeThisOuTspeffEraseMEspamspam_OUTinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2004\03\18@182935 by D & I Kelloway

flavicon
face
Check out the Silicon Chip web site:

http://www.siliconchip.com.au

In particular: Project: Big Digit 12/24 hour clock by John Clarke, March,
2001 Silicon Chip magazine.

Regards

Dylan

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...