Main Site Documentation

SID-Shield


#1

So there I was wondering what is something cool I could do with my shiny new panda.

I came up with the idea for a shield to interface two 6581 or 8580 Sound Interface Device chips from a Commodore 64/128 computer. (The ultimate in computer sound chips!!)

I have set myself the following goals, an SPI interface to the FEZ, twin sid chips for stereo output, onboard amplifier chip, dual onboard regulators for the 12v/9v supply to the sid chips so you can mix and match 6581 and 8580 chips, a pic micro with embedded firmware to generate the 1MHz bus clock and provide the 8bit bus without swamping the host processor’s io or resources. And all within the standard shield footprint.


#2

Ah, the C64, my old friend. I learned 6502 assembly on the C64, wrote my own assembler and dissasembler for it too (based on Jim Butterfields books). The coolest thing I ever made for it was a 1 mB memory expansion that was bank switched. You could have like eight separate programs loaded at once and switch between them with the function keys. Those were the good old days, when I had nothing else to do but bang on a keyboard. Now all this pesky work gets in the way.

As I recall, the SID actually has two channels per chip so you have stereo right off the bat. I could be wrong about this as it has been years since I messed with one. I just vaguely remember about programming the ADSR settings and such.


#3

I learned to program on the C64 when I was 5, and the machine has left me with many fond memories.

The SID has 3 hardware channels, you can use the oscillator of the 3rd channel as a ring modulator for either of the other two channels. The demo writers over the years took advantage of a hardware bug in the 6581 that gave a click in the output when you changed the master volume register and using this added a software 4th channel that was able to do 4bit PCM, the chip was never designed for PCM but that is how it was able to do speech and digital sample playback.

The noise oscillator is also able to be read back and was used as a simple RNG that to this day still stands up as a good source of random bits. The algorithm used is widely available on the net.

All 3 channels come out a single audio output so to do stereo 2 chips are needed and the C128 had 2 chips in it. That is why my shield will have 2 chips.

The fun thing will be cramming a pic, and 2x 28pin wide dip ics, and all the other parts on a board the size of panda.


#4

Now I’m dreaming of a C64 emulator running on a FEZ! A 72 MHZ FEZ emulating a 1 mHz C64? It might be possible,


#5

Jeff my father and I designed one of the first bank switchers that worked on dip switches at the time for the commodore. So we could run a bbs and play lode runner at while we waited for calls. That was before someone figured out how to switch with the function keys. He owned a repair shop for them in the early 80’s I still have a working commodore 64. Scary sometimes i power it on just to see the READY and the white blinking block.


#6

My stepmom recently sent me one of the coolest things from my dad’s estate - the original TRS-80 on which I started programming when I was 11. It’s been sitting in the shipping box - this makes me want to pull it out and plug it in. :slight_smile:


#7

So I started designing the shield, the 2 SID chips take up about 2/3 of the available shield space (who’s bright idea was it for the PCB to be this small anyway!)

I chose a PIC18F4550 as the onboard micro to interface with the SID chips because it has an entire 8-bit port that isn’t shared with any other functions. The USB port is also a bit of a bonus because I can flash in a USB bootloader for firmware upgrades. And I happen to have some in my parts box :smiley:

I am using a couple of LM1117 regulators in a SOT-223 package to power the SIDs (the 12v and later chip version 9v requirements was due to the very inefficient H-MOS/N-MOS design used in the mostly analog chip)

I am also putting in sockets for the SID filter capacitors. The filters vary wildly between chips even from the same batch, so being able to swap out the capacitors to find a closer match or to use the original C64 capacitors is a bonus.

I am still in the process of finding an inexpensive, small footprint, surface mount amplifier chip.


#8

So after a few days of trying to fit all the components to run 2 sid chips on an arduino shield, I am going to cut it back to a single sid chip, but with a header to add a second (or seventh!!! :o) sid as an add-on card.

Each sid has a 5bit address bus, so if I allocate a second 8bit port as an address bus, I can use some 74HC logic to use the upper 3 bits as chip selects for 8 sids.

Now that I think about it, the music guys might love a shield capable of up to 24 channels of old school synth which can be expanded easily. There is also no reason you couldn’t address other parallel chips off the bus too.


#9

I think a propeller will give you better results and expansion. You can even add video if you want
Search YouTube for examples


#10

Has anyone done a propeller shield?


#11

I only saw one made by someone in Germany and was near impossible to order anywhere!

I tried to find at again but with no luck!


#12

Do you mean using a Propeller as the sound synth generator, or as bus control?

The whole point of the exercise is to put some of my SID chip collection to use. And the SID even gets some use in main-stream commercial music by the likes of (but not limited to) Timberland, KMFDM and Trent Reznor. A good example of the SID sound is in the 50 Cent track “Ayo Technology” (http://www.youtube.com/watch?v=L_it-q_aJZw) Another example is the melody for Nelly Furtado’s “Do It”, there was some controversy over that one since it was stolen from a C64 tune called “Acid Jazzed Evening”

But back to the project, throwing some firmware on the FEZ to act as a MIDI device with 8 SID chips as voices, you could compose some pretty awesome music.


#13

I didn’t know you already had the chips. So you need a pic micro? Why not use fez directly


#14

The SID is an old style memory-mapped parallel interface chip operating at a clock rate of 1MHz. On a Commodore 64 the SID was accessed through peeking and poking memory addresses.

Trying to fit 8x Data, 5x Address, RES, CS, CLK and RW signals directly into a fez via the standard arduino shield connectors is a bit of a problem. Having a PIC micro operating as a bus master communicating with a FEZ at high speed through SPI gives all the benefits of an 8bit bus at 1MHz without the downsides of not enough IO pins, and parallel IO bit-banged in interpreted code.

The SID chips themselves are slowly increasing in price as time goes by (due to the now decreasing number of chips left), they have been out of production since about 1993-4 and the only source of chips are old commodore computers. You can pick them up online for between about US$20 and US$40 per chip, depending on chip version and quality.


#15

$20 to $40…now I really want to go with $5 propeller chip :slight_smile:
I understand what you need but I was thinking for my own project if I ever were to do something similar.


#16

Yeah, the price of the chip is getting pretty crazy. My trick is to buy old C64 computers for chump-change off people who want to get rid of them.