SID
The SID (sound chip U9) is an interesting device to inspect with a scope, since it involves analog as well as digital signals.
The following measurements were carried out on an MOS8580R5 of ASSY250469.
Two potentiometers can be connected per control port. Those are the POTAX and POTAY on Port 1 and POTBX and POTBY on Port 2. The SID only has two potentiometer inputs (POTX and POTY), so an analog multiplexor is used to select one port. This is U18, a 4066 (analog switch).
The potentiometers are connected between the respective input and the +5V of the control port.
CIA1 (U1) is responsible for the selection. PA7 = HIGH (COL7) selects POTBX and POTBY (Port 2) and PA6 = HIGH (COL6) selects POTAX and POTAY (Port 1).
A measurement cycle looks like this:
1. the measurement capacitors (C80 for POTX and C81 for POTY) are discharged by the SID for 256 clock cycles (that is 256/978kHz = 262µs for PAL and 256/1022.5kHz = 250µs for NTSC).
2. the capacitors are charged via the potentiometers until the threshold voltage is reached. The charging time is counted in clock cycles.
3. this measurement is repeated every 512 cycles.
Measurement cycle for a 20k resistor
This measurement depends on the actual value of the capacitors. Typical tolerances for those are +/-10%. It also depends on the threshold voltage, which is typical VCC/2.
The previous image shows the discharge phase (flat line), which is (delta X) 262µs. Next is the capacitor charging curve. The cycle duration (period) is 520µs. The paddle value is 22. Due to the high tolerances, those are typical for a particular C64. A deviation does not indicate malfunction.
Measurement cycle for a 200k resistor
The same measurement looks different for a 200k resistor. The charging curve is flatter, since less current through the resistor takes much longer to charge the capacitor. The reading for this resistor is 149.
Measurement cycle for a 390k resistor
The reading for 390k is 255 on the particular C64. It is obvious, that there are settings on the 470k pot (above 390k) that are all read 255, about 45° of the paddle positions are without any effect, which is normal. On a paddle the maximum resistance is reached, the completely turned counter clockwise, and the minimum resistance (close to 0 ohms) is reached in the clockwise direction.
While the potentiometer is set to a value below about 15kohms the curve gets irregular.
Measurement cycle for a 1k resistor
The voltage when discharged is higher than before and interference pulses occur. The readings are low, but still stable.
At higher values of the potentiometer, glitches occur. This can be made visible with a longer persistence time of the scope.
Glitches in the measurement cycle
Those glitches happen while the keyboard scan. COL6 = LOW switches the Port 1 pots off.
Influence of the keaboard scan (COL6) on the measurement of the POT**
The previous image shows that while COL6 is low, the capacitor does not charge => the line is flat while this happens. The keyboard scan is not synchronous to the measurement cycle, so the position of the flat line varies.
Of course the audio signal of the SID is an interesting waveform to probe. On boot, there is not anything to be heard, so I have used the SIDalyzer to set the waveform, volume etc.
SIDalyzer setup
The volume needs to be set to maximum, the voice 1 should not be filtered and the waveform needs to be gated (=audible).
The SID output is U9, pin 27.
The settings:
Coupling = DC
Trigger= rising edge
Time = 2ms/DIV
Voltage = 1V/DIV
Triangle wave, 440Hz, maximum volume
The wave form shows, that there is quite a bit of an offset voltage (about 4.25V) and the amplitude of the audio signal is about 850mVpp.
Squarewave, 440Hz, maximum volume
Sawtooth, 440Hz, maximum volume
The sawtooth signal is pretty hard to trigger in a way, that the waveform is steady. The problem is caused by the noise, that is contained in the output signal.
This requires a closer inspection.
Coupling = AC
Trigger= rising edge
Time = 500us/DIV
Voltage = 200mV/DIV
Sawtooth, 440Hz, AC coupling, 200mV/DIV
The inherent noise is clearly visible as a wide band. The SID output signal is not HiFi audio. That's for sure.
The transistor Q3 does noch change the signal a lot and the e-cap C77 is filtering out the DC offset. So finally, the audio output (at the DIN jack) looks like this:
Coupling = DC
Trigger= rising edge
Time = 500us/DIV
Voltage = 200mV/DIV
Sawtooth, 440Hz, DC coupling at C77 (cathode).
At the cathode of C77, which is the signal at the A/V DIN jack, the signal is DC free. The amplitude is about 670mVpp.
Now, let's switch on the filter! Or lets route the signal of voice 1 through the filter. The configuration is low pass, fc=998kHz.
Sawtooth, 440Hz, DC coupling at C77, LP filter, fc=998Hz
Remarkable is, that the filter inverts the signal (the sawtooth is now backwards). The corners of the sawtooth are rounded, which is a result of the low pass filtering.
A square wave output signal with a pulse width (actually a duty cycle) set to 80% looks like this after C77:
Squarewave, duty cycle 80%, DC coupling at C77 (cathode), no filter
This actually looks like a duty cycle of 20% ("on" for 20% of the time). Next, the low pass filter is switched on:
Squarewave, duty cycle 80%, DC coupling at C77 (cathode), LP filter (fc = 998Hz)
Again, the filter inverts the signal. Now, it really looks like 80% duty cycle (the scope measurement reads 79.47%). The corners are rounded due to teh low pass filtering.
Is the 6581 SID od earlier ASSYs any better (or worse) than the 8580 of ASSY250469?
Here is a screen shot of the audio output of a 6581:
6581: Sawtooth at C13 (cathode)
In ASSY250425, C13 has the same function (filtering out the DC) like C77 in ASSY250469. It is clearly visible, that the ouput signal is about as noisy, maybe even worse.
The SNR (signal to noise ratio) is one criteria for good audio signals. It should be as high as possible. It is defines as
SNR = 20 log (SignalRMS/NoiseRMS)dB
An SNR of 80dB is a good one.
Measuring the SNR requires a special audio analyzer (as far as I know), like the Audio Precision. When I started working as a hardware developer, I could play with such a tool. I have made things with an SNR of 100dB and better.
The Fourier transformation is showing a spectrum of the measured signal. A perfect sine wave has only one peak in it's spectrum at the frequency of the sine wave. All other wave forms have harmonics, that are peaks of different heights at the multiples of the frequency of this waveform. What a decent scope can do is the Fast Fourier transformation (FFT) of waveforms. This method is "good enough".
A triangle wave is a bit like a sine wave. It has some harmonics, though. But their amplitude drops quickly.
FFT (purple) of the triangle at the audio output (yellow)
Three harmonics are visible (the peaks of the purple curve at the left). Everything right from those peaks is mosty noise. The cursor is set to the level of the first peak.
Now, the output is muted. So, this is probably pretty close to the noise level.
FFT of the muted output
The 2nd cursor is set to the amplitude of the noise spectrum. The difference is about 36dB. This value is not the SNR, it is much better.
Since the SNR is about RMS voltages, we could try measure those.
Triangle wave VRMS = 220mV
Muted output: VRMS = 89mV
The Triangle wave still contains the noise, the muted output might contain some traiangle wave, but we can caltulate it nevertheless:
20 log (220mV/89mV) dB = 7.86dB
The real SNR will be worse than 36dB (which is already bad) and maybe better, but close to 8dB.
Both is quite bad. So in case somebody starts ranting about certain SMPS power supplies that have a bad influence on the SID audio quality, just say "Rubbish!".