After working on the MC-10 Supercart, which adds memory and a YM2149 sound chip to the MC10, I thought it would be really cool to do something similar for the 6809 Color Computers.
The YM2149 is a programmable sound chip by Yamaha, based on the General Instruments AY-3-8910. The GI AY-3-8910 and it’s variants, including the YM2149 were used in a variety of early microcomputers and video games, and they are ideally suited for use with 8-bit systems.
There is a large amount of music available that is compatible with these chips that has been composed on several systems which is adaptable for play on a CoCo cart like this. This gives us the possibility of a large library of music to play, as well possibly being of use with tracker style composition software written for the CoCo. Not to mention sound effects for games and other programs.
Along with a YM2149, we’ll need some associated circuitry in the form of a transistor amp output circuit, and an oscillator. To provide some additional resources for the CoCo when using the chip, and to store software for the cart, we’ll also add 512K of FLASH, and 512K of SRAM.
Using chips of this size (512K each) is handy as far as handling memory banking using 8-bit registers, and will provide us quite a bit of storage and RAM on a CoCo for our chiptunes software to use.
Then we just need a CPLD to handle the needed logic to tie it all together and provide the registers. A 5V tolerant XC9572XL in the 64 pin QFP package should do nicely.
Since the YM2149 chip also includes two 8-bit bidirectional I/O ports in addition to the sound control registers, we may as well use them to add a couple of ports. These are wired to make them useable with Atari style joysticks and Sega Genesis game pads. You could also use them for other things of course, they’d just have to be programmed for.
The oscillator chosen to drive the YM2149 is 2MHz, the same frequency that was used in the Atari ST. The *SEL pin on the YM2149 is connected to the CPLD, and the clock rate can be divided by 2 (to 1MHz) under software control if desired.
The 1MB of combined FLASH and SRAM is bankable to two memory locations in 8K banks. The two 8K memory segments are located in cartridge ROM space as follows;
Bank 0, $C000-$DFFF
Bank 1, $E000-$FEFF
Both types of memory may be mapped to any of the two banks using two 8-bit registers in the CPLD.
There is a third 8-bit register (the PSG control register) which has features for enabling writes to the memory chips, driving *SEL lines for reading gamepads, selecting PSG clock frequency, etc…
The YM2149 outputs 3 channels of sound. On this initial version, the three channels are mixed into a single channel and output at the small stereo jack on the board (both channels the same). I believe this is how most early systems handled AY style chips, though I know some would use channels A+B for one and B+C for another output channel for “stereo”.
Other possibilities, such as selectable channel mixing could be supported with the use of analog switches, but for now we’ll keep it simple. A revised version will include output on the cart port’s SND line for playing without external speakers as well.
UPDATE – 10/25/17
It’s been quite some time since I wrote the above about the CoCo PSG at the start of this project.
I went through a few board revisions during development to arrive at the current board (REV 04), which is in it’s final form (I believe) at this point. Several changes have been made, including a new audio output circuit based on an op-amp rather than transistor. Sound is also fed back through the cart port on the CoCo’s sound-in line as well as being available at the external jack.
Other changes include banking the additional memory at two 8K banks instead of the original format.
I built a number of these to distribute to developers and other interested people that might want to work with them and perhaps write some software to take better advantage of them.
Also, John Strong from the CoCo group designed some very nice 3d printed cases for these, making for a nicely finished sound cart.
Here is a video of a chiptune playing on the cart with the signal being displayed on an oscilloscope. 🙂
Audio playing from the PSG, with actual oscilloscope trace
Here is a link to the CoCo PSG Users Manual, with some programming information.