Driving a 20 seg bar graph - Help wanted please

R

Rex Turner

Guest
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.
 
On Wed, 10 Sep 2003 19:05:13 GMT, "Rex Turner"
<r<dot>turner@bigpond.net.au> wrote:

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.
 
"Mike Diack" <moby@kcbbs.gen.nz> wrote in message
news:3f5f7bd0.637116@News.xtra.co.nz...

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
alfkatz@remove.the.obvious.ieee.org
www.micromagic.net.au
 
On Thu, 11 Sep 2003 08:02:19 +1000, "Unbeliever"
<alfkatz@remove.the.bleedin.obvious.ieee.org> wrote:

"Mike Diack" <moby@kcbbs.gen.nz> wrote in message
news:3f5f7bd0.637116@News.xtra.co.nz...

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.
Sorry, don't understand. Could you do an ASCII drawing please?

Mike Harding
 
On Thu, 11 Sep 2003 09:21:02 +1000, Mike Harding
<mike_harding1@hotmail.com> wrote:

On Thu, 11 Sep 2003 08:02:19 +1000, "Unbeliever"
alfkatz@remove.the.bleedin.obvious.ieee.org> wrote:

"Mike Diack" <moby@kcbbs.gen.nz> wrote in message
news:3f5f7bd0.637116@News.xtra.co.nz...

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.

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
 
On Wed, 10 Sep 2003 23:44:26 GMT, moby@kcbbs.gen.nz (Mike Diack)
wrote:
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
 
On Thu, 11 Sep 2003 10:07:16 +1000, Mike Harding
<mike_harding1@hotmail.com> wrote:

On Wed, 10 Sep 2003 23:44:26 GMT, moby@kcbbs.gen.nz (Mike Diack)
wrote:
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
 
On Thu, 11 Sep 2003 00:19:07 GMT, moby@kcbbs.gen.nz (Mike Diack)
wrote:

On Thu, 11 Sep 2003 10:07:16 +1000, Mike Harding
mike_harding1@hotmail.com> wrote:

On Wed, 10 Sep 2003 23:44:26 GMT, moby@kcbbs.gen.nz (Mike Diack)
wrote:
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???

http://homepages.kcbbs.gen.nz/moby/leds.jpg
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
 
In article <h7gvlvoh8mgvkmjkui7k0tn0r9pum4c136@4ax.com>, mike_harding1
@hotmail.com says...
On Thu, 11 Sep 2003 00:19:07 GMT, moby@kcbbs.gen.nz (Mike Diack)
wrote:

On Thu, 11 Sep 2003 10:07:16 +1000, Mike Harding
mike_harding1@hotmail.com> wrote:

On Wed, 10 Sep 2003 23:44:26 GMT, moby@kcbbs.gen.nz (Mike Diack)
wrote:
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???

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

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!
 
On Thu, 11 Sep 2003 01:51:03 GMT, Chris Hoffmann <a@b.c> wrote:

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.

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
 
"Mike Harding" <mike_harding1@hotmail.com> wrote in message
news:bccvlvshckjlo4ek4nrt1hp0ebt65ok61l@4ax.com...
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
alfkatz@remove.the.obvious.ieee.org
www.micromagic.net.au
 
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
 
If the port pins can sink/source enough current in each direction why
would't the following work?:

-----+ + Vcc
| |
| ---
| \ / LED1
| ---
Port +--\/\/--|
| |
| ---
| \ / LED2
| ---
| |
-----+ --- Gnd
errr.. you'll need a current limiting resistor in series
with LED1, and you can't turn off BOTH leds.
 
On Thu, 11 Sep 2003 00:19:07 GMT, moby@kcbbs.gen.nz (Mike Diack)
wrote:

On Thu, 11 Sep 2003 10:07:16 +1000, Mike Harding
mike_harding1@hotmail.com> wrote:

On Wed, 10 Sep 2003 23:44:26 GMT, moby@kcbbs.gen.nz (Mike Diack)
wrote:
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 !! :)
 
On Sat, 13 Sep 2003 03:18:25 GMT, KLR <kreed@bigpond.net.au> wrote:

-SNIP-
Mate - that circuit is an absolute classic !! :)
Hehe, I had to draw it out myself just to make sure:

http://www.users.bigpond.net.au/broken.trout/LEDS.jpg

Tom L.
 
"MC" <mc@non.existant.place> wrote in message news:3F625DE1.58B51262@non.existant.place...
If the port pins can sink/source enough current in each direction why
would't the following work?:

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

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.
 
On Sat, 13 Sep 2003 23:23:03 +1000, "Apollo" <z51123@airborn.com.au>
wrote:

"MC" <mc@non.existant.place> wrote in message news:3F625DE1.58B51262@non.existant.place...
If the port pins can sink/source enough current in each direction why
would't the following work?:

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

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.
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
 
Apollo wrote:
"MC" <mc@non.existant.place> wrote in message news:3F625DE1.58B51262@non.existant.place...
If the port pins can sink/source enough current in each direction why
would't the following work?:

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

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.
Ooops., I'm still accustomed to using VCC=5.0V or VCC=3.3V
& didn't notice the VCC=3.0V stipulation.
 

Welcome to EDABoard.com

Sponsor

Back
Top