Author Topic: CPLD to replace 74xx chips in an old circuit  (Read 4394 times)

0 Members and 1 Guest are viewing this topic.

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 366
  • Country: es
    • Pinballsp
CPLD to replace 74xx chips in an old circuit
« on: May 26, 2019, 03:51:13 pm »

Hello.

I have a couple of old circuits (from the 90s), which have enough 74xx chips, I would like to replace them with a single CPLD. I only know CPLDs at the theoretical level, I have never worked in practice with programmable logic.

The problem is that all these old circuits operate at 5 volts, with microprocessors Z80, 68B09, TS68000, eprom 27Cxxx and RAM 6264/62256.

I have been consulting with a friend of a friend who could do this work, but he tells me that using a CPLD with tolerant ports 5 volts, is something old and at any time they can stop making them.  He suggests working at 3.3v, because CPLDs for that voltage are also cheaper and with higher density.

I do not see a solution, as a CPLD with pins that are not tolerant to 5 volts, can interact with a circuit at 5 volts (Z80, 27c010, 6264), because try to put adapters of logical levels from 5 to 3.3 bidirectional, It would complicate much more and it would not be worth doing.

Are CPLDs with ports that are tolerant to 5v signals really obsolete, are they more expensive and can stop being manufactured very soon?

PS: remaking the rest of the circuit is not feasible, that would be more complicated and expensive than leaving it as it is now.

Regards


Online Ian.M

  • Super Contributor
  • ***
  • Posts: 8619
Re: CPLD to replace 74xx chips in an old circuit
« Reply #1 on: May 26, 2019, 04:38:52 pm »
A 3.3V CPLD with 5V tolerant inputs wont output valid levels for 5V CMOS logic, and its a real pain having to buffer all outputs to get rail to rail levels.  OTOH 3.3V levels are generally sufficient to drive 5V LS TTL and HCT CMOS.

Its true that the industry is moving towards ever lower logic voltages, but some manufacturers have an excellent track record for continuing production of older parts, e.g Microchip still supply many 30 year old PICs and continue to do so as long as there is any demand.   

There are a good selection of ex-Atmel 5V CPLDs here:
https://www.microchip.com/design-centers/programmable-logic/spld-cpld
all in current production status, and now they are under Microchip ownership, I think its fairly unlikely they will go out of production in the next decade or so.

Edit: they've also got some 5V FPGAs:
https://www.microchip.com/design-centers/programmable-logic/field-programmable-gate-array/at40k-fpgas
« Last Edit: May 26, 2019, 05:29:57 pm by Ian.M »
 
The following users thanked this post: luiHS

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3283
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: CPLD to replace 74xx chips in an old circuit
« Reply #2 on: May 26, 2019, 05:03:29 pm »
Or, if it is a one-off, slap there some older stock Altera MAX7000 series, or Xilinx XC9500 series 5V PLD. Still obtainable.

//Anyway, if redesigning old stuff , why not changing also the old CPUs and RAMs to something more recent?
 
The following users thanked this post: luiHS

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 366
  • Country: es
    • Pinballsp
Re: CPLD to replace 74xx chips in an old circuit
« Reply #3 on: May 26, 2019, 05:28:12 pm »
//Anyway, if redesigning old stuff , why not changing also the old CPUs and RAMs to something more recent?

As I mentioned, that is more complicated and expensive than leaving it as it is. Also I do not have the source code of the applications made for Z80 and TS68000. Disassembling the object code and trying to port it to a more modern system would be extremely complex and expensive, not worth it. For that I prefer to leave everything as it is with its 74xx, I just thought about using a CPLD to make the design more compact, nor is there an important saving in the cost of components.

Online wraper

  • Supporter
  • ****
  • Posts: 11541
  • Country: lv
Re: CPLD to replace 74xx chips in an old circuit
« Reply #4 on: May 26, 2019, 06:05:15 pm »
Unless replacing everything including CPU with FPGA+RAM, I don't see it being worth it.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 12055
  • Country: us
Re: CPLD to replace 74xx chips in an old circuit
« Reply #5 on: May 26, 2019, 06:10:17 pm »
The Xilinx XC9500 series has 5V capable IO. In practice I've found it works just fine to drive 5V logic with 3.3V outputs, it may not be in spec but if this is a personal project it doesn't hurt to try.
 

Online wraper

  • Supporter
  • ****
  • Posts: 11541
  • Country: lv
Re: CPLD to replace 74xx chips in an old circuit
« Reply #6 on: May 26, 2019, 06:11:17 pm »
But then you could just emulate Z80 on say STM32.
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 15258
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: CPLD to replace 74xx chips in an old circuit
« Reply #7 on: May 26, 2019, 07:23:21 pm »
If nothing else, a 3.3V (or lower) FPGA and level shifters (usually a 74ABT something?) will do.  You need to select bus transceivers as appropriate for the signal directions, of course.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline PCB.Wiz

  • Frequent Contributor
  • **
  • Posts: 405
  • Country: au
Re: CPLD to replace 74xx chips in an old circuit
« Reply #8 on: May 26, 2019, 07:37:58 pm »
I have a couple of old circuits (from the 90s), which have enough 74xx chips, I would like to replace them with a single CPLD. I only know CPLDs at the theoretical level, I have never worked in practice with programmable logic.
How many is 'enough' - can you list the parts ?


The problem is that all these old circuits operate at 5 volts, with microprocessors Z80, 68B09, TS68000, eprom 27Cxxx and RAM 6264/62256.

I have been consulting with a friend of a friend who could do this work, but he tells me that using a CPLD with tolerant ports 5 volts, is something old and at any time they can stop making them.  He suggests working at 3.3v, because CPLDs for that voltage are also cheaper and with higher density.
Atmel SPLD/CPLDs are 5V operating, and still in active production. They come up to 128 Macrocells.
There are also SiLego parts, but they are smaller, tho you can use a few of them. It comes down to what you need to replace.

If you have existing also-older parts this talks to, how do you manage this physically ? - Is this on a plug in PCB you can easily re-design ?
« Last Edit: May 27, 2019, 12:36:19 am by PCB.Wiz »
 

Offline up8051

  • Regular Contributor
  • *
  • Posts: 137
  • Country: pl
Re: CPLD to replace 74xx chips in an old circuit
« Reply #9 on: May 26, 2019, 08:01:00 pm »
CPLD
ATF1508AS:
- 5V
- 128 macrocell
- PLCC86 or TQFP100
- price about 10$

Or put all (softcore uP, RAM,  logic) into big FPGA nad add I/O buffer for 5V logic.

Regards,
up8051 aka JarekC
 
The following users thanked this post: luiHS

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 5834
  • Country: nl
Re: CPLD to replace 74xx chips in an old circuit
« Reply #10 on: May 26, 2019, 08:48:05 pm »
Just curious since I only know the Xilinx/Altera-Intel SW infrastructure.
Those Atmel Microchip cpld's is the software tooling also free ? What is it called and how does it compare to Altera's quartus?
 

Offline up8051

  • Regular Contributor
  • *
  • Posts: 137
  • Country: pl
 
The following users thanked this post: edavid, Kjelt, luiHS

Offline SparkyFX

  • Frequent Contributor
  • **
  • Posts: 632
  • Country: de
Re: CPLD to replace 74xx chips in an old circuit
« Reply #12 on: May 26, 2019, 09:34:26 pm »
The toolchain might be the real cost for small part counts, finding programmers that work, software and so on. Actually it is hard to find documentation on some.

I am dabbling with Microchip/Atmel 22V10 and 16V8 for similar reasons, their software WinCUPL is free of charge.
The popular Autoelectric MiniPro TL866II has recently been updated with 22V10 variants for programming (havenĀ“t tested so far, though).
Support your local planet.
 
The following users thanked this post: luiHS

Offline up8051

  • Regular Contributor
  • *
  • Posts: 137
  • Country: pl
Re: CPLD to replace 74xx chips in an old circuit
« Reply #13 on: May 26, 2019, 09:58:22 pm »
ATF15xx chip have ISP (JTAG), can be programmed with ATmelISP
https://www.microchip.com/design-centers/programmable-logic/spld-cpld/tools/software/atmisp
Programmer ATDH1150USB cost about 60$ (it can probably be built for a few $).

Regards,
up8051 aka JarekC
 
The following users thanked this post: luiHS

Offline FrankBuss

  • Supporter
  • ****
  • Posts: 2319
  • Country: de
    • Frank Buss
Re: CPLD to replace 74xx chips in an old circuit
« Reply #14 on: May 27, 2019, 12:19:30 am »
You could emulate the whole system inside one modern FPGA. There are free cores for Z80 and 68000:

https://opencores.org/projects/tg68
https://opencores.org/projects/a-z80

Then e.g. use one of these boards:

https://www.seeedstudio.com/Sipeed-TANG-PriMER-FPGA-Development-Board-p-2881.html

The FPGA itself has 130KB SRAM and 64MBit SDRAM built-in, no need for any external RAM. On startup, just load the EPROM content from the 8Mbit user flash on the board. But depending on your system, it might work with less powerful FPGAs as well, like the cheap MachXO series from Lattice.

But if you are new to FPGA development, then this is not a project you would do as your first project. I could do this, but might need weeks, because looks like your system is pretty complex with 3 different CPUs.

If you just want to replace the 74xx chips, you could use a small FPGA or CPLD, and then level shifters for the 3.3V to 5V conversion with auto-direction sensing, like this one:

http://www.ti.com/lit/ds/symlink/txb0108.pdf

Then you don't need to develop anything new for the conversion direction pin. Implementing 74xx logic with a CPLD is very easy. All FPGA/CPLD vendors have "schematic entry" tools and basic elements like AND and OR. You could just draw your circuit with the editor and you are done. I would do it in VHDL, would be even easier once you know the language (or Verilog, if you prefer C-style syntax).
So Long, and Thanks for All the Fish
Electronics, hiking, retro-computing, electronic music etc.: https://www.youtube.com/c/FrankBussProgrammer
 
The following users thanked this post: luiHS

Offline romhunter

  • Regular Contributor
  • *
  • Posts: 91
  • Country: vn
Re: CPLD to replace 74xx chips in an old circuit
« Reply #15 on: May 27, 2019, 03:21:07 am »
If you want Altera CPLD, go for MAX7000. It can withstand 5V and is decent. Or go for Microchip ATF15. They're all 5V compatible.

I would recommend Microchip though, they did do one thing right: support released product (no matter how old they are).
 
The following users thanked this post: luiHS

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 366
  • Country: es
    • Pinballsp
Re: CPLD to replace 74xx chips in an old circuit
« Reply #16 on: May 27, 2019, 03:42:56 am »
How many is 'enough' - can you list the parts ?

Cirtuit 1:
======
1 x  4020
1 x  74HC00
1 x  74HC04
1 x  74HC07
1 x  74HC139
1 x  74HC153
1 x  74HC259
1 x  74HC374
1 x  74HC74

Cirtuit 2:
======
3 x  PAL
1 x  74HCT240
1 x  74LS04D
1 x  74LS163A
2 x  74LS166D
6 x  74LS245
2 x  74LS273
2 x  74LS374
1 x  74LS74D


Quote
If you have existing also-older parts this talks to, how do you manage this physically ? - Is this on a plug in PCB you can easily re-design ?

Are full boards of which I have designed a new PCB, based on the original scheme. I assemble it in my own Pick and Place Neoden4, what I wanted is to make a more compact design, with as few components as possible.

Another circuit, takes part of the original scheme, plus another circuit designed by me with a Kinetis MK66 microcontroller. All in a new PCB made by me.
 
The two circuits are old electronics, one based on a Z80 microprocessor and the other on a TS68000. Of the circuit with the Z80, I already made some changes, the original Z80 is DIP, I put the LQFP44, the Eprom was DIP, I have put PLCC32, the RAM was DIP, I have put SOIC, all the 74xx were DIP, I have put them TSSOP, the passive components were THT, I have put all SMD 0402.

Offline KrudyZ

  • Regular Contributor
  • *
  • Posts: 184
  • Country: us
Re: CPLD to replace 74xx chips in an old circuit
« Reply #17 on: May 27, 2019, 07:49:10 am »
There are 3.3V versions of both the Z80 and 68000 cores available.
Maybe it would be easier to replace the processors instead and then go with 3.3V CPLDs or FPGAs...
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 5834
  • Country: nl
Re: CPLD to replace 74xx chips in an old circuit
« Reply #18 on: May 27, 2019, 07:51:42 am »
If I look at this list of components any small cpld should be able to take care of that.
BUT how many individual inputs and outputs does this circuit have, that determines the size of the package and will probably be a bigger challenge to find a matching cpld.  :-//

list the parts ?

Cirtuit 1:
======

Cirtuit 2:
======
 

Online imo

  • Super Contributor
  • ***
  • Posts: 2621
  • Country: 00
Re: CPLD to replace 74xx chips in an old circuit
« Reply #19 on: May 27, 2019, 07:57:11 am »
Years back you would take an XC9572 (5V) in an 84pin PLCC package and in Xilinx'es ISE 14.7 you would copy your Circuit 1/2 schematics 1:1 in their schematics capture mode (it includes almost all 74xxx parts) in a few minutes. I started that way, after some time I switched to Verilog. When you spent years with 74xx designs the switch to an HDL language is more difficult because of your "74" mindset :)

PS: I bet you may get the XC9572/36 (not the 3.3V XL version) in the 44/84pin PLCC off ebay including the socket. Not cheap, however  :(

The basic decision factor on the CPLD size is the number of FFlops and IO pins required. For example the 9572 has got 72 FFs, therefore I would count all FFs in my 74xxx logic and compare. The other logic functions usually fit inside easily when the number of available IO pins is ok.

Your Circuit 1 is 31 FFs afaik, it may fit into an XC9536 provided the number of IO pins is ok.

The Circuit 2 is larger, 2xPALs may include ~20FFs, plus all the others will not fit into 9572. Also the number of IOs could be large. Maybe 2x9572 in 84PLCC? Or a 95144 in 144pin flatpack?

Anyhow, for example, download a dev tool - from Xilinx (<=v14.7 for CPLDs) or Intel/Altera(?) or Lattice(?) - and draw your schematics in. Try to compile for a certain CPLD/package and you will see how it fits. All is free of charge, except your time :)

There are 3.3V versions of both the Z80 and 68000 cores available.
Maybe it would be easier to replace the processors instead and then go with 3.3V CPLDs or FPGAs...

That is the way I would do it today. In the 3.3V technology you may create a Z80/68k system including all the glue logic and PIO/UART/DMA etc peripherals in $20-$40 fpgas from any vendor, also there are tons of 3.3V memories available. The main difficulty for you will be the switch into VHDL or Verilog. Also the mastering all the design tools needs time, and most probably you will face 144pin flatpacks or BGA packages. Be warned.. :)

PPS: Warning 2 - in case you have to run an "existing binary" on such a Z80/68k systems fully implemented in an fpga, you have to doublecheck whether the actual CPU implementation supports all the tricks people used to use in their codes in past. Most CPU fpga cores are not 100% compatible (or at least not 100% tested) against the original silicon..
« Last Edit: May 27, 2019, 10:39:24 am by imo »
 

Offline PCB.Wiz

  • Frequent Contributor
  • **
  • Posts: 405
  • Country: au
Re: CPLD to replace 74xx chips in an old circuit
« Reply #20 on: May 27, 2019, 08:15:51 pm »
Are full boards of which I have designed a new PCB, based on the original scheme. I assemble it in my own Pick and Place Neoden4, what I wanted is to make a more compact design, with as few components as possible.

Another circuit, takes part of the original scheme, plus another circuit designed by me with a Kinetis MK66 microcontroller. All in a new PCB made by me.
 
The two circuits are old electronics, one based on a Z80 microprocessor and the other on a TS68000. Of the circuit with the Z80, I already made some changes, the original Z80 is DIP, I put the LQFP44, the Eprom was DIP, I have put PLCC32, the RAM was DIP, I have put SOIC, all the 74xx were DIP, I have put them TSSOP, the passive components were THT, I have put all SMD 0402.
OK, so you are already putting many hours into this, and can respin PCBs as needed.
If you look at a list


Cirtuit 2:
======
3 x  PAL
1 x  74HCT240
1 x  74LS04D
1 x  74LS163A
2 x  74LS166D
6 x  74LS245
2 x  74LS273
2 x  74LS374
1 x  74LS74D
You might choose a split based on 'easiest PCB design' and IO pin counts.
eg Octal parts might stay octal CMOS, but change to better pinouts like 74HCT573

Then you can look at what is non-octal eg
3 x  PAL
1 x  74LS04D
1 x  74LS163A
2 x  74LS166D
1 x  74LS74D
to see what makes sense to pull into a CPLD, and what might make sense to move to tiny-logic, placed where it is needed.
5V CPLDs are available, but as already mentioned, are trailing edge (but so too are your Z80  & TS68000 :) )
Digikey shows 35  5V CPLDs normally stocked, all Atmel part codes.
Which you choose again comes down to PCB layout, and you can swap PLD pins to help there.
You might choose a few ATF1504 in TQFP44, or fewer ATF1508 in TQFP100

You do need to design the PLD in parallel with the PCB, as not all pin choices will fit into the PLD

Addit: you may consider a 3v3 supply, and a 5V tolerant CPLD - a Xilinx DOC claims this :
5V Tolerance CoolRunner XPLA3 devices are 5V-tolerant. Also, the XC9500, XC9500XL, and XC9500XV families are 5V-tolerant.

Also note the ATF150xASV(L) parts can operate on 3v3 or 5V, and cheapest 5V capable 128MC part on digikey is
ATF1508ASVL-20AU100   128MC 20NS 100TQFP   771 - Immediate   $4.42000 @ qty 1
« Last Edit: May 27, 2019, 08:34:56 pm by PCB.Wiz »
 
The following users thanked this post: luiHS

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 366
  • Country: es
    • Pinballsp
Re: CPLD to replace 74xx chips in an old circuit
« Reply #21 on: May 27, 2019, 10:18:00 pm »
5V CPLDs are available, but as already mentioned, are trailing edge ( but so too are your Z80  & TS68000 :)  )

The TS6800 I do not know, but the Z80 is available for many years, it seems that it is one of those components that will always exist, as it happens with some microchip microcontrollers. I remember the Z80  from the time of the Sinclair ZX Spectrum, in DIP socket.

The alternative arrived at the moment, with the Z80, would be to use an FPGA with the corresponding core, but for now I prefer not to get into something that is complex and expensive, because I would have to hire it or learn to do it by myself.
« Last Edit: May 27, 2019, 10:20:43 pm by luiHS »
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 12055
  • Country: us
Re: CPLD to replace 74xx chips in an old circuit
« Reply #22 on: May 27, 2019, 10:22:54 pm »
The jump from implementing a bit of logic in a CPLD to building a whole system in a FPGA is not as large as it first seems, because there are already tested working softcore CPUs and complete systems available.

That said, if you want to do something, go ahead and try using a CPLD to replace some of the logic, it's a fun project that costs very little to try. You can get Xilinx XC9500 series parts on cheap little dev boards from China, you'll also need a platform USB cable which is about 25 bucks from the same sorts of sources and the free version of Xilinx ISE. If you succeed then you'll be on your way to more fun and advanced projects, if you fail you are out very little and if funds are tight you should be able to sell the hardware you bought for at least half what you paid.
 

Online ebastler

  • Super Contributor
  • ***
  • Posts: 3530
  • Country: de
Re: CPLD to replace 74xx chips in an old circuit
« Reply #23 on: May 28, 2019, 05:46:43 am »
The alternative arrived at the moment, with the Z80, would be to use an FPGA with the corresponding core, but for now I prefer not to get into something that is complex and expensive, because I would have to hire it or learn to do it by myself.

I think this discussion is going round in circles, largely because you have not told us about your intended use case. It seems that you are not doing this as a hobby project, but for commercial use? And that you have existing boards and binary program code, which you want to replicate in a "reasonably" future-proof and cost-effective manner, right?

But you would need to get more quantitative to assess what "reasonably" means here:
  • How many (more) years of production life do you want to get out of the new board version? That will affect the choice of technology/components.
  • What annual quantity of boards are you expecting? That will inform the balance between development cost and parts cost on the boards.
  • Any other constraints we should know about? E.g. is low power consumption or a small form factor important?
 
The following users thanked this post: luiHS

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 366
  • Country: es
    • Pinballsp
Re: CPLD to replace 74xx chips in an old circuit
« Reply #24 on: May 28, 2019, 07:41:48 am »
I think this discussion is going round in circles, largely because you have not told us about your intended use case. It seems that you are not doing this as a hobby project, but for commercial use? And that you have existing boards and binary program code, which you want to replicate in a "reasonably" future-proof and cost-effective manner, right?

But you would need to get more quantitative to assess what "reasonably" means here:
  • How many (more) years of production life do you want to get out of the new board version? That will affect the choice of technology/components.
  • What annual quantity of boards are you expecting? That will inform the balance between development cost and parts cost on the boards.
  • Any other constraints we should know about? E.g. is low power consumption or a small form factor important?


Thanks, but with the answers that I have read I already realize the options that I have from a technical point of view, leave everything as is, CPLD or FPGA.

Other factors of an economic or commercial nature are not matters that I have considered to treat them publicly.

Right now, I just want to leave the circuits as they are or replace the 74xx chips with a CPLD, nothing more. Maybe in the future, and if there is no other option, consider migrating to an FPGA that replaces the processor and 74xx chips.
« Last Edit: May 28, 2019, 07:46:00 am by luiHS »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf