Driving a 20 seg bar graph - Help wanted please

R

Rex Turner

Jan 1, 1970
0
Need to drive a bar graph where the usual 10 segment will not be enough.
Was thinking of going to a 20 segment display.
Has anyone a link that will point me in the right direction, please.
TIA,
RexT.
 
M

Mike Diack

Jan 1, 1970
0
Need to drive a bar graph where the usual 10 segment will not be enough.
Was thinking of going to a 20 segment display.
Has anyone a link that will point me in the right direction, please.
TIA,
RexT.

A few ways of cracking this nut :
1 : cascade a couple of LM3915s (Audio) or LM3914s(linear). This is my
least favourite as LM3915s are expensive.

2 : Use 5 X LM339 quad comparators and a resistor chain - this is the
way most of the biggie rat mixer makers (Soundcraft, A&H etc) do it -
OK its a bunch of chips, but LM339s are **really** cheap.

3 : (My fovourite) Use a PIC with an onboard A/D converter - the fact
that pics have port pins that can be driven hard high, driven hard low
or tristated means you can drive a lotta leds with not many port pins.
 
U

Unbeliever

Jan 1, 1970
0
3 : (My fovourite) Use a PIC with an onboard A/D converter - the fact
that pics have port pins that can be driven hard high, driven hard low
or tristated means you can drive a lotta leds with not many port pins.

Hey that's a neat trick. For those who missed it, drive two leds off one
port pin by not pulsing for neither led, pulsing high to tri-state for one,
low to tristate for the other, or high to low for both. Thanks, Mike.

Cheers,
Alf
[email protected]
www.micromagic.net.au
 
M

Mike Harding

Jan 1, 1970
0
Hey that's a neat trick. For those who missed it, drive two leds off one
port pin by not pulsing for neither led, pulsing high to tri-state for one,
low to tristate for the other, or high to low for both. Thanks, Mike.

Sorry, don't understand. Could you do an ASCII drawing please?

Mike Harding
 
M

Mike Diack

Jan 1, 1970
0
Sorry, don't understand. Could you do an ASCII drawing please?

Mike Harding

Sorry, ASCII impaired.
Take a 12C671 (or F variant), an 8 pin pic. You use AN0 as the analog
input. You use GP1,2,4,5 as the 4 outputs. There are 12 ways you can
hook a led across 4 pins (you use a current limit resistor in each of
the 4 legs). You have a software comparison chain to trigger one of
these combinations for each of 12 voltage ranges between [0..255]
out of the a/d converter. You choose your own breakpoints.This gives
you a flying dot display with 12 dots. Using time division mpxing you
can get a bargraph instead of dots. For more leds, use a bigger PIC. A
12 dot display using a <$2 chip appeals to me.
M
 
M

Mike Harding

Jan 1, 1970
0
Sorry, ASCII impaired.
Take a 12C671 (or F variant), an 8 pin pic. You use AN0 as the analog
input. You use GP1,2,4,5 as the 4 outputs. There are 12 ways you can
hook a led across 4 pins (you use a current limit resistor in each of
the 4 legs). You have a software comparison chain to trigger one of
these combinations for each of 12 voltage ranges between [0..255]
out of the a/d converter. You choose your own breakpoints.This gives
you a flying dot display with 12 dots. Using time division mpxing you
can get a bargraph instead of dots. For more leds, use a bigger PIC. A
12 dot display using a <$2 chip appeals to me.

Thanks Mike.

I understand exactly what you say above, the bit where I'm
having trouble is the top paragraph with driving 2 LEDs from
one port pin. Are both anodes connected to the pin or
both cathodes or one anode and one cathode - whichever
way, I cannot see how to drive the 2 from one pin???

Mike Harding
 
M

Mike Diack

Jan 1, 1970
0
Sorry, ASCII impaired.
Take a 12C671 (or F variant), an 8 pin pic. You use AN0 as the analog
input. You use GP1,2,4,5 as the 4 outputs. There are 12 ways you can
hook a led across 4 pins (you use a current limit resistor in each of
the 4 legs). You have a software comparison chain to trigger one of
these combinations for each of 12 voltage ranges between [0..255]
out of the a/d converter. You choose your own breakpoints.This gives
you a flying dot display with 12 dots. Using time division mpxing you
can get a bargraph instead of dots. For more leds, use a bigger PIC. A
12 dot display using a <$2 chip appeals to me.

Thanks Mike.

I understand exactly what you say above, the bit where I'm
having trouble is the top paragraph with driving 2 LEDs from
one port pin. Are both anodes connected to the pin or
both cathodes or one anode and one cathode - whichever
way, I cannot see how to drive the 2 from one pin???

Mike Harding
http://homepages.kcbbs.gen.nz/moby/leds.jpg
 
M

Mike Harding

Jan 1, 1970
0
Hey that's a neat trick. For those who missed it, drive two leds off one
port pin by not pulsing for neither led, pulsing high to tri-state for one,
low to tristate for the other, or high to low for both. Thanks, Mike.
Sorry, don't understand. Could you do an ASCII drawing please?
Sorry, ASCII impaired.
Take a 12C671 (or F variant), an 8 pin pic. You use AN0 as the analog
input. You use GP1,2,4,5 as the 4 outputs. There are 12 ways you can
hook a led across 4 pins (you use a current limit resistor in each of
the 4 legs). You have a software comparison chain to trigger one of
these combinations for each of 12 voltage ranges between [0..255]
out of the a/d converter. You choose your own breakpoints.This gives
you a flying dot display with 12 dots. Using time division mpxing you
can get a bargraph instead of dots. For more leds, use a bigger PIC. A
12 dot display using a <$2 chip appeals to me.
Thanks Mike.

I understand exactly what you say above, the bit where I'm
having trouble is the top paragraph with driving 2 LEDs from
one port pin. Are both anodes connected to the pin or
both cathodes or one anode and one cathode - whichever
way, I cannot see how to drive the 2 from one pin???

Got it now! :)

You cannot drive 2 LEDs from just 1 pin (which is
why I couldn't understand it!) you're talking about
matrix multiplexing across a number of pins - neat
little circuit. Wish I'd though of it about 6 years ago
when I did a bargraph display for a client.

Mike Harding
 
C

Chris Hoffmann

Jan 1, 1970
0
mike_harding1 said:
Hey that's a neat trick. For those who missed it, drive two leds off one
port pin by not pulsing for neither led, pulsing high to tri-state for one,
low to tristate for the other, or high to low for both. Thanks, Mike.
Sorry, don't understand. Could you do an ASCII drawing please?
Sorry, ASCII impaired.
Take a 12C671 (or F variant), an 8 pin pic. You use AN0 as the analog
input. You use GP1,2,4,5 as the 4 outputs. There are 12 ways you can
hook a led across 4 pins (you use a current limit resistor in each of
the 4 legs). You have a software comparison chain to trigger one of
these combinations for each of 12 voltage ranges between [0..255]
out of the a/d converter. You choose your own breakpoints.This gives
you a flying dot display with 12 dots. Using time division mpxing you
can get a bargraph instead of dots. For more leds, use a bigger PIC. A
12 dot display using a <$2 chip appeals to me.
Thanks Mike.

I understand exactly what you say above, the bit where I'm
having trouble is the top paragraph with driving 2 LEDs from
one port pin. Are both anodes connected to the pin or
both cathodes or one anode and one cathode - whichever
way, I cannot see how to drive the 2 from one pin???

Got it now! :)

You cannot drive 2 LEDs from just 1 pin (which is
why I couldn't understand it!) you're talking about
matrix multiplexing across a number of pins - neat
little circuit. Wish I'd though of it about 6 years ago
when I did a bargraph display for a client.

If the port pins can sink/source enough current in each direction why
would't the following work?:

-----+ + Vcc
| |
| ---
| \ / LED1
| ---
Port +--\/\/--|
| |
| ---
| \ / LED2
| ---
| |
-----+ --- Gnd
-

That was my interpretation of the earlier post anyway.

For sure it's not as compact/efficient as Mike Diack's solution tho' -
that's a doosey!
 
M

Mike Harding

Jan 1, 1970
0
If the port pins can sink/source enough current in each direction why
would't the following work?:

-----+ + Vcc
| |
| ---
| \ / LED1
| ---
Port +--\/\/--|
| |
| ---
| \ / LED2
| ---
| |
-----+ --- Gnd

In the event of a software crash or maybe during power
up current through the LEDs would need to be limited to
prevent self destruction.

Setting the pin to tri-state would switch both on (still
need the I limit).

A high would turn LED2 on but (with your R where it is)
would also turn LED1 on because LED2 K is at 1V8 so LED1
would be forward biased.

My brain is beginning to hurt :)

Mike Harding
 
U

Unbeliever

Jan 1, 1970
0
Mike Harding said:
Sorry, don't understand. Could you do an ASCII drawing please?

Mike Harding
Having drawn a diagram, I was wrong! When the pin is in tristate, both LEDs
will be on (more dimly). You can get it to work by connecting the diodes
A-K and A-K, your port pin to one end and the other end to your readily
available 2.5V supply via a resistor, (thus both would turn off in
tristate), but the 2.5 V supply could be considered cheating. ;o)

Bugger, it sounded good. I like Mike's idea though. (Diack - what a great
name for an electronics enthusiast)

Cheers,
Alf Katz
[email protected]
www.micromagic.net.au
 
A

Apollo

Jan 1, 1970
0
If the port pins can sink/source enough current in each direction why
would't the following work?:

-----+ + Vcc
| |
| ---
| \ / LED1
| ---
Port +--\/\/--|
| |
| ---
| \ / LED2
| ---
| |
-----+ --- Gnd
-

I think this should work quite well with a 3v Vcc
(and matching 3V CPU)... given Orange/Green/Yellow LEDs
with a voltage drop in the region of 1.9V.


- Steve
http://www.airborn.com.au/8051/isp.html
 
K

KLR

Jan 1, 1970
0
Hey that's a neat trick. For those who missed it, drive two leds off one
port pin by not pulsing for neither led, pulsing high to tri-state for one,
low to tristate for the other, or high to low for both. Thanks, Mike.
Sorry, don't understand. Could you do an ASCII drawing please?
Sorry, ASCII impaired.
Take a 12C671 (or F variant), an 8 pin pic. You use AN0 as the analog
input. You use GP1,2,4,5 as the 4 outputs. There are 12 ways you can
hook a led across 4 pins (you use a current limit resistor in each of
the 4 legs). You have a software comparison chain to trigger one of
these combinations for each of 12 voltage ranges between [0..255]
out of the a/d converter. You choose your own breakpoints.This gives
you a flying dot display with 12 dots. Using time division mpxing you
can get a bargraph instead of dots. For more leds, use a bigger PIC. A
12 dot display using a <$2 chip appeals to me.

Thanks Mike.

I understand exactly what you say above, the bit where I'm
having trouble is the top paragraph with driving 2 LEDs from
one port pin. Are both anodes connected to the pin or
both cathodes or one anode and one cathode - whichever
way, I cannot see how to drive the 2 from one pin???

Mike Harding
http://homepages.kcbbs.gen.nz/moby/leds.jpg

Mate - that circuit is an absolute classic !! :)
 
A

Apollo

Jan 1, 1970
0
MC said:
errr.. you'll need a current limiting resistor in series
with LED1, and you can't turn off BOTH leds.

Well.. to restate:
I think this should work quite well with a 3v Vcc
(and matching 3V CPU)... given Orange/Green/Yellow LEDs
with a voltage drop in the region of 1.9V.

....The point being that the supply voltage is less that
the voltage drop of the two LEDs in series, so that with
no signal from "Port" the LEDs turn off.
 
M

Mike Harding

Jan 1, 1970
0
Well.. to restate:
I think this should work quite well with a 3v Vcc
(and matching 3V CPU)... given Orange/Green/Yellow LEDs
with a voltage drop in the region of 1.9V.

...The point being that the supply voltage is less that
the voltage drop of the two LEDs in series, so that with
no signal from "Port" the LEDs turn off.

Except that (grabbing a random LED data sheet
for Rohm SLI-343 Series) even orange and yellow
LEDs have a minimum forward voltage drop of
1V4 (and that would fall with temperature) so you
would need to hand pick the devices - may be
OK for hobby use but no good professionally.

There will also be a variation in brightness of
the LEDs when both LEDs are turned on by a
50:50 square wave from the port pin relative to
when just one is turned on by a hard low or high.
Although as the eye does not perceive brightness
in a linear manner it's hard to say how much
effect that would have.

Mike Harding
 
Top