Hex to seven segment using the ATF16V8B

For discussing the 65xx hardware itself or electronics projects.
Post Reply
grey-lensman
Posts: 13
Joined: 07 Feb 2015

Hex to seven segment using the ATF16V8B

Post by grey-lensman »

One of those recurring topics for basic single board computers is displaying addresses and data. Using seven segment LED displays seems simple, until you find that converting nybles to 7 segments is not trivial. Hex to 7 segment decoder chips were discontinued years ago and displays with integrated decoders are expensive. Discrete logic solutions take up a good deal of space, and microcontrollers, while effective, seem somehow...inelegant. I'm working on a front panel, so driving the display with a I/O chip (as the KIM-1 does) is not right either.

There have been previous suggestions to use a small PLD for this purpose. Here's my solution;

Code: Select all

Name            sevenseg;
Partno          AN001;
Revision        01;
Date            1/14/19;
Designer        M. Bakula;
Company         Tristate Mechatronics;
Location        Lake Mary, FL;
Assembly        Front Panel;
Device          g16v8a;

/******************************************************/
/*                                                    */
/*  sevenseg - hex to seven segment decoder.          */
/*                                                    */
/*   binary on pins 2-5 produces segment outputs      */
/*   7 segment on pins 12 -18.                        */
/*                                                    */
/******************************************************/

/** Inputs **/
Pin [2..5] = [I0..3];

/** Outputs **/
Pin [12..18] = [Q0..6];

/** Var Declarations **/
Field input = [I3..0];
Field output = [Q6..0];

/** Logic Equations **/
Table input => output {
    'b'0000 => 'b'0000001;
    'b'0001 => 'b'1001111;
    'b'0010 => 'b'0010010;
    'b'0011 => 'b'0000110;
    'b'0100 => 'b'1001100;
    'b'0101 => 'b'0100100;
    'b'0110 => 'b'0100000;
    'b'0111 => 'b'0001111;
    'b'1000 => 'b'0000000;
    'b'1001 => 'b'0001100;
    'b'1010 => 'b'0001000;
    'b'1011 => 'b'1100000;
    'b'1100 => 'b'0110001;
    'b'1101 => 'b'1000010;
    'b'1110 => 'b'0110000;
    'b'1111 => 'b'0111000;
}
Pins 5 to 2 are MSB to LSB inputs, and pins 18 to 12 are segments a-g in order. The outputs are low-active for a common anode display.

I compiled this with WinCUPL, and programmed an Atmel ATF16V8B-15PU with the resulting .jed file, using a MiniPro TL866CS. The attached photo shows the results. Other than WinCUPL crashing (I think due to issues with Windows 10, but I'm not a Windows person,) it was quite simple to create the chip. When my planned LED displays come in, I'll probably play with the pin assignments to make integration on a breadboard easier.
Attachments
LED Demo.jpg
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: Hex to seven segment using the ATF16V8B

Post by BigEd »

Nice and simple!

(A version with latched inputs (or outputs) might be useful in some situations? I think the same PLD can do that.)
User avatar
BillO
Posts: 1038
Joined: 12 Dec 2008
Location: Canada

Re: Hex to seven segment using the ATF16V8B

Post by BillO »

Sweet!

Does that chip have latching ability?
Bill
grey-lensman
Posts: 13
Joined: 07 Feb 2015

Re: Hex to seven segment using the ATF16V8B

Post by grey-lensman »

Yes, the device has output latches when programmed for registered mode.

http://ww1.microchip.com/downloads/en/D ... asheet.pdf

I didn’t bother in this case, since the displays are intended to be always active.
LIV2
Posts: 173
Joined: 12 Feb 2014
Location: Sweden

Re: Hex to seven segment using the ATF16V8B

Post by LIV2 »

Wait the minipro supports the ATF16V8B now? I thought the Atmel PLDs needed expensive programmers?
Martin A
Posts: 197
Joined: 02 Jan 2016

Re: Hex to seven segment using the ATF16V8B

Post by Martin A »

It's the 22V10 that seems to need the expensive programmers. And maybe the other 24 pin types ?
DerTrueForce
Posts: 483
Joined: 04 Jun 2016
Location: Australia

Re: Hex to seven segment using the ATF16V8B

Post by DerTrueForce »

The Atmel 22v10 does need a more expensive programmer, if you aren't willing to DIY a bit. It's programming algorithm has been reverse-engineered. I don't have the links on me at the moment though, and I haven't tested it myself.
The minipro has always supported the 16v8, as far as I am aware. That was one of the reasons I bought it. I believe it also supports some of the small Lattice PLDs as well.
grey-lensman
Posts: 13
Joined: 07 Feb 2015

Re: Hex to seven segment using the ATF16V8B

Post by grey-lensman »

Yup, the ATF22V10 is the one that’s hard to program. I was going to use Lattice parts, but they’re all listed as end of life now. In the long run, I need to learn how to work with CPLDs or FPGAs, but they all seem to need support chips and come in SMD packages.
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Hex to seven segment using the ATF16V8B

Post by drogon »

grey-lensman wrote:
Yup, the ATF22V10 is the one that’s hard to program. I was going to use Lattice parts, but they’re all listed as end of life now. In the long run, I need to learn how to work with CPLDs or FPGAs, but they all seem to need support chips and come in SMD packages.
FWIW: I recently bought 10 Lattice 22V10 GALs off ebay and have been pleased with them - they were listed as new, but it was clear that some had been used, but cleaned up very well - I suspect programmed once. ebay seller: moduleme, China, but I got them in under a week to the UK. All blanked and passed a programming test. I've been alternating 2 in my test board - must have programmed each about a dozen times now and they seem fine.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
DerTrueForce
Posts: 483
Joined: 04 Jun 2016
Location: Australia

Re: Hex to seven segment using the ATF16V8B

Post by DerTrueForce »

So now that I'm back on a PC, I've found the link again. This page claims to describe the programming algorithm for the ATF22V10C: Link.
I have not tried to use it, partially because I don't have any 22V10s. I don't know if it works, but it might be worth a shot if anyone happens to be interested.
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: Hex to seven segment using the ATF16V8B

Post by Chromatix »

The ATF750C is described as a CPLD, comes in the same form factors as a 22V10 (including DIP) and requires no external components (internal program storage, just like a GAL part). It has the same number of I/O pins, but more internal product terms and flipflops. Half of the flipflops are "buried" with no corresponding output pin, so can be used to run a state machine cleanly.

I have no idea whether it takes a similar programming algorithm to the ATF22V10C, albeit with rather more bits in the JEDEC file, but it seems like a plausible enough idea to try. Perhaps someone can put an analyser on an official programmer and see what it does.
User avatar
floobydust
Posts: 1394
Joined: 05 Mar 2013

Re: Hex to seven segment using the ATF16V8B

Post by floobydust »

Chromatix wrote:
The ATF750C is described as a CPLD, comes in the same form factors as a 22V10 (including DIP) and requires no external components (internal program storage, just like a GAL part). It has the same number of I/O pins, but more internal product terms and flipflops. Half of the flipflops are "buried" with no corresponding output pin, so can be used to run a state machine cleanly.

I have no idea whether it takes a similar programming algorithm to the ATF22V10C, albeit with rather more bits in the JEDEC file, but it seems like a plausible enough idea to try. Perhaps someone can put an analyser on an official programmer and see what it does.
Well, I use a Dataman 40-pro programmer for all of my bits... and I've programmed the Atmel ATF22V10 parts and also the ATF750C parts. Note that the '750 requires a 0.10uF cap across the power pins however, so it's obviously a noise-inducing part when programming.

I also have a Saleae Logic-16 and could likely rig up an adapter to get some data on what it's doing that is unique for the Atmel parts. I'm heading back to the Florida homestead today (which is where all the goodies are) so if someone has a specific JEDEC file to try programming with, let me know. So far, I've only used a simple configuration and a single I/O glue chip, but later went with the ATF22V10CSQ part as it draws less current and does everything I need for now.
Chromatix
Posts: 1462
Joined: 21 May 2018

Re: Hex to seven segment using the ATF16V8B

Post by Chromatix »

Well, there's that DRAM controller I'm presently working out… but I don't have any JEDEC files for that yet. I have no idea whether WinCUPL will even accept my design.
Post Reply