Atmega8 MOS6581 SID Emulator

(disuss it in the forum)

This program tries to emulate the sound chip SID of the famous historical C64 Commodore computer (SID = Sound Interface Device). The SID emulator includes all registers of the original SID, only minor functions are not implemented yet.

If you want to program the SID registers to generate your own sound, please refer to the MOS6581 datasheet. The emulator tries to be as compatible as possible.

Minimalistic circuit of the SID Emulator V1.0

The PWM-Output is directly connected to the wire of the PC speakes.

sound example ( mp3, ~700kB )

Functions implemented:


- 3 waveform generators

- 3 envelope generators with attack,decay, sustain, release

- waverforms: triangle, rectangle with variable pulse width, sawtooth, noise with variable frequency

- ring modulation

program file download ( V1.0 ) ( stand alone version )

serial controlled version ( e.g. by arduino )



Some websites stated that some documentation is missing to understand the AtmegaSID. In my opinion the provided information is complete. To unterstand the AtmegaSid you need the following:

If you want to learn more about how the AtmegaSID is implemented you should read the principle of DDS sound generation principle.

Another good starting point is the web site of ( in my humble opinion the worlds best hobby electronicist ) ELM CHAN.

The following sound was produced with an ATMEGA168 which is pin compatible to a ATMEGA8 but has 16KByte Flash instead of 8KByte:

sound example ( mp3, ~280kB )

ATMEGA SID controlled by serial line

It is very usefull to use a ATMEGA SID as separate sound processor for applications where the sound generation is only on part of the task a system has to provide.

Therefore a SID controlled by the serial line ( 9600 Baud 8N1 ) was created.

The protokoll is quite simple: the first byte is the register address of the sid and the second byte is the register value. A error syncronisation is done if the SID-address execeds the maximum allowed address ( 29 ).

Here the code can be found.

The following picture schow a 200 ohm loudspeaker directly connected to the PWM output of an ATMEGA168.

The ATMEGA168 is controlled by a software serial line of a ARDUINO-board.

Arduino and separate SID-controller bottom view

Sound examples of the arduino controlled SID:

frequency shifting noise

shot noise

two voice random frequencies

The SID may be controlled by a LabView program and the serial line of a PC. The source code of the program is included in the code download. You need to installed LabView 6.1. For non commercial applications National instruments has sometimes free downloads.

Here an example from a SID sound on Youtube which theoreticaly could be achieved if you writte the register settings in a timely correct maner.

If you are interested in a discussion about the Atmega8 SID you can do it here.

Probably you want to know more about my newer project, the 5 core modular synthesizer called „chTinySizer“ which can be used as arduino shield.