6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 14, 2024 8:47 pm

All times are UTC




Post new topic Reply to topic  [ 56 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 8:33 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
A common need for debugging purposes is a simple hexadecimal readout of a byte's or word's worth of binary signals. The obvious solution in times gone by would have been to drop in a 7-segment LED display and decoder chip for each nybble, or possibly to multiplex one decoder chip across several displays and input nybbles.

Unfortunately, the only 7-segment decoders still in production decode only BCD, not hexadecimal, even though the hex decoders are strictly more useful and are unlikely to cost significantly more to produce. So some alternative is needed.

Option 1 is to program a GAL to do the job. A 22V10 has enough pins to read 3 nybbles and 3 select lines while producing a 7-bit decoded drive signal; a 16V8 could be used for a single digit, or possibly a pair. I have no idea whether it can do all that while processing the logic correctly, or whether some pins have to be reserved as internal nodes. An unavoidable downside is that you have to run a GAL compiler and use a chip programmer to set it up. The upside is that it's a single-chip direct replacement for a hex decoder.

Option 2 is to program a ROM to do the job. A 32Kx8 ROM will handle the same three nybbles and three select lines without limitation. But you still need a chip programmer run before your display is usable, and it generally doesn't feel like an "elegant" solution.

Option 3 is to hand-build a 16x7 ROM using diode logic and a 4-to-16 decoder. Some doodling suggests that 44 diodes are needed if you use them to turn segments *off* instead of on, an average of less than 3 diodes per digit instead of more than 4 for the positive sense, at the expense of requiring a driver IC on the output to invert the sense, but a saving of allowing them to be small-signal diodes instead of having to handle LED current directly. So this is entirely feasible to build by hand and, crucially for my intended use, requires only a soldering iron to make fully functional. Obviously this should be multiplexed across all digits needed, instead of replicated, and this can be done using a 3-to-8 decoder and a free-running counter.

Option 4 is to do it in software, which of course allows you absolute flexibility over which segments to light, including the decimal point. The segment patterns can be stored in 8-bit latches or pairs of 4x4-bit register files. The downside is that you can't use it for ultra-low-level bootstrapping; it might work as a main display. This approach can also be extended to 16-segment displays for alphanumeric applications, though that's getting slightly out of scope now...

Any further ideas?


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 8:46 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
Looks like decoders are available in open-collector form: that should mean that you can wire outputs together... does that help?


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 8:56 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
It would allow using one 4-to-16 decoder per input nybble instead of inserting multiplexers between the input and the decoder, assuming they each have an enable line to allow them to be deselected. The diodes would still be needed within the ROM array itself.


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 9:05 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10977
Location: England
I rather like the diode ROM approach.

(I see there is a Broadcom LED part with built in hex decoder: just £31 in single quantity, or £21 if you need hundreds. This is no good for me!)

Maybe see also this thread:
https://www.eevblog.com/forum/projects/ ... n-segment/


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 9:06 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8540
Location: Southern California
While I was writing this, Ed posted about the open-collector decoders, which I have not looked into. The 4- and 8-digit Broadcom dot-matrix LED displays with serial input are really nice; but they require more intelligence feeding them.

How 'bout using a microcontroller? If the need is really that great, I could make pre-programmed PICs available to take the place of the no-longer-available IC. A single digit would only need an 18-pin PIC which has 13 I/O pins. Five would be inputs (4 for the hex digit, plus one for optional decimal point), and 8 for outputs for seven segments plus decimal point. An external RC would be used to set the non-critical clock rate. Rather than have a resistor for each segment, I think you could have just one resistor in the common pin and feed each segment in turn, so no two are actually turned on at once (fast enough of course that you couldn't see the strobing). A 28-pin PIC could handle more digits, or you could just use multiple 18-pin PICs. Either way, the user does not need to concern himself with strobing or selects or anything else. Data in, and it gets displayed. No need to study timing diagrams, etc.. If it changes too fast for the PIC, it's definitely way too fast to track visually.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 9:34 am 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
It used to be possible to get a "PDN747", which appears to be a pre-programmed 16V8 GAL, for decoding one digit.

The DIP format doesn't seem to be available now, but it does confirm option 1 is viable.


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 2:26 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Chromatix wrote:
Option 4 is to do it in software, which of course allows you absolute flexibility over which segments to light, including the decimal point. The segment patterns can be stored in 8-bit latches or pairs of 4x4-bit register files.
Latches and register files are both viable for Option 4, but a serial-to-parallel shift register would require less in terms of an interface from the host -- ie, just a clock line and a data line. There are different ways it could work... as you say, one chip for each nybble; or, instead, one chip multiplexed to drive several nybbles.

Myself, I'd consider having one chip for each nybble, using venerable 4000 series CMOS parts which are still available, such as 4094. Newer equivalents exist ('hc4094, 'hc595), but using the original 4094 -- or some other 4000 series shift register -- you could probably reduce the parts count by eliminating the current-limiting resistors which are otherwise mandatory when driving LED's. (4000 series parts don't output a lot of current when Vdd is only 5V. Just be sure to stay within the package dissipation spec.)

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Last edited by Dr Jefyll on Sat Nov 10, 2018 2:29 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 2:28 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
You might try searching for some NOS or used HP 5082-7340 displays. I still have a small quantity of these I managed to scoff from one of the labs back in the 80's. These are perfect for monitoring the address and databus lines. I did wire some up to a 65C22 some years ago for testing and they work fine.

Note that Broadcom / Avago still make them, but they're quite expensive these days (~$39). I've seen the old HP units going for around $10 or so, but you might be able to find a better deal elsewhere.

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 3:50 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1747
Location: Sacramento, CA
My Netronics ELF II used a DM9368 Hex to 7 segment decoder chip. Looks like there are versions being sold from China on Ebay... priced at about 16.50 for 10. Might be worth a look.

Daryl

_________________
Please visit my website -> https://sbc.rictor.org/


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 6:40 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
The shift-register idea is interesting. To simplify the software and reduce flicker when shifting in a new line of display, you could use 8 shift registers in parallel, driving 8 digits of display, and daisy-chain additional groups of 8 digits off it as required. This would still need to be doubled for a 16-segment alphanumeric display.

I have looked into the integrated decoder-digits previously, but they tend to be unreasonably expensive, support BCD only, and/or require a 5V supply which wouldn't be directly suitable for a 3.3V project. This includes LCD versions, which tend to be specialised for clock, meter or calculator readouts which require only numerics. Overall it's a bit of a minefield, and I wouldn't recommend them for a new project.


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sat Nov 10, 2018 8:34 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3367
Location: Ontario, Canada
Chromatix wrote:
To simplify the software and reduce flicker when shifting in a new line of display, you could use 8 shift registers in parallel, driving 8 digits of display [...]
Yup, although instead of a clock line plus 1 data line now you need to provide a clock plus 8 data lines -- and maybe that's easily done. Otherwise, as you suggested, the length of the string of shift regs can be increased.

With a short string flickering will be imperceptible, but a longer string may reveal it. In that case choose a shift reg such as 4094 / hc4094 or hc595 which buffers the SR output into an 8-bit wide output register. No flicker occurs, because you update the output register only when the SR contains properly framed data. This ups the ante slightly: now your interface needs to drive a clock line, a data line and a strobe line. But the length of the chain can be extreme.

( On Garth's site, see Using the 6522's shift register for tons of output bits, near the top of this page. )


Attachments:
cd4094b.pdf [721.55 KiB]
Downloaded 197 times

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sun Nov 11, 2018 9:18 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
An intriguing LCD option is this 6-digit display with 49 individually pin-addressable segments. Apparently it will work with 3-5V applied in either polarity relative to the common pin, making it very easy to drive from decoder circuitry, whether active-low or active-high. Six digits is enough to show a 16-bit address and 8-bit data value together. An extra 2-digit display could be added to accommodate 24-bit addressing.

Since with a diode-logic ROM there is only feasibly one decoder, it's necessary to multiplex the input nybbles and output segments through it. A 3-bit free-running counter can cycle through the digits. For a simple display application, storing the nybbles in a pair of 4x4 registers (eg. 74HC670) means that only one quad 2-way multiplexer is needed on the input side. On the output side, six transparent 8-bit latches, one per digit, can be addressed through a 3-to-8 decoder. The LCD is then continuously driven and flicker-free. Loading data into the register file is left as an exercise for the reader; a magnitude comparator may prove useful.

In my case, I want to store the address in a set of presettable counters, so that it can auto-increment for rapid bootloader entry. I might as well use two further presettable counters for the data byte, but with the increment lines tied inactive. I thus need four 8-to-1 multiplexers on the input side, instead of one quad 2-way. On the upside, data input from a keypad may be easier to arrange with this setup; the nybble from the keypad decoder can be broadcast to all the counters' inputs, and the preset line for the correct one toggled through a debounce circuit.

Most LED 7-segment displays have a common pin per digit and segment pins that are common to all digits in the module, forming a matrix. In such cases, the transparent latches on the output side can be dispensed with in favour of a simple bus driver, and the output of the 3-to-8 decoder can be fed directly to the digit-common pins.


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sun Nov 11, 2018 4:40 pm 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
I always used the MC14495 for this purpose. Decoder, latch and driver all in one. They are probably not made anymore, but seem to be available nonetheless. I know a lot of people are squeamish about eBay though. Other than that, unless you are working on a project for commercialization, wouldn't the 14495 be a solution?

Edit: Okay, I see you're looking for low voltage chip.

_________________
Bill


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sun Nov 11, 2018 6:26 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
I suppose that may still work for an LCD display, which requires only potential and not significant current to drive, down to 3.3V. It's outside the spec, but the limitation is probably the output drivers which are calibrated to produce LED drive currents at 5V.


Top
 Profile  
Reply with quote  
 Post subject: Re: Hexadecimal displays
PostPosted: Sun Nov 11, 2018 7:45 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8540
Location: Southern California
Chromatix wrote:
An intriguing LCD option is this 6-digit display with 49 individually pin-addressable segments. Apparently it will work with 3-5V applied in either polarity relative to the common pin, making it very easy to drive from decoder circuitry, whether active-low or active-high. Six digits is enough to show a 16-bit address and 8-bit data value together. An extra 2-digit display could be added to accommodate 24-bit addressing.

Note that the raw LCD needs to be fed a net symmetrical AC voltage, to prevent plating. I used a nearly identical LCD for a product in the 80's, and used the National Semiconductor MM5453 LCD driver IC to take care of the strobing and make sure I didn't start cutting the life of the LCD with asymmetry. The IC has a serial interface, and I fed it with a 65c22's shift register.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 56 posts ]  Go to page 1, 2, 3, 4  Next

All times are UTC


Who is online

Users browsing this forum: pdragon and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: