Ensoniq Mirage: Measurements Wanted

Ensoniq Mirage: Measurements Wanted

Why these measurements

MAME’s Ensoniq Mirage emulation (ensoniq/enmirage.cpp, sound/cem3328.cpp) works, but several of its numbers are estimates from the schematic and datasheets. Each measurement below replaces one of those estimates with a real value. The most valuable are marked priority.

Part numbers and pins refer to the DSK-8 main board schematic, drawing 4010003401, sheets 1 (analog, rev G, 1985) and 2 (digital). Please note your board’s revision if it differs.

Equipment: a two-channel oscilloscope (20 MHz or better), a multimeter, a MIDI interface, and a Mirage OS boot disk. A frequency counter or a scope with a frequency readout saves time.

Safety: the power supply carries mains voltage. Everything here is on the main board’s low-voltage side (+5 V, +12 V, ?8 V). Clip the scope ground to board ground, never to a supply rail.

1. VIA and MIDI clocks (priority)

These confirm that the 6522 VIA runs at 2 MHz and that its PB7 output makes the 500 kHz MIDI clock. MAME’s change to the 6522 core rests on this. Measure after the OS has loaded from disk.

Signal Where Record Expected
CAS (VIA ?2) U9 pin 25, also U12 pin 14 Frequency, duty cycle 2 MHz
CPU E (ED) U15 pin 34 Frequency, phase relative to CAS 2 MHz
SERCLK (VIA PB7) U9 pin 17, also U12 pins 3 and 4 Frequency, duty cycle 500 kHz square wave
CA3 (to VIA PB5) U9 pin 15 Frequency 500 kHz (8 MHz ÷ 16)
8 MHz master U11 or U13 clock input Frequency 8 MHz

Also useful: whether SERCLK is present before the disk loads, and when it first starts.

2. Filter control voltages

These check the chain from the CV DAC (U41, AD7524) to each filter’s control pins. The emulation assumes the DAC spans 0 to +5.08 V (about 19.9 mV per step) and that the hold buffers have unity gain.

Signal Where Record Expected
DAC reference (CVREF) U41 pin 15 DC voltage ?5.1 V (zener CR4)
CV I/V output U56 pin 14 Waveform: the DAC steps as each voice is refreshed 0 to +5.08 V
Held cutoff, voice 1 (VF1) U61 pin 8 DC level and droop between refreshes (AC-coupled) Steady; droop under 1 step
Held resonance, voice 1 (VQ1) U66 pin 8 DC level 0 to +5.08 V
CEM3328 pin 2, voice 1 U67 pin 2 DC level, with VF1 measured at the same moment 0.0355 × VF1 ? 0.048 V
CEM3328 pin 3 (I_REF), voice 1 U67 pin 3 DC level About ?7.3 V

The pin 2 line is the most useful: three or four readings of VF1 against pin 2 confirm the 27K / 160K / 1K network.

3. CEM3328 filter response (priority)

The filter model uses the datasheet’s typical figures: 20 mV per octave, and about 105 Hz at 0 V on pin 2 with the Mirage’s parts. A self-oscillating filter makes a clean sine at its cutoff, so its frequency can be read straight off the output.

  1. Cutoff curve. Set a sound’s resonance to maximum so voice 1 oscillates. Step the filter cutoff parameter through five or more values from low to high. At each step record U67 pin 2 (DC) and the frequency at U67 pin 9 (output). This gives the real scale factor and base frequency.
  2. Oscillation threshold. With the cutoff mid-range, raise resonance one step at a time. Record U67 pin 10 at the first step that oscillates. Datasheet: 2.7 to 3.7 V, typically 3.2 V.
  3. Oscillation level. At maximum resonance, record the peak-to-peak voltage at U67 pin 9. Datasheet: about 2.3 V.
  4. Resonance curve. At three or four resonance settings below oscillation, play a note and record the output level relative to resonance off. The datasheet only calls this a “reverse audio taper”, and the model’s curve is a guess.
  5. Voice-to-voice spread. With all voices at the same cutoff and maximum resonance, record each voice’s oscillation frequency (VCF1–8: U67, U68, U62, U63, U57, U58, U52, U53, pin 9). This shows how far real chips differ.

4. Audio levels (priority)

The emulation assumes a full-scale voice drives the CEM3328 to its rated 6.5 V p-p, because the DOC’s output current isn’t on the schematic. Measuring the real levels replaces that assumption.

Use one sustained note at maximum velocity, with the filter fully open and resonance off. Record peak-to-peak voltage at each point, then repeat with eight notes held.

Point Where 1 note (V p-p) 8 notes (V p-p)
DOC difference amp output U46 pin 6 (U47 pin 3)
Voice 1 audio line (AF1) U47 pin 13
CEM3328 signal input, voice 1 U67 pin 6
CEM3328 output, voice 1 U67 pin 9
Summer output U56 pin 7
Audio out jack, volume at maximum J12

Please note the volume knob position and the sound used.

5. Filter calibration at boot

Right after the OS loads, the firmware tunes each filter: it makes the filter oscillate, counts the cycles through the ADC, and adjusts the cutoff until 4 periods take about 130 ADC reads. MAME has no way to feed real filter output to its ADC, so it substitutes a modeled sine for each oscillating filter.

  1. Trigger on the disk motor stopping after the OS load. Capture the summer output (U56 pin 7) and the ADC input path (U45 pin 13, COM X) for the next second.
  2. Record the waveform’s amplitude and frequency at the ADC input. The firmware’s thresholds are $90 and $70, so the signal must swing well past both.
  3. Record whether all eight voices oscillate together, or one at a time. The firmware leaves earlier voices at full resonance while tuning later ones, which suggests all together.
  4. Record each voice’s final oscillation frequency once calibration ends, from its pin 9.

6. Keyboard controller link

The keyboard’s R6500/11 has an undumped internal ROM, so MAME imitates it from the main CPU’s side. Each key sends three bytes ($90 down or $80 up, key number 0–60, velocity) into the VIA shift register. The CPU acknowledges each byte with a low pulse on CA2. The timing and the velocity values are guesses.

Capture SCLK (U9 pin 18, CB1) and SDATA (U9 pin 19, CB2) on the two channels, then SCLK and SACK (U9 pin 39, CA2).

  1. Shift clock rate, and the gap between bytes within one message.
  2. Whether the controller waits for each CA2 pulse before sending the next byte, and the pulse’s width.
  3. The velocity byte for a very soft, a medium and a very hard press of the same key. Decode it from SDATA, most significant bit first.
  4. What the sustain pedal sends when pressed and released. The OS understands $B8 and $B9.
  5. Any bytes sent at power-on, before a key is pressed, and the state of VIA PB4 (U9 pin 14, which also resets the controller) during boot.

Sending results

Partial results help: sections 1, 3 and 4 alone would settle the biggest open questions.

  • Contact me with your readings.
  • Attach scope screenshots with the timebase and volts per division visible.
  • Note your model (DSK-8 or DSK-1), board revision, OS disk version, and the date codes printed on the CEM3328 chips.
  • If you measure several voices, say which VCF each reading came from.