André's 8-bit pages
Thankfully hosted by 6502.org.
(by Google)

Commodore PET 65816 CPU card

This a PET 65816 CPU card! It speeds up your PET to up to 10MHz. In fact it's a 6502 replacement card and could be used in other 6502-based computers as well. The board uses a 65816 CPU that runs at up to 10MHz, plus a Xilinx CPLD as logic glue. It includes up to 1MByte fast RAM (run at CPU speed) plus up to 512k parallel Flash ROM (in-system programmable), that can be used as boot ROM.

8296 benchmark screen
The board prototype installed in a Commodore 8296 - running a benchmark at 10 MHz!

The interface itself is, in fact, pretty simple. It is a board that is plugged in the 6502 CPU socket of the PET. On the board there is the CPU, the CPLD logic, the new clock generator (50MHz), some few support parts, as well as two 512k static RAM and one 512k Flash RAM chip. The board is all-through-hole - i.e. no SMD parts! I call that a feature in these days.

The prototype has been tested with my CS/A65 computer, in the MMU board - which is easier to handle when you have to change things often. But it also now runs in the CBM8296. Tests with other PETs will follow.

Here's a small demo (note: don't judge the absolute speed of the demo - only the difference between 1 and 10 MHz. I just didn't have enough time to really do the optimization...

After some optimization described in this blog entry I managed to get it faster by a factor of two (only with optimization of BASIC code):


Please also look at these pages:

  •  
    2013-10-13 Added video link
  •  
    2010-09-05 Added info and pet debug code for PET 4032
  •  
    2010-08-28 New 1.2B version of the board, with board layout, and updated VHDL code. Also added features, Hardware, Gallery and how it works page.
  •  
    2010-08-14 New version of the board, now with board layout, and updated VHDL code. Explanations still to come though.
  •  
    2010-04-20 Published the board.

PET 4032 test machine

I tried to repair a PET 4032 machine, that seems to have a memory problem. So I put in the 65816 board, with some boot code in the ROM, to run the PET in the 65816 board only. The result can be seen in the gallery, the PET runs at 10 MHz.

The boot code consists of the original 4032 (non-CRTC) ROMs plus some init code that copies the ROM contents from the board's ROM (i.e. not from the PET's original ROMs, that could be broken!) to fast RAM, and runs the system completely from the fast RAM. Only I/O is used and I was lucky that this works on my 4032, so I can use - and debug - the machine even with programs from the disk drive.

The code in the file below builds a PDEBUG PET binary, that when run, programs the boot ROM of the 65816 board. It assumes a 128k Atmel Flash PROM for the write algorithm, as does the progrom programs below.

 
petdebug.tar.gz(PET 4032 test ROM)

Testsuite

Here are some small tests that test the various features of the board.

Note that building them requires the xa cross assembler, using the -w switch to enable 65816 code, as well as petcat from the VICE emulator package to build the BASIC parts.

Here is a description of the different tests (by subdirectory):

  • benchmark - builds the BENCH benchmark program used to check the speed of the various settings. Builds from the BENCH.basic BASIC source as well as benchcode.a65 and eichcode.a65 assembler sources.
  • eichtest - builds the burn-in test that, at its start, shows how fast the system actually works (uses screen interrupts to determine system speed, so works on my 2 MHz PET replica as well. Builds the LOOP Commodore PET BASIC executable from LOOP5.basic and eichcode.a65.
  • maptest - some mapping tests. COPY copies 4k data from the system memory mirror at $e0xxxx to bank 0. GOFAST copies the system from slow memory over to the fast RAM mirror, and switches to it. MAPTEST compares the slow memory with the system memory mirror at $e0xxxx.
  • modes - builds the GOFAST and GOSLOW programs that move execution to either fast RAM or back into slow memory. GOFAST is updated compared to the maptest version though.
  • progrom - programs the ROM to run a "GOFAST" functionality directly on reset, as a boot rom. If you program your on-board ROM with this PGOFAST code, and set the bootrom jumper, the system will automatically boot into fast mode.(Edit: the programming algorithm in proglib.a65 has problems with larger blocks - better use the proglib.a65 code from petdebug.tar.gz above)
 
x816tests-1.0.tgz(Feature test suite)

VHDL code

This is the VHDL code for the board. It is packaged as the XILINX ISE Webpack (v11.1) directory. Included in this directory is a "testbench" directory with some simulation test runs. Requires Linux with ghdl and GTKWave installed, then look into the Makefile.

Version 1.7.1 just has an updated testsuite.

 
PET816_1.7.1.tar.bz2(Archive of the XILINX ISE Webpack CPLD logic - includes VHDL source, JED binary file, as well as a testbench. )
 
PET816_1.7.tar.bz2(Archive of the XILINX ISE Webpack CPLD logic - includes VHDL source, JED binary file, as well as a testbench. )
 
PET816_1.5.tar.bz2(Archive of the XILINX ISE Webpack CPLD logic - includes VHDL source, JED binary file, as well as a testbench. )
 
PET816_1.0.tar.bz2(Archive of the XILINX ISE Webpack CPLD logic - includes VHDL source, JED binary file, as well as a testbench. )
 
imgs/gtkwave.png(Sample screenshot of the timing simulation in the testbench)

Version: 1.2b

Status: ok

Notes

 
This board is an update on the 1.2A, and only contains a few small changes: Two delay loops that can be used in the VHDL code have been added. Also an "official" diagnostics pin has been added too, to get easy access to a signal "exported" from the CPLD.

Version: 1.2a

Status: prototype

Notes

 
This board has been only barely tested

Version: 1.0b

Status: prototype

Notes

 
This board has been only barely tested
 

Disclaimer

All Copyrights are acknowledged. The information here is provided under the terms of the GNU Public License version 2 unless noted otherwise.

Last modified: 2010-08-29.

Return to Homepage

follow

Follow my 8-bit tweets on Mastodon (In new window) or Bluesky

discuss

Discuss my site on this 6502.org forum thread

Discuss this page's content on this 6502.org forum thread

(Forum registration required to post)

hot!

Dive into the retro feeling and build yourself a Micro-PET or a Multi-board Commodore 4032 replica

Need more speed? Speed up your 6502 computer with this 10 MHz 6502 CPU accelerator board

Interested in electronics design? Look at the design lesson I got from Bil Herd, the hardware designer of the C128

Want 64bit? - pimp the 6502 with the 65k processor design!