16 LED Bargraph Display Using BS2
Lee_Speakman
Posts: 32
As some of you may know im designing a digital tachometer for a car. Id like to have a bargraph display, that will increment as your engine revs increase. I only want to use 4 output pins.
So far ive thought of using a BCD 1-10 chip and cascade them.·The only problem with this is only one LED will be on a time, wherease I want to have it looking like a bargraph, does anyone know of a specialist chip that will do such a task?
I could also use some kind of counter, that will increment by one ever time it recieves a pulse on a pin, and decrements by one if a pulse is recieved on another pin. This would save me 2 more pins. is there a chip avaliable for this too?
I could easily design either of the above drivers, problem is, its going to take multiple chips to do it, and im concerned with PCB space.
Thanks in advance:
Lee S
So far ive thought of using a BCD 1-10 chip and cascade them.·The only problem with this is only one LED will be on a time, wherease I want to have it looking like a bargraph, does anyone know of a specialist chip that will do such a task?
I could also use some kind of counter, that will increment by one ever time it recieves a pulse on a pin, and decrements by one if a pulse is recieved on another pin. This would save me 2 more pins. is there a chip avaliable for this too?
I could easily design either of the above drivers, problem is, its going to take multiple chips to do it, and im concerned with PCB space.
Thanks in advance:
Lee S
Comments
David
datasheet: (16-Bit)
http://www.fairchildsemi.com/ds/74/74F675A.pdf
..This would only require 3 I/O pins. This is also
be comparable to using two 8-bit shift registers.
http://www.parallax.com/detail.asp?product_id=602-00009
datasheet: (8-Bit)
http://www.semiconductors.philips.com/acrobat_download/datasheets/74HC_HCT595_4.pdf
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
So why not use a simply connected SX running at 4 Mhz to drive the 10 bar graph LEDs, and use a serial pin for communications with whatever is generating the bar "signal".
This would be a way to make your own "specialist chip", and it only uses one (communications) pin. Alternately, of course, you could choose not to do communications, and use 4 pins encoded with the bar info. And to boot, it's all done with a single chip.
Cheers,
Peter (pjv)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Evenso, with a simple SX20 there are enough pins for 16 leds plus 4 for data.
Cheers,
Peter (pjv)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
·· No, the F-V and BS2 PWM use are mutually exclusive.· You should use one or the other.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Im fairly new to Basic stamp and PBASIC so i dont know why this code is wrong, can anyone point me in the right direction?
' {$STAMP BS2}
Clock PIN 0 ' shift clock (74HC595.11)
SerData PIN 1 ' serial data (74HC595.14)
Latch PIN 2 ' output latch (74HC595.12)
DelayTime CON 100
pattern VAR Byte ' zig-zag pattern
Reset:
LOW Latch ' make output and low
pattern = %00000001
Main:
DO
GOSUB Out_595 ' put pattern on 74x595
PAUSE DelayTime ' hold
pattern = pattern << 1 ' shift pattern left
LOOP UNTIL (pattern = %10000000)
DO
GOSUB Out_595
PAUSE DelayTime
pattern = pattern >> 1 ' shift pattern right
LOOP UNTIL (pattern = %00000001)
GOTO Main
Out_595:
SHIFTOUT SerData, Clock, MSBFIRST, [noparse][[/noparse]pattern] ' send pattern to '595
PULSOUT Latch, 5 ' latch outputs
RETURN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
"Hi guys,ive considered the LM3916, but it is voltage controlled, and as far as im aware there is no way to vary the voltage of output pins."
How about a single pin solution? PWM out on one pin through a diode into an RC filter, charging a cap and bleading off the charge with the resistor. Take that voltage into the LM3916 and drive your LED display. Adjust your RC time constant to suit you application.
Rick