Electronics > Projects, Designs, and Technical Stuff
16 bit to 4 digit 7 segment decoder
mariush:
All this hassle over a few 7 segment digits.
Just get digits with common anode, then use a led driver.
For example
1 digit common anode: https://www.digikey.com/product-detail/en/inolux/INND-TS40RAB/1830-1152-ND/7604988
2 digits (1 anode per digit) : https://www.digikey.com/product-detail/en/lite-on-inc/LTD-6410G/160-1924-5-ND/3199123
LCSC has them for 10-15 cents per digit, here's some examples:
1. 0.56" https://lcsc.com/product-detail/Led-Segment-Display_Made-in-China-FJ5161BH_C8092.html
2. 0.36" https://lcsc.com/product-detail/Led-Segment-Display_Made-in-China-FJ3161BH_C10690.html
3. 0.80" https://lcsc.com/product-detail/Others_OASIS-TOS-3124DMG-9B4_C325438.html
4. 2 digit (2 anodes + 8 cathodes) https://lcsc.com/product-detail/Led-Segment-Display_ARKLED-Wuxi-ARK-Tech-Elec-SN430281N_C182258.html
Use an 8 channel or 16 channel led driver and power 1-2 digits at any time directly from your microcontroller (the output pins have enough power for 10-20mA per pin)
LCSC has them for 5 cents each, or 2 cents if you buy 1000: https://lcsc.com/product-detail/LED-Drivers_Shenzhen-Sunmoon-Micro-SM74HC595D_C93838.html
There's also 10 cent led driver chips which can control directly 4 digits (4 anodes, 8 cathodes) : https://lcsc.com/product-detail/LED-Drivers_TM-Shenzhen-Titan-Micro-Elec-TM1650_C44444.html
Here's 4 digit 7segment common anode, 50 cents each or 30 cents each if you buy 100: https://lcsc.com/product-detail/Led-Segment-Display_Made-in-China-4Bit0-56Inch-red-digital-Led-Super-bright_C10713.html
oPossum:
--- Quote from: obiwanjacobi on December 22, 2019, 09:06:48 pm ---Is there some boolean reduction technique being used here? :-//
--- End quote ---
Yes, that is one of the advantages of using VHDL. I am using the free Lattice ispLEVER software that targets all the older Lattice GALs and CPLDs. It puts to boolean equations in the log file.
An example...
--- Code: ---seg_b_out = !( !hex_in_a_3_ & hex_in_a_2_ & !hex_in_a_1_ & hex_in_a_0_ 0101 5
# hex_in_a_2_ & hex_in_a_1_ & !hex_in_a_0_ X110 6 E
# hex_in_a_3_ & hex_in_a_1_ & hex_in_a_0_ 1X11 B F
# hex_in_a_3_ & hex_in_a_2_ & !hex_in_a_0_) 11X0 C E
--- End code ---
Handles 5, 6, B, C, E and F. Six digits with 4 OR gate inputs.
See reply 26 for all the others.
oPossum:
--- Quote from: edavid on December 22, 2019, 05:22:34 pm ---
--- Quote from: oPossum on December 22, 2019, 06:18:36 am ---
--- Quote from: edavid on December 22, 2019, 03:32:49 am ---PROM: AT29C020 or equivalent (DIP32) + 74HC4060 (DIP16)
--- End quote ---
How would the cathodes be driven?
--- End quote ---
Oops, what was I thinking |O
You would also need a 74HC138 or similar.
(Or 29F400 + 74HC04 + 74HC74, but I don't like that as much.)
--- End quote ---
If directly driving the cathodes is acceptable, then the GAL solution requires only one MOSFET. It may be possible to put the oscillator in the GAL. I don't know if there is enough hysteresis on the inputs for that to work.
obiwanjacobi:
--- Quote from: oPossum on December 22, 2019, 10:40:34 pm ---See reply 26 for all the others.
--- End quote ---
Totally missed that :palm: Thanx!
Very clever indeed. I think I'll take a look at that software you're using if only to do the crunching.
Peabody:
Well here's a non-GAL option that should work with the Atmega328P 28-pin DIP package. You would use two HC573 transparent latch chips to capture the 16-bit address bus. Their outputs would be ganged inputs to the 328P, with the latches' /OE pins selecting which one is active. Processor pins needed would be the 8 data lines, one latch enable, and two /OE lines, for a total of 11. On the 7-segment side you would multiplex by segment instead of by digit, and use a single HC4017 to drive the displays. For four digits, that would require 5 I/O pins - one for each common cathode, and one clock pin for the HC4017. So that's a total of 16 I/O pins.
An additional benefit of multiplexing by segment is that since only one segment line is driven at a time, the maximum number of segments driven at any time is 4 instead of 8. That means that if the displays are even moderately efficient, an HC4017 output can probably source a segment line directly without a transistor, and in fact you only need one resistor on each CC line instead of one resistor on each segment line.
Edit: It appears the ATTiny261 would also work. It's a 20-pin processor with 16 I/O pins. And there's an ATTinyCore avialable for the Arduino IDE that includes support for the 261. For a 3.3V system, the TI MSP430G2553 would be perfect, programmed with Energia, which is a port of the Arduino IDE for MSP430.
Details of this multiplexing method can be found here (there's also a video link there):
https://github.com/gbhug5a/7-Segment-Displays-Multiplex-by-Segment
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version