Pokey Control: Better, Faster, Stronger

The Pokey.synth module uses a microprocessor to control the Pokey. It works well, but it is a little slow. In this case, slow means that register writes happen around 100,000 times per second. That means all the sample rates preceding it can’t total more than 100 kHz. Since there are two channels of pitch control, two channels of volume control, and one bit crusher, each ends up with a pretty low sample rate.

The two limiting factors are the speed of the microprocessor and the interface between the micro and Pokey. The Pokey clocks address and data bits on specific edges of its clock, so writes have to either be done slowly or carefully. The instructions in a PIC run at 1/4th the chip’s clock speed, so even a 60 MHz clock can only toggle pins at a rate of 15 MHz. Factoring in everything else the processor needs to do, there isn’t a whole lot left for careful data transfers. The process becomes throwing data onto a bus in the cheapest way that sticks.

Clocking a Pokey at ┬áits standard 1.79 MHz theoretically means it can handle 1,790,000 register writes per second. I had never heard of anyone actually testing that, so I made a project of it in hopes of getting much better FM control. Instead of controlling a Pokey from a microprocessor, I’m now using an FPGA. The nice thing about FPGAs is that they are essentially customizable hardware. I wrote an interface for the Pokey that can transfer data on literally every clock cycle… 1.79 Megabytes of data per second.

The test sequence is a pulse wave pattern done using a single channel’s D/A directly. It writes alternating values of 0 and 15 to the channel. The resulting wave looks like this:

Peaks and Valleys

Shark Conga Line

That wave is switching at a full 1.79 MHz. The data is actually switching so fast that the hardware cannot track it well. At audio frequencies the pulse wave looks perfect, but up here parasitic effects slew the square edges into exponential curves. The extra long pulse at the end is because the pattern isn’t exactly 10101010101010… it was simpler to double a data value every few cycles.

I would post an audio clip, but not even your pet bat would be able to hear it.

2 Responses to “Pokey Control: Better, Faster, Stronger”

  1. Matthew says:

    Stop telling my pet bat what it can and can’t do!