Close
0%
0%

Speak&SID CPC

A Speech Synthesizer, SID Soundcard, and MIDI IN Realtime SID+AY Synthesizer for the Amstrad CPC!

Similar projects worth following
Speak&SID CPC is a low cost SpeakJet-based speech synthesizer for the Amstrad CPC, a SID soundcard, and a multi purpose IO expansion featuring a Serial Interface (UART), 4 GPIOs, I2C, and SPI. It is also a MIDI IN Realtime SID+AY Synthesizer for the CPC. It emulates the Amstrad SSA-1 speech synthesizer. A SID Player exists. For the SID, the Speak&SID can utilize the original 6581 (requires external 12 V), the 8580 (requires external 9 V), as well as SwinSID and ARMSID (which do not require the extra PSU, but will be powered by the CPC with the rest of the board instead). The firmware is open source on Github.

Second SID Player Demo - Line Out Recording and LED "Lightshow":


First PCB Version & SID Player Demo:


CPC MIDI IN SID + AY Synthesizer - with a MIDI breakout board it turns the CPC into a powerful SID+AY MIDI IN Synthesizer: 



Breadboard Prototype - First SID BASIC Test:


Breadboard Prototype - Amstrad SSA-1 Emulation Test:



A Speech Synthesizer,  SID Soundcard, and MIDI IN SID+AY Synthesizer for the Amstrad CPC

Speak&SID plugs into the expansion port of the CPC, and is a M4-compatible expansion card. A cable or a CPC expansion board backplane (such as the Mother4X or the LambdaBoard) is recommended, and in fact required in case more than one expansion card is being used. Else, a simple 50pin IDC ribbon cable will do as well.

This CPC expansion board offers:

  1. A SpeakJet-based speech synthesizer, featuring a native SpeakJet-based mode as well as a SpeakJet-based emulation of the classic Amstrad SSA-1 speech synthesizer from 1985.
  2. A sound synthesizer utilizing the fabolous SID (Commodore 64) soundchip. Speak&SID CPC can use the original 6581, the 8580, as well as modern re-implementations of the SID chip such as SwinSID or ARMSID. To use the 6581, supply 12 V with positive center polarity over the Speak&SID power barrel jack using a stabilized low noise (preferably linear) DC power supply; for the 8580, 9 V are required. No extra PSU is needed for SwinSID or ARMSID.
  3. A general purpose multi-IO expansion, featuring a Serial Interface (UART), a SPI Interface, an I2C Interface, as well as 4 digitial general purpose input/output ports (GPIOs). The 4 rightmost LEDs of the LED Segment Bar shows the status of the 4 GPIO outputs. Notice that Speak&SID supplies pin headers for GPIO, UART, SPI, and I2C.
  4. A MIDI IN realtime SID+AY synthesizer. With a 10 $ MIDI breakout board connected to the UART pin headers, and the CPC running a machine code program, Speak&SID turns the CPC into a powerful and versatile SID and AY MIDI IN synthesizer.  

Firmware updates to the CPLD can be acomplished "in system" by using the JTAG header; the ATMega microcontroller can be updated with a ISP USB programmer such as USBtinyISP connecting to the SPI headers via Dupont cables.

Some Pictures

PCB 2 Front PCB 1 Front Breadboard 1 Breadboard 2 PCB

Some YouTube Videos

License

GPL 3

Speak&SID Hardware Overview

The main components are:

  • Microcontroller: ATMega 8535 @ 16 MHz. Role: Brain of Speak&SID. Controls the SpeakSet, UART, SPI, I2C, GPIO, and implements the Amstrad SSA-1 emulation.
  • CPLD: Xilinx 9536. Role: Address decoding, SID control and 1 MHz clock, glue logic functions.
  • Speech chip: SpeakJet. Role: speech synthesis and sound synthesizer.
  • Sound chip: SID 6581 or 8580, SwinSID, or ARMSID, or..... Role: sound chip for awesome SID tunes!

The source code for the CPLD and the ATMega are provided here, and HEX / JED firmware files as well.

CPC Speak&SID has two reset buttons: one for resetting the Speak&SID, and one for resetting the CPC.

CPC Speak&SID has two trimmers / potentiometers; the left potentiometer controls the volume / signal level of the SpeakJet chip, the other one controls the SID volume level. The signal stereo routing is determined by the 10 DIP switches, see below.

The sound comes out of the audio stereo jack. The left/right channel can be assigned individually (SpeakJet / SID). Also, a DIP switch determines whether the determined left or right channel audio is fed back into the CPC to be heard in the CPC's internal speaker.

The optional power barrel jack need center polarity, and either 12 V (SID 6581) or 9 V (SID 8580).

The LED Segment Bar visualizes the status / state of Speak&SID, see below.

Note that both the SpeakJet as well as the SID are mono audio output devices, but the can...

Read more »

SIDPLAY.DSK

CPC SIDPLAYER for Speak&SID

dsk - 190.25 kB - 11/21/2019 at 15:20

Download

SPEAKSID.dsk

CPC Demo DSK Image

dsk - 190.25 kB - 11/21/2019 at 15:19

Download

speakandsid.ucf

Xilinx CPLD Constraints Firmware Source File

ucf - 1.22 kB - 11/21/2019 at 15:19

Download

speakandsid.v

Xilinx CPLD Verilog Firmware Source

v - 2.37 kB - 11/21/2019 at 15:19

Download

speaksid.c

ATMega Firmware Source

C Source File - 19.23 kB - 11/21/2019 at 15:18

Download

View all 10 files

  • 1 × SpeakJet
  • 1 × ATMega 8535
  • 1 × Angled 50 PIN 2x25 IDC Connector
  • 2 × Momentary On Push Buttons
  • 1 × Power Jack Barrel Connector

View all 13 components

  • MIDI IN CPC SID + AY Synthesizer - First Version

    Michael Wessel12/05/2019 at 15:19 0 comments

    Here is a first cut at the MIDI IN CPC SID + AY synthesizer - the SID and AY soundchip are slightly detuned from each other, for a strange reason I have not figured out yet. Maybe an ARMSID artifiact? Will try with my real 6581. Also, SID play is currenlty only 1 channel, whereas the MIDI synth uses AY 3-8912 all 3 channels. Stay tuned! Next I will add filter cutoff and resonance for the SID via CPC keyboard keys or MIDI controls. Apologies for poor keyboard playing, I play the guitar usually.

  • Whenever you think the project is done - you get a new idea...

    Michael Wessel12/03/2019 at 17:19 0 comments

    Was just thinking - why not take advantage of the UART / Serial Port and try to turn this into a real time SID Synthesizer for the CPC? There are inexpensive UART MIDI breakout boards available 

    https://www.amazon.com/ubld-it-MIDI-Breakout-Board/dp/B00YDLVLVO/ref=sr_1_1?keywords=midi+breakout+header&qid=1575390754&sr=8-1

    I have used that board before for LambdaSpeak 3 and MIDI IN. 

    Now, what the Speak&SID hardware and firmware needs to support in order to make this happen is the following: 

    • read incoming MIDI data from the AVR UART and buffer it in a ring buffer - and that is already implemented in Speak&SID, as well as a generic serial API that allows the CPC to retrieve the UART buffer content byte by byte, using a read cursor. This interface uses CPC / Z80 IO address  /  port &FBEE. The CPC data bus is latched and "buffered" by the CPLD, in both directions (for  IOREQ writes: CPC -> CPLD -> AVR, and IOREQ reads: AVR -> CPLD -> CPC). 
    • turn on the SID chip - the Speak&SID is turned on with a "SID ON" signal that is being generated by the AVR / ATMega. When that signal is given, the CPLD also decodes the address range &FAC0 - &FADC and routes all CPC / Z80 IO read/write requests in that range directly to the SID chip data lines; also passing the 5 lower bits of the IO address to the SID's address pins. The CPLD uses the "SID ON" and IOREQ and RD / WR signals in order to generate the SID's Chip Select Signal (~CS).  
    • on the CPC side, the CPC needs to monitor the serial buffer and retrieve the incoming MIDI messages from the buffer, using the serial interface API at port &FBEE, then parse and process the MIDI messages, and translate them into corresponding SID register writes to make the sound heard. Since the SID is turned on when the "SID ON" signal is given, and each read / write within the  &FAC0 - &FADC IO address range goes directly to the SID, the CPC can just write these SID registers directly. 
    • at first I was thinking that there might be Z80 / CPC databus contention since both the ATMega and the SID needs to be connected to the data bus, but then I realized that this is actually not the case, since the address ranges are disjoint and the data bus is immediately released after the IOREQuest, and the requests for SID and CPLD / AVR are sequential in nature. So I don't even need to turn off the "SID ON" signal for reading the data from the UART buffer, since the SID only claims the data bus via ~CS when "SID ON" AND IOREQ RD / WR AND the the port address is in the &FAC0 - &FADC range, and &FBEE for the serial interface is different.       
    • moreover, given that the CPC has to run a program that reads the MIDI messages from the buffer, and processes and translates them into corresponding SID register writes, that program can also feed the CPC's internal AY 3-8192 sound chip to play MIDI notes as well, hence resulting in a SID + AY real time synthesizer, with 6 channels in total. Obviously, methods of addressing SID and/or AY independently can also be implemented (e.g., using different MIDI channels).  

    So, it seems that the hardware and firmware of Speak&SID already supports almost everything that is required for this! Only a tiny change to the AVR firmware is required (I need to ensure that the SID chip is not turned off while the serial buffer is being read).   

    This hence mainly requires CPC software...I alread have a piece of CPC ASM Software that turn the CPC into an AY MIDI real time synthesizer (written for LambdaSpeak 3), and it should not be difficult to use that for the Speak&SID SID MIDI IN Synthesizer.   More soon!

  • PCB Revision 2 Arrived and Tested!

    Michael Wessel12/02/2019 at 03:25 0 comments

    It was bugging me that the previous PCB revision had the SID chip upside down. So I bit the bullet and rearranged the layout a bit. The new PCBs worked out of the box. I also added GND copper fill to the PCB bottom (not sure it makes a difference, but seems to be good PCB design practice). Saifisfied with the PCB now, and declaring the hardware side of this project as done.


  • Firmware source code on GitHub.

    Michael Wessel11/11/2019 at 05:34 0 comments

    Source code is online now. Still need to write the documentation. Stay tuned!

View all 4 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates