Forum Rules and Etiquette

Our mission ...

This forum is part of our mission to promote the preservation of vintage computers through education and outreach. (In real life we also run events and have a museum.) We encourage you to join us, participate, share your knowledge, and enjoy.

This forum has been around in this format for over 15 years. These rules and guidelines help us maintain a healthy and active community, and we moderate the forum to keep things on track. Please familiarize yourself with these rules and guidelines.

Rule 1: Remain civil and respectful

There are several hundred people who actively participate here. People come from all different backgrounds and will have different ways of seeing things. You will not agree with everything you read here. Back-and-forth discussions are fine but do not cross the line into rude or disrespectful behavior.

Conduct yourself as you would at any other place where people come together in person to discuss their hobby. If you wouldn't say something to somebody in person, then you probably should not be writing it here.

This should be obvious but, just in case: profanity, threats, slurs against any group (sexual, racial, gender, etc.) will not be tolerated.

Rule 2: Stay close to the original topic being discussed
  • If you are starting a new thread choose a reasonable sub-forum to start your thread. (If you choose incorrectly don't worry, we can fix that.)
  • If you are responding to a thread, stay on topic - the original poster was trying to achieve something. You can always start a new thread instead of potentially "hijacking" an existing thread.

Rule 3: Contribute something meaningful

To put things in engineering terms, we value a high signal to noise ratio. Coming here should not be a waste of time.
  • This is not a chat room. If you are taking less than 30 seconds to make a post then you are probably doing something wrong. A post should be on topic, clear, and contribute something meaningful to the discussion. If people read your posts and feel that their time as been wasted, they will stop reading your posts. Worse yet, they will stop visiting and we'll lose their experience and contributions.
  • Do not bump threads.
  • Do not "necro-post" unless you are following up to a specific person on a specific thread. And even then, that person may have moved on. Just start a new thread for your related topic.
  • Use the Private Message system for posts that are targeted at a specific person.

Rule 4: "PM Sent!" messages (or, how to use the Private Message system)

This forum has a private message feature that we want people to use for messages that are not of general interest to other members.

In short, if you are going to reply to a thread and that reply is targeted to a specific individual and not of interest to anybody else (either now or in the future) then send a private message instead.

Here are some obvious examples of when you should not reply to a thread and use the PM system instead:
  • "PM Sent!": Do not tell the rest of us that you sent a PM ... the forum software will tell the other person that they have a PM waiting.
  • "How much is shipping to ....": This is a very specific and directed question that is not of interest to anybody else.

Why do we have this policy? Sending a "PM Sent!" type message basically wastes everybody else's time by making them having to scroll past a post in a thread that looks to be updated, when the update is not meaningful. And the person you are sending the PM to will be notified by the forum software that they have a message waiting for them. Look up at the top near the right edge where it says 'Notifications' ... if you have a PM waiting, it will tell you there.

Rule 5: Copyright and other legal issues

We are here to discuss vintage computing, so discussing software, books, and other intellectual property that is on-topic is fine. We don't want people using these forums to discuss or enable copyright violations or other things that are against the law; whether you agree with the law or not is irrelevant. Do not use our resources for something that is legally or morally questionable.

Our discussions here generally fall under "fair use." Telling people how to pirate a software title is an example of something that is not allowable here.

Reporting problematic posts

If you see spam, a wildly off-topic post, or something abusive or illegal please report the thread by clicking on the "Report Post" icon. (It looks like an exclamation point in a triangle and it is available under every post.) This send a notification to all of the moderators, so somebody will see it and deal with it.

If you are unsure you may consider sending a private message to a moderator instead.

New user moderation

New users are directly moderated so that we can weed spammers out early. This means that for your first 10 posts you will have some delay before they are seen. We understand this can be disruptive to the flow of conversation and we try to keep up with our new user moderation duties to avoid undue inconvenience. Please do not make duplicate posts, extra posts to bump your post count, or ask the moderators to expedite this process; 10 moderated posts will go by quickly.

New users also have a smaller personal message inbox limit and are rate limited when sending PMs to other users.

Other suggestions
  • Use Google, books, or other definitive sources. There is a lot of information out there.
  • Don't make people guess at what you are trying to say; we are not mind readers. Be clear and concise.
  • Spelling and grammar are not rated, but they do make a post easier to read.
See more
See less

getting into programmable logic

  • Filter
  • Time
  • Show
Clear All
new posts

    getting into programmable logic

    After doing a couple basic PCB designs using KiCad, I was thinking about taking on some more complex projects. Of course I would like to avoid assembling a huge board with a sea of TTL chips (or having to buy all those chips) as was done in the old days. So I started looking into CPLDs. It turns out that these are mostly (but not entirely) considered obsolete now because FPGAs have become less costly, are available with non-volatile config, and are so much more capable. However FPGAs are also overkill for what I want to do. I'm not going to design a whole CPU core as my first project or anything like that. They also tend to come in SMD packages with many pins which I am not prepared to work with.

    CPLDs that are still around include the Atmel/Microchip ATF750, ATF1500, and ATF2500. These can run at 5V and come in PLCC and even DIP packages, perfect for retro stuff. When doing a web search I found a few mentions of the ATF750 but nobody was using them because they aren't supported by many device programmers. ATF1500 on the other hand can do JTAG. As it happens, my old Needham's Electronics EMP-11 is supposed to support both of these devices in the last version of its software (from 2002). So I ordered a handful of both '750 and '1500s. I also bought a 5-piece kit of PLCC-to-DIP adaptors from ebay. Hopefully I should have everything I need to program these chips.

    The ATF750 was described as a 22V10 on steroids. It has 20 flip-flops, which is like 20 data bits. Doesn't sound like much. But, the state of each bit can depend on up to 16 signals, including any of the other "bits" (outputs of the flip-flops) or the state of any of the 12 input-only pins or 10-bidirectional pins. The flip-flops also have clock and reset inputs, and the output pins can invert or go tristate.

    I didn't buy any of the '2500 because they are more expensive than the '1500 and don't appear to be supported on the EMP-11. They are a similar design to the '750 but at a larger scale, ie. 48 flip-flops and more pins. The '1500 has a somewhat different design with OR/XOR gates mixed in and something called "cascade."

    Perhaps one of the downsides of using these chips is the necessity of using WinCUPL to create the logic circuit. It's not nearly as fancy as something like Quartus, and uses its own language rather than Verilog or VHDL. I haven't personally used any of these languages yet so I can't compare them, but I found WinCUPL to be somewhat frustrating at first. It's like a glorified text editor with some command-line tools behind the scenes that do the actual work of compiling the design. It gives very little feedback about what it's doing or what just happened when you clicked that button. A window pops up that says there were X warnings and Y errors, but doesn't say what the warnings and errors are (I think you have to open a separate file to find out). There is a useful simulator included, but it takes a lot of clicking to set it up. There are also a lot of example designs for things like shifters, counters, and even an 8255 parallel port.

    While I'm waiting for ordered parts to arrive, I will try to design something using CUPL.

    Programming GALs is usually different from programming large CPLDs or FPGAs.

    The languages customarily used are different. FPGA and CPLDs are more the domain of VHDL or Verilog than they are of logic equations or truth tables. Nothing wrong with that, but it's important to appreciate the different approaches.
    Reach me: vcfblackhole _at_ protonmail dot com.


      Didn't realize it before, but I should point out that there is an ATF1500, 1502, 1504, and 1508 and there are some important differences between them. Looks like they don't all have JTAG or run at 5V, so don't forget to check the datasheets.


        Some of my experiences with this:

        WinCupl is buggy. I've had the main window crash a couple of times. So save early and save often. I considered using my own text editor instead but since actually typing in the code is such a small portion of the overall development time maybe it isn't worth bothering. WinSim has a problem where the window doesn't redraw properly sometimes, it needs to be manually resized or manipulated to get it to update. (Another commentator speculated that it happened only on new versions of Windows, but I am running Windows 2000 and it does the same thing.)

        When errors are reported, clicking around in the bottom window that has the compiler messages will open a separate window providing more information on the error. Some of the errors I've had resulted from trying to use a variable name beginning with a number (this is not allowed, gives a cryptic "variable name near..." message), or doing things in the wrong order. Until you give an equation defining the state of an output pin, the compiler is assuming it is an input pin. So you can't set the .oe yet for instance, that has to be done after. The compiler will also throw errors about the heading information, it's giving me flashbacks to being in school again In one case it wouldn't stop giving errors about the heading not matching some other file so I had to close the program and delete everything except the main .PLD source and start over.

        After compiling you can open the .DOC file which contains restatements of all the logic equations and some other information, which hopefully matches what you intended. There are some optimization options pertaining to the compiler. I read that quinne-mcclusky was supposed to be the most comprehensive, therefore I see no reason not to select that since compilation finishes instantly on post-2000 era PCs anyway. I tried compiling a test file with each of the "optimize for polarity" and "demorgan" options toggled on and off and having the former enabled slightly reduced the amount of used resources in the chip. I have a feeling this could be dependent on the design though.

        When targeting the 150x chips, the code should run through the "fitter" which tries to optimally assign resources inside the chip to implement the design. It produces a .FIT file which has a report at the bottom listing how many flip-flops, product terms, pins, etc. were used.

        I have read that a design targetting Altera MAX7000 series and compiled with Quartus can be run through Atmel's POF2JED utility and programmed into an ATF150x. Apparently the chips are that close in function. I installed an old version of Quartus II Web Edition and was going to try running a test file through just to see what the process was like, but a brief search didn't turn up any files appropriate for the MAX7000. I also noticed that the Altera example files had a license statement saying they were only to be used in Altera (now Intel) chips...

        As an example, an address decoder for an ISA card in CUPL might look like this:
        pin [2,3,4,5,6,7,8] = [a3..9];
        pin 9 = !ior;
        pin 10 = !iow;
        pin 15 = selectcard;
        field ioaddr = [a3..9];
        selectcard = (ioaddr:240 & ior) or (ioaddr:240 & iow);
        The limiting factor for what you can do with these chips seems to come down to the number of pins or the amount of internal state. For instance, you can't very well run a 20-bit address bus into and out of a 44-pin chip that has 8 pins for power and ground. Chips with 84 and more pins are out there but I'm not keen on routing/soldering those ones...

        But having 64 macrocells means you can only have 8x 8-bit registers, actually less in a realistic scenario. So let's say you'd like to make your own sound chip like the SN76489 used by Sega or the PC-Jr. This chip has 3x 10-bit period registers and 3x 4-bit volume registers. That would be 42 macrocells just to store that information. Each oscillator needs a 10-bit counter to compare with the 10-bit period, now we're up to 72 macrocells. So a 1504 is clearly inadequate, maybe a 1508 with 128 macrocells would be enough.

        I did program something into an ATF750 and test it successfully. The EMP-11 application nearly caused me to freak out however, as a message went by in the log saying that the security bit was TRUE and the device would be "secured" meaning it can't be reprogrammed again. I don't know why it says that as the relevant security options are unchecked in both WinCupl and the EMP-11 options. It turned out to be a false alarm though. In fact there was another message which contradicted it saying that the security fuse would not be activated. I was able to program it a second time after all.


          My PLCC to DIP adaptors finally arrived aaaaaaand I've determined that I can't program any ATF1500 parts using the EMP-11. The 1504AS is in the list of supported devices and when I select it the log shows "adaptor: none" however this is wrong. It does need an adaptor, which is unobtainium and I can't replicate it since I don't know how it is wired. But that just means I'll have to get one of those $5 JTAG adaptors and wire that up instead before I can go ahead with any of the projects I had in mind for this.

          In the meantime I've been doing more reading on CPLDs, FPGAs, and verilog. While the 5V compatibility of the old CPLDs definitely has its uses, it also dates the technology in these chips. I read somewhere that these are made using an 800nm process (just like the Sega Saturn...), which explains their double-digit number of flip-flops compared to thousands or hundreds of thousands in an FPGA made with modern feature sizes. Macrocells, LUTs, logic elements, or just flip-flops all seem to be roughly comparable metrics. There's always a flip-flop with some gates surrounding it to control its operation. In the case of the CPLD it's AND gates and multiplexers, while in the case of a LUT it is some bits of SRAM that yield a certain output value for each possible combination of inputs. Other metrics are also used. A MAX7128 is said to have 2500 "gates" while an ACEX 1K100 with 4992 LUTs has 100,000 gates, leading me to the conclusion that a macrocell/LUT is worth about 20 gates. I think I also saw "LABs" which were blocks of 8 LUTs.

          Verilog looks like it has more abstractions and complexity than CUPL but it's still flexible enough that it can be done in a straight-forward manner, so I could probably handle it. (I don't think I'd like to mess with VHDL.)

          Another difference for FPGAs is the across-the-board choice by the vendors to keep the format of the bitstream a secret, leading to a fairly ugly situation with the development software. One or two series of chips have been reverse engineered and programmed using open source tools. I found a Win32 build of Yosys, but that is only one piece of the puzzle. I couldn't find a Win32 build of arachnepnr or nextpnr, or any build at all for that matter, so I wouldn't be able to go this route.

          I know that Quartus 8.1 and 9.2 definitely run on my computer. The other vendors' software may or may not run, and you have to jump through hoops just to download it. I hate jumping through hoops. So I've been looking at dev boards based on Altera parts. I certainly won't be designing my own PCB for an FPGA since that is too much work for a whimsical experiment, plus they are nearly all BGA parts that have to be machine soldered to a board. Sockets for BGAs exist but they are expensive and also not conducive to hand soldering.

          I am tempted to get the cheap Chinese board with a Cyclone IV on it, but... I actually already have an FPGA board. It's the C-One! I got this ages ago, at a time when the design wasn't finalized. They added an extra RAM card for the C64 core that was in development. I never got the card and this particular board wouldn't do much without it. I forgot about it and it sat in a box until now.

          I found the C-One website that now has alternative cores available and various other necessary files. And since I now have the aforementioned EMP-11 and PLCC-DIP adaptor I can flash a new ROM image and maybe get this board to do something. I already got a boot screen, which is more than I ever had before!

          Originally posted by bakemono View Post
          quinne-mcclusky was supposed to be the most comprehensive, therefore I see no reason not to select that
          There actually is a reason. Sometimes you have to choose "quick" or the compiler will crash


            Does Xilinx still have a line of CPLDs? Are any 5V-tolerant? I fell in love with the 9500 series. Good tools, program in Verilog and use JTAG for programming.
            Reach me: vcfblackhole _at_ protonmail dot com.


              Originally posted by Chuck(G) View Post
              Does Xilinx still have a line of CPLDs? Are any 5V-tolerant? I fell in love with the 9500 series. Good tools, program in Verilog and use JTAG for programming.
              yep the XC9500XL series is 5V tolerant and still active production


                Originally posted by Chuck(G) View Post
                Does Xilinx still have a line of CPLDs? Are any 5V-tolerant? I fell in love with the 9500 series. Good tools, program in Verilog and use JTAG for programming.
                Xilinx also has the CoolRunner XPLA3 series (XCR3***XL) which I've used and are 3.3V with 5V tolerance. They interface well with 5V logic and have the advantage of very low power requirements compared to the XC9500XL's and most other CPLD's that I've investigated. Xilinx also has the CoolRunner II series (XC2C***) which have even more advantages but are 1.8V core with Vio limited to 3.3V.


                  I've recently decided to try to get into programmable logic myself, and after a very frustrating couple hours I have to ask... does WinCUPL actually work for anyone running Windows 10? Every time I try to run the compile or simulation actions on one of the example .PLDs I get an error message that judging from Google results seems to be a generic Visual Basic runtime error and it bails.
                  My Retro-computing YouTube Channel (updates... eventually?): Paleozoic PCs Also: Blogspot


                    "Works" is a loaded term. I do not know of any Windows 10 specific issues. But WinCUPL has always been crash prone when typing into the built-in editor and terse in error reporting. If you look in the generated files after an error, it will usually have much more detail. But I've had to back out large amount of code on occasion and incrementally add it back to find the origin of a problem. I wish the original author (not Atmel/Microchip) would just open source it and let the community fix the issues with the back-end tools (UI is not worth saving).

                    That being said, I don't suppose there are any barriers to anyone (including myself) trying to target some of the open source tools like yosys and nextpnr to a ATF150x or even SPLDs like 16v8s and 22v10s.
                    "Good engineers keep thick authoritative books on their shelf. Not for their own reference, but to throw at people who ask stupid questions; hoping a small fragment of knowledge will osmotically transfer with each cranial impact." - Me


                      Originally posted by Eudimorphodon View Post
                      I've recently decided to try to get into programmable logic myself, and after a very frustrating couple hours I have to ask... does WinCUPL actually work for anyone running Windows 10? Every time I try to run the compile or simulation actions on one of the example .PLDs I get an error message that judging from Google results seems to be a generic Visual Basic runtime error and it bails.
                      Maybe try the example program from this thread (third post)

                      Sounds like they got it to work. I don't use Win10 but I know that sometimes WinCUPL crashes because of issues with the source file, instead of just giving an error message like it should...

                      On the other hand if your error has something to do with VB runtime then maybe it is a missing or incompatible DLL file. You could run through the WinCUPL files and check the dependencies (there are several Windows programs that can do this: CFF Explorer, Task Explorer, OllyDbg, PVDasm, etc.)


                        It really seems like the version of WinCUPL they have available for download has been left frozen in carbonite since about 1999. This is more a symptom than a problem in and of itself, but the "Help" functionality is completely broken on Windows 10; clicking on it gives you a link to a Windows KB article about how the handler for that version of Windows Help files is completely unavailable and you can't get there from here. I still have an old NetBook with Windows XP installed on it lying around somewhere, I guess I'll try it on there if it still works.

                        Do you have any thoughts about GALasm as a possible basic alternative? The chips I ordered were some 20v8s and 22v10s, my initial goal was to just use them to replace the equivalent of a few 74L138-style decoders.
                        My Retro-computing YouTube Channel (updates... eventually?): Paleozoic PCs Also: Blogspot


                          Originally posted by bakemono View Post
                          On the other hand if your error has something to do with VB runtime then maybe it is a missing or incompatible DLL file.
                          I don't think that's really the problem, I think it's just a case of whatever is breaking inside the software happens to make that error spit out when it barfs... at least under that one circumstance in which it barfs. It barfs in many ways.
                          My Retro-computing YouTube Channel (updates... eventually?): Paleozoic PCs Also: Blogspot


                            Something to consider:

                            The Atmel (now part of Microchip) ATF15xx series are parts can be direct replacements for the (now obsolete) Intel/Altera EPM70xx series of parts.

                            And Microchip/Atmel have a utility called POF2JED that allows you to take a generated Altera .pof file for an EPM70xx series part and convert it to an Atmel .jed file.

                            So in fact I have a test board using Altera EPM7032 and EPM7064 in PLCC44 packages, used POF2JED to convert the programs, and popped in Atmel ATF1502 and 1504 parts, programmed them with the converted .jed files using JTAG, and the design works exactly as before.

                            I use Altera QuartusII 13.0sp1 (last version to support the EPM7000 series) to program the EPM7xxx series parts using Verilog.

                            I've tried using the aforementioned Atmel WinCUPL tools for the ATF15xx parts and basically it sucks. I never liked the CUPL language anyway.

                            So just another possibility.


                              When I was doing the XC9500 stuff, I used Verilog. Is that not possible with Atmel parts?
                              Reach me: vcfblackhole _at_ protonmail dot com.