CoCoVGA SAM Accelerator

Some time ago, while thinking about the CoCoVGA display system, it occurred to me that when a system is equipped with the CoCoVGA, it’s no longer necessarily tied to the NTSC carrier frequency.

This opens up possibilities for easily overclocking the system.  At the heart of the CoCo1/2 design is the SAM, or Synchronous Address Multiplexer.  This integrated circuit performs DRAM access and refresh, provides for interleaved memory access between the VDG and CPU, and supplies the system clocks (Q, E, and VDG clock), tying the whole system together.

IMG_20190403_193011A SAM chip

Normally the SAM would derive it’s master clock from a crystal circuit using a frequency of 14.31818MHz.  This is divided by 16 for the CPU clocks and by 4 for the VDG clock.  By utilizing SAM speed registers, the CPU clocks can be doubled (master divided by 8), but in this condition DRAM is no longer refreshed and VDG access to memory is disabled.

IMG_20190320_203910Prototype SAM accelerator

The SAM must run at it’s base frequency in order to provide these essential functions, so my approach is to overclock the SAM itself in order to achieve stable double-speed operation (1.79MHz CPU).  To achieve the desired clock, the SAM is driven directly by the other circuitry on the accelerator board with a clock rate of 28.63636MHz.

The programmable logic on the board intercepts writes to the SAM speed control registers, preventing them from reaching the SAM, and instead varies the master clock.  This allows for easy switching from standard single-speed operation to double-speed.

Because the SAM always thinks it’s at single speed, DRAM and interleaved VDG memory access are handled normally, but at twice the rate.  This does require 150ns or faster DRAMs, and possibly 2MHz rated PIAs (similar to the CoCo3).

This is an easy upgrade for CoCoVGA equipped machines, but will require updated CoCoVGA firmware and the aforementioned chip ratings.  Completely compatible in single speed, there is only one minor difference at double-speed that may be unexpected.  Because the entire system is overclocked by 100%, the VDG interrupts will fire twice as fast as well.  VSYNC is at 120Hz in double-speed mode with this board, and HSYNC is doubled as well.

IMG_20190402_092749Stable memory with RC delays on DRAM strobes (over 1.5 billion verified writes)

This shouldn’t pose a problem to the programmer, as it’s exceedingly easy to skip every other IRQ if you really want a lower rate or otherwise adjust the code to use the appropriate timing.  At this date, the only stable double-speed CoCo1/2 machines will be using this 120Hz system.

Most things will work just fine, but at 2x.  Things using the interrupts for timing might need adjustment to run at the higher rate.  At any rate, the double-speed poke was essentially useless on the CoCo1/2 due to the lack of DRAM refresh.  With one of these accelerator boards, it’s stable and useable.

In the following video, you can see the CoCo running a short BASIC program, switching between .89MHz and 1.79MHz printing characters on the 32 column screen.  The speed difference is apparent, and the transition from one mode to the other seamless!

Switching between speeds

Running the system at 1.79MHz does require DRAMs with a 150ns speed rating or faster, but many CoCos that have been upgraded in the past may already meet this requirement.  I’m not certain yet whether or not the PIAs require upgrading to 2MHz rated parts as found in the CoCo3 (presumably for double-speed use), but those parts are readily available if needed.  Just for fun, I popped a SAM board into a CoCo1 ‘F’ board I had open while programming CoCoVGA boards for shipment.  It ran just fine, and though I didn’t test it extensively, it flawlessly did over 40 passes of the memory test I wrote before I shut it down (~8 million verified writes).

SAM board in a CoCo1

At the time of this writing, I’m about to receive REV02 boards, which include reliability patches I had to make to the initial prototype.  I intend to release these as an optional item for CoCoVGA users that want more performance out of their system.  And thanks to improvements to the CoCoVGA logic by Brendan Donahe, they’ll also enjoy the crisp video output on their monitor, even at 1.79MHz!

REV02 CoCoVGA SAM board design


…more to come…


1 thought on “CoCoVGA SAM Accelerator”

Leave a Reply