Ok the Atmel/Microchip ATF1504AS has been programmed and the card works! The smoothness of movement over a native serial mouse in win 3.11 is immediately noticeable!
I will be covering the BOM changes and programming procedure for substituting the ATF1504AS for the out of production EPM3064 in this thread. The ATF1504AS is a native 5V CPLD which is still in active production and available at mouser and digikey!
https://www.digikey.com/en/products/detail/mi … -10AU44/1008359
https://www.mouser.com/ProductDetail/Microchi … dQ1qD2Ymw%3D%3D
Because this is a native 5V CPLD, the voltage regulator in the original design (DA1) must be omitted and 5V must be connected to the Vcc of the chip. There are two easy ways to do this - first (and my) choice is to bridge the input and output pads of the footprint for DA1 with a piece of wire or component leg. Second choice is to use a bodge wire on the back of the PCB connecting the + pads of C1 to C2. C2 may be omitted since only one bulk decoupling cap is needed on this rail, as opposed to an input and output one on either side of the regulator. Additionally R1 and R2 must be omitted since the ATF1504AS has optional internal pullups on TMS and TDI, which I have enabled in the converted firmware. Optionally I also recommend omitting R4, as a pullup on TDO is not necessary IMO and not recommended in design guidelines for this CPLD. R3, the pulldown for TCK, is still recommended to be installed, but I used a value of 2K instead of the original 1K in the BOM. Either one would probably be fine. If you really want to be a cheap ass like me, you can also skip the LED (VD1) and its associated current limiting resistor (R5). According to Roman, "The LED is for diagnostic purposes only. It shows that the connection to the mouse is established and that the device is exchanging data with the computer."
So to summarize the required changes from Rio444's BOM:
DA1, C2, R1, R2, R4, RN1 are all DNP
Connect + pads of C1 and C2 with a wire
DQ1 is ATF1504AS
XS1 is DNP depending on your programming technique - more on this later
Now to the programming. I will not be covering the conversion process to convert the EPM3064 firmware to the ATF1504AS firmware, however Rio444 has granted me permission to distribute the converted files to any vogons member who requests it in DM. There are two files - a .JED file which is used with Atmel's own ISP utility and a .SVF file which is used with OpenOCD. I will only be covering the procedure for using OpenOCD on Windows with an Adafruit FT232H as the programmer. This is available here: http://adafru.it/2264 You can either solder pin headers to the FT232H and the XS1 footprint on the card, or just use male to male dupont pins as I did.
The first step is to connect the wires from the FT232H to the programming header on the card. Use Rio's image to connect:
CARD : FT232H
TCK: D0
TDI: D1
TDO: D2
TMS: D3
5V: 5V
Gnd: Gnd
Do not connect the pad labeled "Vcc" on the card to anything - it is not needed!
Next hurdle here is to get proper drivers for the FT232H installed which work with libusb-1.0 Windows. I will only be covering this for Windows 10/11, different OS you're on your own sorry. The default drivers windows will install for the interface are the FTDI drivers which do not work. I recommend a utility called Zadig https://zadig.akeo.ie/ to solve this problem. Connect the FT232H to your PC and download and run Zadig. Select Options -> List All Devices. Then select "USB Serial Converter" from the list. Hit the "Replace Driver" button to replace the FTDI driver with WinUSB. This process takes way longer than you'd think, be patient. This driver will only last as long as you have the device plugged in, so don't disconnect until we're done! If you do replug the device you must run Zadig again!
Next download and run OpenOCD from the file attached to this post. This includes the correct USB library for Windows as well as a config file for the FT232H. Credit to unprovable on Github for the config file. https://github.com/unprovable/FTDI-Oh-My/blob … 32H-openOCD.cfg
DM me for the SVF file and drop it in the same folder as OpenOCD. Then open up a command prompt in the OpenOCD folder and run 'openocd' no switches. OpenOCD should print that is has detected the Atmel device and then stay resident. At this point you must use a telnet client to connect to it. Connect to localhost:4444 and you should get a prompt from OpenOCD. Type 'svf sample.svf' (no quotes)
The svf is a script and will run through a ton of JTAG commands in front of you, it will pause for a moment a couple times, and then when finished it should print that the operation is complete with no errors. If you got this far congrats, you're done. The script both programs and verifies the CPLD. Then type 'shutdown' (again no quotes) to close OpenOCD. Now you can disconnect the FT232H and programming header. Enjoy!