6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 1:20 pm

All times are UTC




Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Wed Jan 16, 2019 3:56 am 
Offline

Joined: Sat Feb 07, 2015 7:57 pm
Posts: 13
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:
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
LED Demo.jpg [ 376.25 KiB | Viewed 2536 times ]
Top
 Profile  
Reply with quote  
PostPosted: Wed Jan 16, 2019 6:10 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
Nice and simple!

(A version with latched inputs (or outputs) might be useful in some situations? I think the same PLD can do that.)


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 17, 2019 3:17 am 
Offline
User avatar

Joined: Fri Dec 12, 2008 10:40 pm
Posts: 1007
Location: Canada
Sweet!

Does that chip have latching ability?

_________________
Bill


Top
 Profile  
Reply with quote  
PostPosted: Thu Jan 17, 2019 10:37 pm 
Offline

Joined: Sat Feb 07, 2015 7:57 pm
Posts: 13
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 21, 2019 6:34 pm 
Offline

Joined: Wed Feb 12, 2014 1:39 am
Posts: 173
Location: Sweden
Wait the minipro supports the ATF16V8B now? I thought the Atmel PLDs needed expensive programmers?


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 21, 2019 6:42 pm 
Offline

Joined: Sat Jan 02, 2016 10:22 am
Posts: 197
It's the 22V10 that seems to need the expensive programmers. And maybe the other 24 pin types ?


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 21, 2019 7:59 pm 
Offline

Joined: Sat Jun 04, 2016 10:22 pm
Posts: 483
Location: Australia
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 21, 2019 10:50 pm 
Offline

Joined: Sat Feb 07, 2015 7:57 pm
Posts: 13
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 21, 2019 10:56 pm 
Offline
User avatar

Joined: Wed Feb 14, 2018 2:33 pm
Posts: 1488
Location: Scotland
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/


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 21, 2019 11:14 pm 
Offline

Joined: Sat Jun 04, 2016 10:22 pm
Posts: 483
Location: Australia
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 22, 2019 9:37 am 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
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.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 22, 2019 12:49 pm 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
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.

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


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 22, 2019 1:46 pm 
Offline

Joined: Mon May 21, 2018 8:09 pm
Posts: 1462
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC


Who is online

Users browsing this forum: DRG, Paganini and 31 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: