SEARCH
TOOLBOX
LANGUAGES
modified on 26 March 2010 at 17:41 ••• 26,967 views

Commodore SID 6581 Datasheet

From WFFwiki

Jump to: navigation, search

Contents

Introduction

This article is a reproduction of the original Commodore 6581 Sound Interface Device (SID) datasheet. I made this by taking a photocopy of an original document and using OCR to capture the content, then the document was hand-edited, formatted for mediawiki and reassembled here with (cleaned-up and straightened) diagrams and tables.

The reason for this was that most sources on the web are low quality PDFs and, since the documents are graphical copies of the original, they cannot be searched or indexed. The SID chip is a complex device, so I hope anyone developing projects around this device will find this mediawiki format datasheet useful.

Since it was converted mainly by hand (OCR is not terribly accurate!) I would appreciate it if you could notify me of any errors or omissions you find so I can make this as accurate as possible. If you would like to make a copy of this document please note the Creative Commons licence referenced at the bottom of the page.

Concept

The 6581 Sound Interface Device (SID) is a single-chip, 3-voice electronic music synthesizer/sound effects generator compatible with the 65XX and similar microprocessor families. SID provides wide-range, high-resolution control of pitch (frequency), tone color (harmonic content) and dynamics (volume). Specialized control circuitry minimizes software overhead, facilitating use in arcade/home video games and low-cost musical instruments.

Features

  • 3 Tone Oscillators
    • Range: 0-4 kHz
  • 4 Waveforms per Oscillator
    • Triangle
    • Sawtooth
    • Variable Pulse
    • Noise
  • 3 Amplitude Modulators
    • Range: 48 dB
  • 3 Envelope Generators
    • Exponential response
    • Attack Rate: 2mS-8S
    • Decay Rate: 6mS-24S
    • Sustain level: 0-peak volume
    • Release Rate: 6mS-24S
  • Oscillator Synchronization
  • Ring Modulation
  • Programmable Filter
    • Cutoff range: 30 Hz-12 kHz
    • 12 dB/octave Rolloff
    • Low pass, Band pass, High pass, Notch outputs
    • Variable Resonance
  • Master Volume Control
  • 2 A/D POT Interfaces
  • Random Number/Modulation Generator
  • External Audio Input

6581 Pin Configuration

6581 Pin Configuration.PNG

Description

The 6581 consists of three synthesizer “voices” which can be used independently or in conjunction with each other (or external audio sources) to create complex sounds. Each voice consists of a Tone Oscillator/Waveform Generator, an Envelope Generator and an Amplitude Modulator. The Tone Oscillator controls the pitch of the voice over a wide range. The Oscillator produces four waveforms at the selected frequency, with the unique harmonic content of each waveform providing simple control of tone color. The volume dynamics of the oscillator are controlled by the Amplitude Modulator under the direction of the Envelope Generator. When triggered, the Envelope Generator creates an amplitude envelope with programmable rates of increasing and decreasing volume. In addition to the three voices, a programmable Filter is provided for generating complex, dynamic tone colors via subtractive synthesis.

SID allows the microprocessor to read the changing output of the third Oscillator and third Envelope Generator. These outputs can be used as a source of modulation information for creating vibrato, frequency/filter sweeps and similar effects. The third oscillator can also act as a random number generator for games. Two A/D converters are provided for interfacing SID with potentiometers. These can be used for “paddles” in a game environment or as front panel controls in a music synthesizer. SID can process external audio signals, allowing multiple SID chips to be daisy-chained or mixed in complex polyphonic systems.

6581 SID Block Diagram

SID Block Diagram.PNG

SID Control Registers

There are 29 eight-bit registers in SID which control the generation of sound. These registers are either WRITE-only or READ-only and are listed below in Table 1.

SID Registers.PNG

Table 1

SID Register Description

Voice 1

Freq Lo/Freq Hi (Registers 00-01)

Together these registers form a 16-bit number which linearly controls the Frequency of Oscillator 1. The frequency is determined by the following equation:

Fout = (Fn * Fclk/16777216) Hz

Where Fn is the 16-bit number in the Frequency registers and Fclk is the system clock applied to the Ø2 input (pin 6). For a standard 1.0 Mhz clock, the frequency is given by:

Fout = (Fn * 0.0596) Hz

A complete table of values for generating 8 octaves of the equally-tempered musical scale with concert A (440 Hz) tuning is provided in Appendix A. It should be noted that the frequency resolution of SID is sufficient for any tuning scale and allows sweeping from note to note (portamento) with no discernible frequency steps.

PW Lo/PW Hi (Registers 02-03)

Together these registers form a 12-bit number (bits 4-7 of PW Hi are not used) which linearly controls the Pulse Width (duty cycle) of the Pulse waveform on Oscillator 1. The pulse width is determined by the following equation:

PWout = (PWn/40.95) %

Where PWn is the 12-bit number in the Pulse Width registers.

The pulse width resolution allows the width to be smoothly swept with no discernible stepping. Note that the Pulse waveform on Oscillator 1 must be selected in order for the Pulse Width registers to have any audible effect. A value of 0 or 4095 ($FFF) in the Pulse Width registers will produce a constant DC output, while a value of 2048 ($800) will produce a square wave.

Control Register (Register 04)

This register contains eight control bits which select various options on Oscillator 1.

Gate (Bit 0)

The GATE bit controls the Envelope Generator for Voice 1. When this bit is set to a one, the Envelope Generator is Gated (triggered) and the ATTACK/DECAY/SUSTAIN cycle is initiated. When the bit is reset to a zero, the RELEASE cycle begins. The Envelope Generator controls the amplitude of Oscillator 1 appearing at the audio output, therefore, the GATE bit must be set (along with suitable envelope parameters) for the selected output of Oscillator 1 to be audible. A detailed discussion of the Envelope Generator can be found in Appendix B.

Sync (Bit 1)

The SYNC bit, when set to a one, Synchronizes the fundamental frequency of Oscillator 1 with the fundamental frequency of Oscillator 3, producing “Hard Sync” effects. Varying the frequency of Oscillator 1 with respect to Oscillator 3 produces a wide range of complex harmonic structures from Voice 1 at the frequency of Oscillator 3. In order for sync to occur Oscillator 3 must be set to some frequency other than zero but preferably lower than the frequency of Oscillator 1. No other parameters of Voice 3 have any effect on sync.

Ring Mod (Bit 2)

The RING MOD bit, when set to a one, replaces the Triangle waveform output of Oscillator 1 with a “Ring Modulated” combination of Oscillators 1 and 3. Varying the frequency of Oscillator 1 with respect to Oscillator 3 produces a wide range of non-harmonic overtone structures for creating bell or gong sounds and for special effects. In order for ring modulation to be audible, the Triangle waveform of Oscillator 1 must be selected and Oscillator 3 must be set to some frequency other than zero. No other parameters of Voice 3 have any effect on ring modulation.

Test (Bit 3)

The TEST bit, when set to a one, resets and locks Oscillator 1 at zero until the TEST bit is cleared. The Noise waveform output of Oscillator 1 is also reset and the Pulse waveform output is held at a DC level. Normally this bit is used for testing purposes, however, it can be used to synchronize Oscillator 1 to external events, allowing the generation of highly complex waveforms under real-time software control.

Triangle Wave (Bit 4)

When set to a one, the Triangle waveform output of Oscillator 1 is selected. The Triangle waveform is low in harmonics and has a mellow, flute-like quality.

Sawtooth Wave (Bit 5)

When set to a one, the Sawtooth waveform of Oscillator 1 is selected. The sawtooth waveform is rich in even and odd harmonics and has a bright, brassy quality.

Square Wave (Bit 6)

When set to a one, the Pulse waveform output of Oscillator 1 is selected. The harmonic content of this waveform can be adjusted by the Pulse Width registers, producing tone Qualities ranging from a bright, hollow square wave to a nasal, reedy pulse. Sweeping the pulse width in real-time produces a dynamic “phasing” effect which adds a sense of motion to the sound. Rapidly jumping between different pulse widths can produce interesting harmonic sequences.

Noise (Bit 7)

When set to a one, the Noise output waveform of Oscillator 1 is selected. This output is a random signal which changes at the frequency of Oscillator 1. The sound quality can be varied from a low rumbling to hissing white noise via the Oscillator 1 Frequency registers. Noise is useful in creating explosions, gunshots, jet engines, wind, surf and other un-pitched sounds, as well as snare drums and cymbals. Sweeping the Oscillator frequency with Noise selected produces a dramatic rushing effect. One of the output waveforms must be selected for Oscillator 1 to be audible, however it is NOT necessary to deselect waveforms to silence the output of Voice 1. The amplitude of Voice 1 at the final output is a function of the Envelope Generator only.

NOTE: The oscillator output waveforms are NOT additive. If more than one output waveform is selected simultaneously, the result will be a logical ANDing of the waveforms. Although this technique can be used to generate additional waveforms beyond the four listed above, it must be used with care. If any other waveform is selected while Noise is on, the Noise output can “lock up”. If this occurs, the Noise output will remain silent until reset by the TEST bit or by bringing /RES (pin 5) low.

Attack/Decay (Register 05)

Bits 4-7 of this register (ATK0-ATK3) select 1 of 16 ATTACK rates for the Voice 1 Envelope Generator. The ATTACK rate determines how rapidly the output of Voice 1 rises from zero to peak amplitude when the Envelope Generator is Gated. The 16 ATTACK rates are listed below in Table 2.

Bits 0-3 (DCY0-DCY3) select 1 of 16 DECAY rates for the Envelope Generator. The DECAY cycle follows the ATTACK cycle and the DECAY rate determines how rapidly the output falls from the peak amplitude to the selected SUSTAIN level. The 16 DECAY rates are listed in Table 2.

Attack Rate Release Rate
DEC HEX (Time/Cycle) (Time/Cycle)
0(0)2 mS6 mS
1(1)8 mS24 mS
2(2)16 mS48 mS
3(3)24 mS72 mS
4(4)38 mS114 mS
5(5)56 mS168 mS
6(6)68 mS204 mS
7(7)80 mS240 mS
8(8)100 mS300 mS
9(9)250 mS750 mS
10(A)500 mS1.5 S
11(B)800 mS2.4 S
12(C)1 S3 S
13(D)3 S9 S
14(E)5 S15 S
15(F)8 S24 S

Table 2

NOTE: Envelope rates are based on a 1.0 Mhz Ø2 clock. For other Ø2 frequencies, multiply the given rate by 1 Mhz / Ø2. The rates refer to the amount of time per cycle. For example, given an ATTACK value of 2, the ATTACK cycle would take 16 mS to rise from zero to peak amplitude. The DECAY/RELEASE rates refer to the amount of time these cycles would take to fall from peak amplitude to zero.

Sustain/Release (Register 06)

Bits 4-7 of this register (STN0-STN3) select 1 of 16 SUSTAIN levels for the Envelope Generator. The SUSTAIN cycle follows the DECAY cycle and the output of Voice 1 will remain at the selected SUSTAIN amplitude as long as the Gate bit remains set. The SUSTAIN levels range from zero to peak amplitude in 16 linear steps, with a SUSTAIN value of 0 selecting zero amplitude and a SUSTAIN value of 15 (#F) selecting the peak amplitude.

A SUSTAIN value of 8 would cause Voice 1 to SUSTAIN at an amplitude one-half the peak amplitude reached by the ATTACK cycle.

Bits 0-3 (RLS0-RLS3) select 1 of 16 RELEASE rates for the Envelope Generator. The RELEASE cycle follows the SUSTAIN cycle when the Gate bit is reset to zero. At this time, the output of Voice 1 will fall from the SUSTAIN amplitude to zero amplitude at the selected RELEASE rate. The 16 RELEASE rates are identical to the DECAY rates.

NOTE: The cycling of the Envelope Generator can be altered at any point via the Gate bit. The Envelope Generator can be Gated and Released without restriction. For example, if the Gate bit is reset before the envelope has finished the ATTACK cycle, the RELEASE cycle will immediately begin, starting from whatever amplitude had been reached. If the envelope is then Gated again (before the RELEASE cycle has reached zero amplitude), another ATTACK cycle will begin, starting from whatever amplitude had been reached. This technique can be used to generate complex amplitude envelopes via real-time software control.

Voice 2

Registers 07-$0D control Voice 2 and are functionally identical to registers 00-06 with these exceptions:

When selected, SYNC synchronizes Oscillator 2 with Oscillator 1.

When selected, RING MOD replaces the Triangle output of Oscillator 2 with the ring modulated combination of Oscillators 2 and 1.

Voice 3

Registers $0E-$14 control Voice 3 and are functionally identical to registers 00-06 with these exceptions:

When selected, SYNC synchronizes Oscillator 3 with Oscillator 2.

When selected, RING MOD replaces the Triangle output of Oscillator 3 with the ring modulated combination of Oscillators 3 and 2.

Typical operation of a voice consists of selecting the desired parameters: frequency, waveform effects (SYNC, RING MOD) and envelope rates, then gating the voice whenever the sound is desired. The sound can be sustained for any length of time and terminated by clearing the Gate bit. Each voice can be used separately, with independent parameters and gating, or in unison to create a single, powerful voice. When used in unison, a slight detuning of each oscillator or tuning to musical intervals creates a rich, animated sound.

Filter

FC Lo/FC Hi (Registers $15, $16)

Together these registers form an 11-bit number (bits 3-7 of FC LO are not used) which linearly controls the Cutoff (or Center) Frequency of the programmable Filter. The approximate Cutoff Frequency ranges between 30Hz and 10KHz with the recommended capacitor values of 2200pF for CAP1 and CAP2. The frequency range of the Filter can be altered to suit specific applications. Refer to the Pin Description section for more information.

RES/Filt (Register $17)

Bits 4-7 of this register (RES0-RES3) control the Resonance of the Filler, resonance of a peaking effect which emphasizes frequency components at the Cutoff Frequency of the Filter, causing a sharper sound. There are 16 Resonance settings ranging linearly from no resonance (0) to maximum resonance (15 or #F).

Bits 0-3 determine which signals will be routed through the Filter:

Filt 1 (Bit 0)

When set to a zero, Voice 1 appears directly at the audio output and the Filter has no effect on it. When set to a one, Voice 1 will be processed through the Filter and the harmonic content of Voice 1 will be altered according to the selected Filter parameters.

Filt 2 (Bit 1)

Same as bit 0 for Voice 2.

Filt 3 (Bit 2)

Same as bit 0 for voice 3.

Filtex (Bit 3)

Same as bit 0 for External audio input (pin 26).

Mode/Vol (Register $18)

Bits 4-7 of this register select various Filter mode and output options:

LP (Bit 4)

When set to a one, the low Pass output of the Filter is selected and sent to the audio output. For a given Filter input Signal, all frequency components below the Filter Cutoff Frequency are passed unaltered, while all frequency components above the Cutoff are attenuated at a rate of 12 dB/Octave. The low Pass mode produces full-bodied sounds.

BP (Bit 5)

Same as bit 4 for the Band Pass output. All frequency components above and below the Cutoff are attenuated at a rate of 6 dB/Octave. The Band Pass mode produces thin, open sounds.

HP (Bit 6)

Same as bit 4 for the High Pass output. All frequency components above the Cutoff are passed unaltered, while all frequency components below the Cutoff are attenuated at a rate of 12 dB/Octave. The High Pass mode produces tinny, buzzy sounds.

3 OFF (Bit 7)

When set to a one, the output of Voice 3 is disconnected from the direct audio path. Setting Voice 3 to bypass the Filter (FILT 3 = 0) and selling 3 OFF to a one prevents Voice 3 from reaching the audio output. This allows Voice 3 to be used for modulation purposes without any undesirable output.

NOTE: The Filter output modes ARE additive and multiple Filter modes may be selected simultaneously.

For example, both LP and HP modes can be selected to produce a Notch (or Band Reject) Filter response. In order for the Filter to have any audible effect, at least one Filter output must be selected and at least one Voice must be routed through the Filter. The Filter is, perhaps, the most important element in SID as it allows the generation of complex tone colors via subtractive synthesis. The Filter is used to eliminate specific frequency components from a harmonically-rich input signal). The best results are achieved by varying the Cutoff Frequency in real-time.

Bits 0-3 (VOL0-VOL3) select 1 of 16 overall Volume levels for the final composite audio output. The output volume levels range from no output (0) to maximum volume (15 or #F) in 16 linear steps. This control can be used as a static volume control for balancing levels in multi-chip systems or for creating dynamic volume effects, such as Tremolo. Some Volume level other than zero must be selected in order for SID to produce any sound.

Misc

POTX (Register $19)

This register allows the microprocessor to read the position of the potentiometer tied to POTX (pin 24), with values ranging from 0 at minimum resistance, to 255 (#FF) at maximum resistance. The value is always valid and is updated every 512 Ø2 clock cycles. See the Pin Description section for information on post and capacitor values.

POTY (Register $1A)

Same as POTX for the pot tied to POTY (pin 23).

OSC 3/RANDOM (Register $1B)

This register allows the microprocessor to read the upper 8 output bits of Oscillator 3. The character of the numbers generated is directly related to the waveform selected. If the Sawtooth waveform of Oscillator 3 is selected, this register will present a series of numbers incrementing from 0 to 255 ($FF) at a rate determined by the frequency of Oscillator 3. If the Triangle waveform is selected, the output will increment from 0 up to 255, then decrement down to 0. If the Pulse waveform is selected, the output will jump between 0 and 255. Selecting the Noise waveform will produce a series of random numbers, therefore, this register can be used as a random number generator for games. There are numerous timing and sequencing applications for the OSC 3 register, however, the chief function is probably that of a modulation generator. The numbers generated by this register can be added, via software, to the Oscillator or Filter Frequency registers or the Pulse Width registers in real-time. Many dynamic effects can be generated in this manner. Siren-like sounds can be created by adding the OSC 3 Sawtooth output to the frequency control of another oscillator. Synthesizer “Sample and Hold” effects can be produced by adding the OSC 3 Noise output to the Filter Frequency control registers. Vibrato can be produced by selling Oscillator 3 to a frequency around 7 Hz and adding the OSC 3 Triangle output (with proper scaling) to the Frequency control of another oscillator. An unlimited range of effects are available by altering the frequency of Oscillator 3 and scaling the OSC 3 output. Normally, when Oscillator 3 is used for modulation, the audio output of Voice 3 should be eliminated (3 OFF = 1).

ENV 3 (Register $1C)

Same as OSC 3, but this register allows the microprocessor to read the output of the Voice 3 Envelope Generator. This output can be added to the Filler Frequency to produce harmonic envelopes, WAH WAH, and similar effects. “Phaser” sounds can be created by adding this output to the frequency control registers of an oscillator. The Voice 3 Envelope Generator must be gated in order to produce any output from this register. The OSC 3 register, however, always reflects the changing output of the oscillator and is not affected in any way by the Envelope Generator.

SID Pin Description

CAP1A, CAP1B (Pins 1,2)/CAP2A, CAP2B Pins 3,4)

These pins are used to connect the two integrating capacitors required by the programmable Filter. C1 connects between pins 1 and 2, C2 between pins 3 and 4. Both capacitors should be the same value. Normal operation of the Filter over the audio range (approximately - 30 Hz-12 KHz) is accomplished with a value of 2200 pF for C1 and C2. Polystyrene capacitors are preferred. In complex polyphonic systems, where many SID chips must track each other, matched capacitors are recommended. The frequency range of the Filter can be tailored to specific applications by the choice of capacitor values. For example, a low-cost game may not require full high-frequency response, In this case, larger values for C1 and C2 could be chosen to provide more control over the bass frequencies of the Filter. The approximate maximum Cutoff Frequency of the Filter is given by:

FCmax = 2.6E-5/C

Where C is the capacitor value. The range of the Filter extends approximately 9 octaves below the maximum Cutoff Frequency.

/RES (Pin 5) -This TTL-level input is the reset control for SID. When brought low for at least ten Ø2 cycles, all internal registers are reset to zero and the audio output is silenced. This pin is normally connected to the reset line of the microprocessor or a power-on-clear circuit.

Ø2 (Pin 6) -This TTL-level input is the master clock for SID. All oscillator frequencies and envelope rates are referenced to this clock. Ø2 also controls data transfers between SID and the microprocessor. Data can only be transferred when Ø2 is high. Essentially, Ø2 acts as a high-active chip select as far as data transfers are concerned. This pin is normally connected to the system clock, with a nominal operating frequency of 1.0 MHz.

R/W (Pin 7) -This TTL-level input controls the direction of data transfers between SID and the microprocessor. If the chip select conditions have been met, a high on this line allows the microprocessor to Read data from the selected SID register and a low allows the microprocessor to Write data into the selected SID register. This pin is normally connected to the system Read/Write line.

/CS (Pin 8) -This TTL-level input is a low active Chip select which controls data transfers between SID and the microprocessor. /CS must be low for any transfer. A Read from the selected SID register can only occur if /CS is low, Ø2 is high and R/W is high. A Write to the selected SID register can only occur if /CS is low, Ø2 is high and R/W is low. This pin is normally connected to address decoding circuitry, allowing SID to reside in the memory map of a system.

A0-A4 (Pins 9-13) -These TTL-level inputs are used to select one of the 29 SID registers. Although enough addresses are provided to select 1 of 32 registers, the remaining three register locations are not used. A Write to any of these three locations is ignored and a Read returns invalid data. These pins are normally connected to the corresponding address lines of the microprocessor so that SID may be addressed in the same manner as memory.

GND (Pin 14) -For best results, the ground line between SID and the power supply should be separate from ground tines to other digital circuitry. This will minimize digital noise at the audio output.

D0-D7 (Pins 15-22) -These bidirectional lines are used to transfer data between SID and the microprocessor. They are TTL compatible in the output mode and capable of driving 2 TTL loads in the output mode. The data buffers are usually in the high-impedance off state. During a Write operation, the data buffers remain in the off (input) state and the microprocessor supplies data to SID over these lines. During a Read operation, the data buffers turn on and SID supplies data to the microprocessor over these lines. The pins are normally connected to the corresponding data lines of the microprocessor.

POTX, POTY (Pins 24, 23) -These pins are inputs to the A/D converters used to digitize the position of potentiometers. The conversion process is based on the time constant of a capacitor tied from the POT pin to ground, charged by a potentiometer tied from the POT pin to +5 volts. The component values are determined by

RC = 4.7E-4

Where R is the maximum resistance of the pot and C is the capacitor.

The larger the capacitor, the smaller the POT value jitter. The recommended values for R and C are 470 KOhms and 1000 pF.

Note that a separate pot and cap are required for each POT pin.

Vcc (Pin 25) - As with the GND line, a separate +5 VDC line should be run between SID Vcc and the power supply in order to minimize noise. A bypass capacitor should be located close to the pin.

Ext In (Pin 26) -This analog input allows external audio signals to be mixed with the audio output of SID or processed through the Filter. Typical sources include voice, guitar and organ. The input impedance of this pin is in the order of 100 KOhms. Any signal applied directly to the pin should ride at DC level of 6 volts and should not exceed 3 volts p-p. In order to prevent any interference caused by DC level differences, external signals should be AC-coupled to EXT IN by an electrolytic capacitor in the 1-10uF range. As the direct audio path (FILTEX = 0) has unity gain, EXT IN can be used to mix outputs of many SID chips by daisy-chaining. The number of chips that can be chained in this manner is determined by the amount of noise and distortion allowable at the final output. Note that the output Volume control will affect not only the three SID voices, but also any external inputs.

Audio Out (Pin 27) -This open-source buffer is the final audio output of SID, comprised of the three SID voices, the Filter and any external input. The output level is set by the output Volume control and reaches a maximum of approximately 3 volts p-p at a 6 volt DC level. A source resistor from AUDIO OUT to ground is required for proper operation. The recommended resistance is 1 KOhm for a standard output impedance. As the output of SID rides at a 6 volt DC level, it should be AC-coupled to any audio amplifier with an electrolytic capacitor in the 1-10uF range.

Vdd (Pin 28) - As with Vcc, a separate + 12 VDC fine should be run to SID Vdd and a bypass capacitor should be used.

See Appendix C for typical SID application.

6581 SID Characteristics

Absolute Maximum Ratings

  • Supply Voltage, Vdd -0.3 VDC to +17 VDC
  • Supply Voltage, Vcc -0.3 VDC to +7 VDC
  • Input Voltage (analog). Vina -0.3 VDC to +17 VDC
  • Input Voltage (digital), Vind -0.3 VDC to +7 VDC
  • Operating Temperature, Ta 0° C to +70° C
  • Storage Temperature, Tstg -55° C to +150° C

All inputs contain protection circuitry to prevent damage due to high static discharges. Care should be exercised to prevent unnecessary application of voltages in excess of the allowable limits.

Comment

Stresses above those listed under “Absolute Maximum Ratings” may cause permanent damage to the device. These are stress ratings only. Functional operation of this device at these or any other conditions above those indicated in the operational sections of this specification is not implied and exposure to absolute maximum rating conditions for extended periods may affect device reliability.

Electrical Characteristics.PNG

6581 (SID) Timing

SID Timing READ.PNG

Read cycle table.PNG

SID Timing WRITE.PNG

Write cycle table.PNG

Appendix A - Equal-Tempered Musical Scale Values

The following table lists the numerical values which must be stored in the SID Oscillator frequency control registers to produce the notes of the equal-tempered musical scale. The equal-tempered scale consists of an octave containing 12 semitones (notes): C, D, E, F, G, A, B and C#, D#, F#, G#, A#. The frequency of each semitone is exactly the 12th root of 2 times the frequency of the previous semitone. The table is based on a Ø2 = clock of 1.0 Mhz. Refer to the equation given in the Register Description for use of other master clock frequencies. The scale selected is concert pitch, in which A4 = 440 Hz. Transpositions of this scale and scales other than the equal-tempered scale are also possible.

Musical Freq Osc Fn Osc Fn Musical Freq Osc Fn Osc Fn
Note (Hz) (Decimal) (Hex) Note (Hz) (Decimal) (Hex)
1C0$17.32291012349C4$277.184650122A
2D018.35308013450D4293.664927133F
3D0$19.44326014651D4$311.1352201464
4E020.60346015A52E4329.635530159A
5F021.83366016E53F4349.23585916E3
6F0$23.12388018454F4$370.006207183F
7G024.50411018B55G4392.0065771981
8G0$25.9643501B356G4$415.3069681B38
9A027.5046101CD57A4440.0073821CD6
10A0$29.1448901E958A4$466.1678211E80
11B030.87518020659B4493.888286205E
12C132.70549022560C5523.258779224B
13C1$34.65581024561C5$554.3793012455
14D136.71616026862D5587.339854267E
15D1$38.89652028C63D5$622.251044028C8
16E141.2069102B364E5659.25110602B34
17F143.6573202DC65F5698.46117182DC6
18F1$46.25776030866F5$740.0012415307F
19G149.00822033667G5783.99131533361
20G1$51.91871036768G5$830.6113935366F
21A155.00923039B69A5880.001476439AC
22A1$58.2797803D270A5$932.33156423D1A
23B161.741036040C71B5987.771657240BC
24C265.411097044972C61046.50175574495
25C2$69.301163048B73C6$1108.731860148A9
26D273.42123204D074D61174.66197094CFC
27D2$77.781305051975D6$1244.5120897518F
28E282.411383056776E61318.51221215669
29F287.31146505B977F61396.91234365B8C
30F2$92.501552061078F6$1479.982483060FE
31G298.001644066C79G61567.98263066602
32G2$103.83174206CE80G6$1661.22278716CDF
33A2110.001845073581A61760.00295287358
34A2$116.54195507A382A6$1864.65312347A34
35B2123.472071081783B61975.53331448178
36C3130.812195089384C72093.0035115892B
37C3$138.592325091585C7$2217.46372039153
38D3146.832463099F86D72349.323941599F7
39D3$155.5626100A3287D7$2489.0141759A31F
40E3164.8127650ACD88E72637.0244242ACD2
41F3174.6129300B7289F72793.8346873B719
42F3$185.0031040C2090F7$2959.9549660C1FC
43G3196.0032880C0891G73135.9652613C085
44G3$207.6534840D9C92G7$3322.44557410980
45A3220.0036910E6B93A73520.0059056E6B0
46A3$233.0839100F4694A7$3729.3162567F467
47B3246.944143102F95B73951.06*66288*1F2F0

Although the table above provides a simple and quick method for generating the equal-tempered scale, it is very memory inefficient as it requires 192 bytes for the table alone. Memory efficiency can be improved by determining the note value algorithmically. Using the fact that each note in an octave is exactly half the frequency of that note in the next octave, the note look-up table can be reduced from 96 entries to 12 entries, as there are 12 notes per octave. If the 12 entries (24 bytes) consist of the 16-bit values for the eighth octave (C7 through B7), then notes in lower octaves can be derived by choosing the appropriate note in the eighth octave and dividing the 16-bit value by two for each octave of difference. As division by two is nothing more than a right-shift of the value, the calculation can easily be accomplished by a simple software routine. Although note B7 is beyond the range of the Oscillators this value should still be included in the table for calculation purposes (the MSB of B7 would require a special software case, such as generating this bit in the CARRY before shifting). Each note must be specified in a form which indicates which of the 12 semitones is desired, and which of the eight octaves the semitone is in. Since four bits are necessary to select 1 of 12 semitones and three bits are necessary to select 1 of 8 octaves, the information can fit in one byte, with the lower nybble selecting the semitone (by addressing the look-up table) and the upper nybble being used by the division routine to determine how many times the table value must be right-shifted.

Appendix B - SID Envelope Generators

The four-part ADSR (ATTACK, DECAY, SUSTAIN, RELEASE) envelope generator has been proven in electronic music to provide the optimum trade-off between flexibility and ease of amplitude control. Appropriate selection of envelope parameters allows the simulation of a wide range of percussion and sustained instruments. The violin is a good example of a sustained instrument. The violinist controls the volume by bowing the instrument. Typically, the volume builds slowly, reaches a peak, then drops to an intermediate level. The violinist can maintain this level for as long as desired, then the volume is allowed to slowly die away. A “snapshot” of this envelope is shown below:

SID Envelope 1.PNG

This volume envelope can be easily reproduced by the ADSR as shown below, with typical envelope rates:

SID envelope 2.PNG

Note that the tone can be held at the intermediate SUSTAIN level for as long as desired. The tone will not begin to die away until GATE is cleared. With minor alterations, this basic envelope can be used for brass and woodwinds as well as strings.

An entirely different form of envelope is produced by percussion instruments such as drums, cymbals and gongs, as well as certain keyboards such as pianos and harpsichords. The percussion envelope is characterized by a nearly instantaneous attack, immediately followed by a decay to zero volume. Percussion instruments cannot be sustained at a constant amplitude. For example, the instant a drum is struck, the sound reaches full volume and decays rapidly regardless of how it was struck. A typical cymbal envelope is shown below:

SID Envelope 3.PNG

Note that the tone immediately begins to decay to zero amplitude after the peak is reached, regardless of when GATE is cleared. The amplitude envelope of pianos and harpsichords is somewhat more complicated, but can be generated quite easily with the ADSR. These instruments reach full volume when a key is first struck. The amplitude immediately begins to die away slowly as long as the key remains depressed. If the key is released before the sound has fully died away, the amplitude will immediately drop to zero. This envelope is shown below:

SID Envelope 4.PNG

Note that the tone decays slowly until GATE is cleared, at which point the amplitude drops rapidly to zero.

The most simple envelope is that of the organ. When a key is pressed, the tone immediately reaches full volume and remains there. When the key is released, the tone drops immediately to zero volume. This envelope is shown below:

SID Envelope 5.PNG

The real power of SID lies in the ability to create original sounds rather than simulations of acoustic instruments. The ADSR is capable of creating envelopes which do not correspond to any “real” instruments. A good example would be the “backwards” envelope. This envelope is characterized by a slow attack and rapid decay which sounds very much like an instrument that has been recorded on tape then played backwards. This envelope is shown below:

SID Envelope 6.PNG

Many unique sounds can be created by applying the amplitude envelope of one instrument to the harmonic structure of another. This produces sounds similar to familiar acoustic instruments, yet notably different. In general, sound is quite subjective and experimentation with various envelope rates and harmonic contents will be necessary in order to achieve the desired sound.

Appendix C - Typical 6581 SID Application

SID Typical Application.PNG



Donate to waitingforfriday.com:

If you like this site and want to help support future projects, or you just want to show appreciation for a project you built, used or enjoyed, please consider leaving a PayPal donation. It's quick, secure and helps us to run the site and fund future projects!


PayPal, fast, easy and secure




Join the EFF:

Join the Electronic Frontier Foundation


The owner of this site is a member of the EFF and you should be a member too! The EFF protects the rights of open-source, open-hardware authors all over the world.



Most popular pages:

  1. Building a PIC18F USB device ‎(252,926 views)
  2. Home ‎(238,402 views)
  3. 4-Bit Computer ‎(104,196 views)
  4. Projects ‎(103,467 views)
  5. Open Source Framework for USB Generic HID devices based on the PIC18F and Windows ‎(103,334 views)
  6. Open Source Visual C++ Class for USB Generic HID Communication ‎(62,760 views)
  7. Real-Time Audio Spectrum Analyser ‎(60,998 views)
  8. Controlling LED brightness using PWM ‎(51,237 views)
  9. USB RGB LED VU Meter ‎(49,637 views)
  10. PIC USB Development Board ‎(48,667 views)
  11. 16x8 LED Matrix Display ‎(43,964 views)
  12. C64 VICE Front-End ‎(36,612 views)
  13. USB Performance Monitor ‎(33,205 views)
  14. PC Case USB LCD ‎(30,052 views)
  15. Rotary Encoder Demonstration ‎(28,174 views)
  16. Commodore SID 6581 Datasheet ‎(26,967 views)
  17. Reverse engineering an MB Electronic Simon game ‎(24,031 views)
  18. Retro Computing ‎(22,929 views)
  19. LED Colour Organ ‎(22,798 views)
  20. Vetinari's Clock ‎(18,592 views)

more >>