Binary to  Hex on seven segment  - Page 1
Forum section: electronics / projects

author: Dan Moos
author_rank: Frequent Contributor
timestamp: March 15, 2017, 04:31:50 am
content: Simple question. Is there a super simple way (single chip?) to go from 8 bit binary to 2 digit Hex on a dual seven seg display? Without resorting to a MCU?

author: Ian.M
author_rank: Super Contributor
timestamp: March 15, 2017, 04:55:28 am
content: Sure: Find a pair of the long obsolete Texas InstrumentsTIL311displays as N.O.S. Expect to pay through the nose with the blood of your firstborn for the privilege of avoiding using a simple MCU.

author: oPossum
author_rank: Super Contributor
timestamp: March 15, 2017, 05:04:16 am
content: MC14495 and DM9368They both have been out of production for decades and are expensive.

author: Ian.M
author_rank: Super Contributor
timestamp: March 15, 2017, 05:08:38 am
content: N.B. 74LS47 is *NOT* suitable for a HEX dosplay. Its BCD only and displays obscure symbols for A-E and blanks for F.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: March 15, 2017, 06:56:29 am
content: You could also try program a Gal/Pal....

author: Luminax
author_rank: Regular Contributor
timestamp: March 15, 2017, 07:44:10 am
content: Problem with 7-segment is you get A b C d E F which is kinda inelegant... but eh if it works for youThen again... single chip... hmmmmI sure can do it with a few discrete logic gates but single chip I have no knowledge of

author: Ian.M
author_rank: Super Contributor
timestamp: March 15, 2017, 08:06:33 am
content: Futurelec still has the MC14495, but you wont like the price, nor the need for one per digit.http://www.futurlec.com/Motorola/MC14495P1pr.shtmlThere seem to be a number of sellers for the TIL311 display on EBAY. Its also stocked by Jameco at an even more ludicrous price.http://www.jameco.com/z/TIL311-Texas-Instruments-Hexadecimal-Display-11-Pin-DIP_32951.html

author: Benta
author_rank: Super Contributor
timestamp: March 15, 2017, 08:14:38 am
content: You could also use dot-matrix displays with built in decoder.Avago/Broadcom has them, but IIRC they are pretty expensive:https://www.broadcom.com/products/leds-and-displays/smart-alphanumeric-displays/parallel-interface/Something like 2 pcs. HDSP-0762

author: ebclr
author_rank: Super Contributor
timestamp: March 15, 2017, 08:35:09 am
content: It's easier than apearshttp://jasperfracture.com/altera-max-ii-epm240-using-the-7-segment-led-with-a-counter-and-a-debouncer/

author: amyk
author_rank: Super Contributor
timestamp: March 15, 2017, 09:52:31 am
content: MC14489? Slightly cheaper than the other alternatives here and can handle up to 5 displays.

author: grumpydoc
author_rank: Super Contributor
timestamp: March 15, 2017, 10:10:35 am
content: (E)PROM or GAL.Never understood why this wasn't available as a standard TTL function.

author: drussell
author_rank: Super Contributor
timestamp: March 16, 2017, 12:33:11 am
content: The Fairchild DM9368 is another one that did that.Obsolete and no longer produced, of course, but $1.50 each on Aliexpress. Almost certainly used pulls but if they work and it is just a one-off project rather than trying to produce something, why not? (Other than the wait time if you can't find any MC14495 or DM9368 from anywhere other than China, of course...)

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: March 16, 2017, 01:11:07 am
content: An EPROM comes to mind. That's not an MCU.

author: David Hess
author_rank: Super Contributor
timestamp: March 16, 2017, 03:32:00 am
content: A simple PLD does not have quite enough outputs to drive two displays unless multiplexing is used. A complex PLD does though and can be had for less than $2 but a 16 bit wide EPROM is about that price as well.I hate to say it but the cheapest solution may be a Microchip PIC programmed to do the decoding. 8 input pins and 14 output pins requires 22 I/Os so the 28 pin packages are not quite good enough but the larger packages are. Or a pair of 18 pin PICs can do it for almost the same price which has layout advantages.I have no idea why there was never a common pin compatible hexadecimal decoder version of the 7447.

author: Ian.M
author_rank: Super Contributor
timestamp: March 16, 2017, 04:00:42 am
content: OTOH with two external transistors to support a reasonable brightness while multiplexing, the MCU pin requirement drops to 17 I/Os, possible on a 20 pin PIC, and it also reduces the number of resistors needed. The code would be almost trivially simple as well.A more interesting challenge would be to come up with a minimum total pin-count solution that only uses parts currently in production available off-the-shelf without programming or special ordering of preprogrammed chips - 8 bit parallel in, 2x 7 segment LED out, and to consider if the solution would scale well to 6 digits e.g, monitoring a 16 bit address busd + and 8 bit data bus.

author: Luminax
author_rank: Regular Contributor
timestamp: March 16, 2017, 08:14:37 am
content: Quote from: David Hess on March 16, 2017, 03:32:00 amI would say that it is due to the reason I mentioned above, I have seldom came across a system with 7-segment that displays hex regularly or even sparsely. I've came across a few with the 14 segments though...Reiterating my personal opinion, I think it looks ugly to display hex on 7 segments

author: macboy
author_rank: Super Contributor
timestamp: March 16, 2017, 11:57:26 am
content: Quote from: David Hess on March 16, 2017, 03:32:00 amThe reason is that the logic to decide the 16 characters is significantly more complex than that to decide 10. That means a bigger die and higher cost. I believe that I actually read this in an old dataset for one manufacturer's version long ago.A 28 pin PIC can easily do 22 I/O, especially if one uses the internal oscillator. The number of LOC for this function would measure in the dozens, and I personally would use assembly just due to the simplicity of the solution (a loop with a lookup table for each nibble).

author: David Hess
author_rank: Super Contributor
timestamp: March 16, 2017, 12:32:22 pm
content: Quote from: macboy on March 16, 2017, 11:57:26 amI assumed the internal oscillator would be used but even so, the ones I looked at came up 2 I/O pins short but maybe one of the more expensive 28 pin parts has enough I/O pins.

author: Ian.M
author_rank: Super Contributor
timestamp: March 16, 2017, 12:56:43 pm
content: The 28 pin 8 bit PICs typically have 4 pins you cant use for output - 2 Vss, 1 Vdd and /MCLR - leaving 24 I/Os available. Some have a low voltage core with a decoupling cap pin for the core regulator. USB devices loose you a decoupling pin + two data pins. However on non-USB 8 bit 28 pin PICs you'll certainly have at least 23 I/O pins available..

author: macboy
author_rank: Super Contributor
timestamp: March 16, 2017, 01:41:51 pm
content: Quote from: David Hess on March 16, 2017, 12:32:22 pmI didn't realize how few 28-pin parts would fit the bill (mostly due to dedicated pins for modern features like USB), but some do. The PIC16F570 for example is only ~$1 and has 24 I/O as three full 8-bit ports.

author: David Hess
author_rank: Super Contributor
timestamp: March 16, 2017, 05:04:17 pm
content: Quote from: Ian.M on March 16, 2017, 12:56:43 pmI know you said typical but the 28 pin DIP/SOIC PIC16F57 has eight dedicated pins:VddVssOSC1/CLKINOSC2/CLKOUT-MCLR/VppT0CKIN/CN/CWhich leaves 20 I/O pins on a 28 pin package. The SSOP of the same device swaps the two N/C pins for an extra Vdd and Vss. As you and macboy point out however, other 28 pin devices like the 16F570 do not have this problem so there is a single device which can decode 8-bit hexidecimal into two 7-segment displays without multiplexing for $1.28 in a DIP and $1.05 in a SOIC in single unit quantities.It might still be worth multiplexing because then only 7 current limiting resistors are needed and only 8+7+2=17 I/O pins allowing a smaller and ever so slightly less expensive 20 pin 16F527 do it.There are also AVR microcontrollers for not much more.

author: Luminax
author_rank: Regular Contributor
timestamp: March 17, 2017, 01:55:59 am
content: Quote from: macboy on March 16, 2017, 01:41:51 pmAnd adding just a few cents more you can get an even more powerful PIC18F, for example the PIC18F25K40 with all pins available for multiplexing/reassigning (except for, of course, 1 VDD and 2 VSS giving you a total of 28-3 => 25 pins)

author: james_s
author_rank: Super Contributor
timestamp: March 17, 2017, 04:22:51 am
content: XC9536 CPLD, it's about $1.50 in single quantities and the IO pins can source or sink enough current to drive LEDs.

author: kwass
author_rank: Frequent Contributor
timestamp: March 17, 2017, 04:46:39 am
content: Quote from: Ian.M on March 15, 2017, 08:06:33 amThere's also the Fairchild 9368 for a little less here:http://www.intertexelectronics.com/IC-Fairchild-DM9368PC-DM9368-IC-Decoder-Driver-Latch-7-segment-Led-P4388.aspx