Programmable auto filter interface for C64 using Arduino

Programmable auto filter interface for C64

Overview
A software / hardware combo that allows for control of the analog filter inside a Commodore 64 that is running Cynthcart from a host computer (eg, Macbok, PC).

Software
• 16-step filter sequencer
• Set the speed of the filter sequence (with intervals between values reaching 2ms)
• Set the length of the sequence from 1 to 16 beats
• Offset value allows for shifting the filter values up or down on a larger scale
• MIDI mode allows sending data directly to control the filter (this mode disables the sequencer)Programmable auto filter interface for C64

Download the Max/MSP patch here:
http://milkcrate.com.au/_other/downloads/max_patches/C64_FILTER.zip

It requires Max/MSP runtime which can be downloaded from http://www.cycling74.com/.

Interface
The hardware is very simple, and is based around an Arduino board that is using a bit-banging SPI technique to write data to a 100KΩ digital pot (model MCP42100). Approximately 7 of the 8 bits of data actually change the value of the filter (this could be due to the resistance value of the pot).

Any microcontroller that can either do SPI natively or through bit-banging should be able to handle this simple operation.

Notes:
• J1 1 to 14 refers to Arduino digital pins 0 to 13
• The datasheet for the MCP42100 recommends a 0.1uF or similar capacitor to smooth out the power supply. However, this has not been an issue.Programmable auto filter interface for C64

Arduino Code

/* INITIALISATION */

int SS1 = 2; // set slave select 1 pin

 

int CLK = 3; // set clock pin

 

int MOUT = 4; // set master out, slave in pin

 

byte cmd_byte0 = B00010001; // command byte to write to pot 0, from the MCP42XXX datasheet

 

byte cmd_byte1 = B00010010; // command byte to write to pot 1, from the MCP42XXX datasheet

 

byte cmd_byte2 = B00010011; // command byte to write to pots 0 and 1, from the MCP42XXX datasheet

 

byte work; // setup a working byte, used to bit shift the data out

byte data;

 

/* SETUP */

 

void setup() { // setup function begins here

Serial.begin(57600);

 

pinMode(SS1, OUTPUT); // set CS pin to output

 

pinMode(CLK, OUTPUT); // set SCK pin to output

 

pinMode(MOUT, OUTPUT); // set MOSI pin to output

 

digitalWrite(SS1, HIGH); // hold slave select 1 pin high, so that chip is not selected to begin with

 

}

 

void spi_transfer(byte working) {

 

; // function to actually bit shift the data byte out

 

for(int i = 1; i <= 8; i++) { // setup a loop of 8 iterations, one for each bit

 

if (working > 127) { // test the most significant bit

 

digitalWrite (MOUT,HIGH); // if it is a 1 (ie. B1XXXXXXX), set the master out pin high

 

}

Read more: Programmable auto filter interface for C64 using Arduino

Leave a Comment

Your email address will not be published. Required fields are marked *