There are quite expensive obsolete chip from various Commodore computers and peripherals- CIA/PIA MOS 6526 and a bit changed 8520 used in Amiga computers. This is a “complex” peripheral interface adapter chip for 6502 processor or 68K chipset.
It is quite complex, as it has: 16 individual programmed I/O lines, 2 independent, linkable timers, real time clock timer/counter, shift register for serial interface and some other stuff. As this chip is for “interface”, some of the pins go outside the computer and connect to various other devices or… some strange objects like metal pins or pens. S, short circuit, ESD spikes can kill these chips. When I lived in Soviet Union, I blew an Amiga 8520 chip and I had my Amiga shelved for several years!
Now it is still possible to buy these chips- sometimes NOS (very expensive), sometimes good pullouts, but sometimes fake ones. And you have to spend over 25USD for just one chip. Maybe it is good variant to buy a DEAD computer in the hope that the chip may be fine.
I am cleaning, testing and rearranging my old computer collection and I decided to repair some of them because now I have more money and more knowledge. And I have spare CPLD boards from Russian Igrosoft computers. So, one day I decided to build some test rig and build my own CIA/PIA in CPLD (it is 5V TTL compatible).
Here is the CPLD CIA/PIA workplace:
This computer has both 6526 dead. Left CIA is only partially emulated- so I used a smaller CHIP. Meanwhile the right one is more complex. This is not only timers, int, but also keyboard interface.
I wrote everything using Altera- Intel Quartus software. It is free for MAX series CPLD. I started a project in the 9th version of software, but encountered strange bugs and also, my hardware description did not fit the chip. Meanwhile, the newer version was fine.
I am using a special self made PCB with precision sockets and pins. All connections to CPLD boards are made using wire wrap technology. I think it is best technology to connect hundreds of wires in not permanent way. I can redo the connection in case I mix something.
This is a smaller CPLD. Only timer and fontbase selector is “build” inside it.
From black screen I have a working keyboard (cursor is OK, just in photo is not visible), timers and interrupts.
But… I found a trash completed PCB of Commodore 128 with a working CIA on board. So I abandoned this project for a while. Maybe in near future, maybe never.
Source code in Verilog hardware description language is available on demand.