YMF262 OPL3

This document defines the Yamaha YMF262 FM synthesizer, its MC68EC000 bus adapter, two YAC512 converters, stereo mixer, volume control, and headphone output. Return to the main page.

Document status
Revision 1.0 pre-layout design
Synthesizer
Yamaha YMF262-M, 24-pin SOP
Bus connection
I/O slot 2, $E40000-$E5FFFF, on D7..D0
Canonical ports
$E40001-$E40007, odd byte addresses
Master clock
14.31818 MHz from a dedicated packaged oscillator
Converters
Two Yamaha YAC512-M devices, four analog channels
Stereo mix
Channels A+C to left; channels B+D to right
Output
3.5 mm stereo jack, analog volume control, 32-ohm-or-higher headphones
Timer handling
Status polling; the YMF262 /IRQ pin is not routed

1. Purpose and Scope

The YMF262 supplies 18 two-operator voices, up to six four-operator voices, five rhythm sounds, eight waveforms, two timers, and four selectable output channels. Two YAC512 converters turn its serial output into channels A through D. The motherboard mixes A with C for the left ear and B with D for the right ear, then drives a 3.5 mm stereo jack through a dual headphone amplifier.

The Memory Map owns I/O slot 2 and the canonical port addresses. Bus and Address Decode owns IO2_n, the completion tree, and timeout behavior. The Clock and Reset design owns PERIPH_RESET_n. This page owns the dedicated clock, reset stretcher, bus response, conversion, mixing, and output circuits.

Signal names ending in _n, and names written with a leading slash, are active low. Logic uses +5 V. The headphone stage uses +12 V. ICs use through-hole packages except the YMF262-M and two YAC512-M devices, which have no DIP version and mount directly to the motherboard. Every IC family selected here existed before 1994.

2. Architecture

MC68EC000 lower byte                    YMF262-M

D7..D0 <----------------------------> D7..D0
A1 ----------------------------------> A0
A2 ----------------------------------> A1
IO2_n + LDS_n --> OPL3_CYCLE --------> request synchronizer
AS_n --> inverter -------------------> adapter state hold
OPL3_CLK_14 --> counter and state ---> /CS, /RD, /WR
adapter completion ------------------> OPL3_DTACK_n
PERIPH_RESET_n --> reset stretcher --> /IC

Y_OPL_CLK 14.31818 MHz --------------> OPL3_CLK_14

YMF262-M                              two YAC512-M converters

DOAB -------------------------------> DAC_AB DIN --> channels A and B
DOCD -------------------------------> DAC_CD DIN --> channels C and D
phiSY ------------------------------> both DAC CLK inputs
SMPAC ------------------------------> both DAC SMP1 inputs
SMPBD ------------------------------> both DAC SMP2 inputs

A -- filter --+
              +-- left mix -- volume -- NJM4556AD -- tip
C -- filter --+

B -- filter --+
              +-- right mix - volume -- NJM4556AD -- ring
D -- filter --+

audio ground ------------------------------------------- sleeve

The bus adapter runs from the YMF262 master clock. Reads wait for valid status data. Writes end after four counter clocks, but the CPU remains stopped until 64 counter clocks have elapsed. The next access cannot violate the YMF262's 32-clock write-recovery rule.

3. Bus Interface

YMF262 processor-bus connections
Motherboard signal Connection Function
D7..D0 YMF262 D7..D0 Addresses, register data, and timer status.
A1 YMF262 A0 Selects address or data access.
A2 YMF262 A1 Selects register array 0 or 1.
R/W Adapter gates Selects a status read or port write.
AS_n U_OPL_INV Holds adapter state and completion through the bus cycle.
IO2_n U_OPL_REQ Selects I/O slot 2.
LDS_n U_OPL_REQ Restricts the device to the lower byte.
OPL3_DTACK_n U_OPL_ACK Returns a completed valid transfer.

Cycle Qualification

U_OPL_REQ, one SN74F02N gate, asserts OPL3_CYCLE only while slot 2 and the lower byte lane are selected.

OPL3_CYCLE = NOT (IO2_n OR LDS_n)

Upper-byte accesses reach the motherboard timeout. A word access completes through its lower lane, but only D7..D0 carry OPL3 data. Firmware shall use byte accesses at odd addresses. Address lines A16..A3 are not decoded, so the eight-byte pattern repeats through the slot.

Valid Operations

All four ports accept writes. Only port 0 supports a read. Reads from ports 1 through 3 are withheld from the YMF262 and end through the normal bus timeout, avoiding an undefined device-bus mode.

OPL3_STATUS_ADDRESS = NOT (A1 OR A2)
OPL3_READ_CYCLE = OPL3_CYCLE AND R/W AND OPL3_STATUS_ADDRESS
OPL3_WRITE_CYCLE = OPL3_CYCLE AND NOT R/W

4. Bus Adapter and Write Recovery

U_OPL_SYNC is an SN74HCT74N. Its first half samples OPL3_CYCLE on each rising OPL3_CLK_14 edge; its second half samples the first output. Both active-low clears connect to OPL3_AS_ACTIVE, the inverse of AS_n. Raising AS_n clears the request without waiting for a clock edge.

U_OPL_COUNT is a CD74HCT4040E. U_OPL_INV holds its master reset high until OPL3_REQ_SYNC asserts. The counter then advances on falling clock edges. Q3 rises after four falling edges and Q7 rises after 64.

U_OPL_STATE is a second SN74HCT74N. Its first half clocks from Q3 and records OPL3_STROBE_DONE. Its second half clocks from Q7 and samples OPL3_WRITE_CYCLE to produce OPL3_WRITE_DONE. Both halves clear while OPL3_REQ_SYNC is low.

Adapter sequence
Phase Read Write
Request synchronization /CS and /RD high /CS and /WR high
Counter clocks 0 through 3 /CS and /RD low /CS and /WR low
Q3 rises Assert OPL3_DTACK_n End /CS and /WR
Counter clocks 4 through 63 CPU releases the cycle Hold the CPU during recovery
Q7 rises Not reached Assert OPL3_DTACK_n
CPU releases AS_n Clear state and release completion
OPL3_AS_ACTIVE = NOT AS_n
OPL3_READ_QUALIFIER = R/W AND OPL3_STATUS_ADDRESS
OPL3_READ_STROBE = OPL3_REQ_SYNC AND OPL3_READ_CYCLE

OPL3_WRITE_STROBE =
    OPL3_REQ_SYNC AND OPL3_WRITE_CYCLE AND NOT OPL3_STROBE_DONE

OPL3_RD_n = NOT OPL3_READ_STROBE
OPL3_WR_n = NOT OPL3_WRITE_STROBE
OPL3_CS_n = NOT (OPL3_READ_STROBE OR OPL3_WRITE_STROBE)

OPL3_READ_DONE = OPL3_READ_QUALIFIER AND OPL3_STROBE_DONE
OPL3_ACK_READY = OPL3_READ_DONE OR OPL3_WRITE_DONE
OPL3_DTACK_n = NOT (OPL3_AS_ACTIVE AND OPL3_ACK_READY)

At 14.31818 MHz, four periods are 279.4 ns and 64 periods are 4.469 us. The interval from Q3 to Q7 is 60 clocks, safely beyond the required 32 clocks. The slower write response remains far inside the motherboard's 51.1 us minimum timeout.

Gating completion with OPL3_AS_ACTIVE keeps OPL3_DTACK_n low if the CPU releases LDS_n before AS_n. It releases completion when AS_n rises.

5. Ports and Register Groups

Canonical OPL3 ports
Address YMF262 inputs Read Write
$E40001 A1=0, A0=0 Timer status Array-0 address
$E40003 A1=0, A0=1 Bus error Array-0 data
$E40005 A1=1, A0=0 Bus error Array-1 address
$E40007 A1=1, A0=1 Bus error Array-1 data
Register groups
Register Function
$01 Test register; leave undocumented bits clear.
$02-$04, array 0 Timers, masks, starts, and flag reset.
$04, array 1 Six four-operator channel-pair selections.
$05, array 1 Bit 0 enables OPL3 operation.
$08 Keyboard-split selection for key scaling.
$20-$35 Operator modulation, envelope, scaling, and multiplier.
$40-$55 Key-scale level and total level.
$60-$75 Attack and decay rates.
$80-$95 Sustain level and release rate.
$A0-$A8 Channel frequency-number low byte.
$B0-$B8 Key-on, octave block, and frequency-number high bits.
$BD, array 0 Rhythm keys and modulation depths.
$C0-$C8 Output routing, feedback, and operator connection.
$E0-$F5 Operator waveform selection.

Yamaha's non-linear operator table assigns the addresses within the operator ranges. Firmware shall use that table rather than treating the ranges as contiguous voice records.

6. Clock and Reset

Dedicated Master Clock

Y_OPL_CLK is a packaged 14.31818 MHz clock oscillator. Any oscillator meeting the specification below is acceptable. The Epson SG-615 series is the reference part and the source of the output levels checked below; the ECS ECS-100AX-143 is an equivalent alternative if the Epson part cannot be sourced. Its output reaches YMF262 pin 24 through R_OPL_CLK, a 33 ohm source-series resistor. Oscillator enable is tied high. No other subsystem uses OPL3_CLK_14.

Y_OPL_CLK oscillator specification
Parameter Requirement Reason
Nominal frequency 14.31818 MHz YMF262 master clock; sets the 49.716 kHz nominal sample rate.
Frequency tolerance +/-100 ppm or tighter, over 0 to 70 C Holds the sample rate and timer periods within 0.01 percent.
Symmetry 40 to 60 percent YMF262 clock-input duty limit.
Output 5 V CMOS; VOH at least 4.6 V, VOL at most 0.4 V, into 50 pF Meets the YMF262 3.5 V high threshold with margin.
Supply +5 V, 25 mA maximum Board supply budget.
Package Through-hole full-can DIP oscillator with an enable pin, tied high Footprint is fixed at layout; no crystal load network.

The nominal sample rate is 49.716 kHz because the YMF262 divides its clock by 288. The oscillator's CMOS output meets the YMF262 clock input's 3.5 V high threshold.

Reset Stretcher

The YMF262 requires /IC low for at least 400 clock periods, or 27.94 us at the nominal frequency. A CPU RESET instruction holds PERIPH_RESET_n low for about 12.4 us, so a direct connection is too short.

U_OPL_RESET is one half of a CD74HCT123E. Its /A input is grounded, B is high, and /CLR receives PERIPH_RESET_n. R_OPL_RESET is 100 kohms and C_OPL_RESET is 100 nF, producing a nominal 4.5 ms pulse from tW = 0.45RC. U_OPL_RESET_GATE combines the incoming reset with the complementary pulse output.

OPL3_IC_n = PERIPH_RESET_n AND OPL3_RESET_PULSE_n

The unused monostable half has /CLR grounded and fixed trigger inputs. Reset clears every YMF262 register.

7. Firmware Contract

  1. Wait for OPL3_IC_n release before the first access.
  2. Write $05 to port 2, then $01 to port 3 to enable OPL3 operation.
  3. Program operators, channels, and routing before setting key-on.
  4. Route voices to A and C for left output and B and D for right output.
  5. Write a register number to its address port, then its value to the matching data port. Hardware supplies the recovery delay.
  6. Poll port 0 for timers. Bit 7 is the combined request, bit 6 is timer 1 overflow, and bit 5 is timer 2 overflow.
  7. Reset timer flags through array-0 register $04. The physical /IRQ pin is unused.

8. YAC512 Interface

U_OPL_DAC_AB and U_OPL_DAC_CD are YAC512-M two-channel floating converters. Both FSEL pins connect to +5 V for offset-binary input. Both CLK pins receive YMF262 phiSY.

DAC wiring and channel order
DAC DIN SMP1 SMP2 CH1 CH2
U_OPL_DAC_AB DOAB SMPAC SMPBD A B
U_OPL_DAC_CD DOCD SMPAC SMPBD C D

This is Yamaha's second connection example. Each converter follows Yamaha's sample circuit. CV has 10 uF to ground and drives MP through a unity-gain NJM4560D section. Another section returns AOUT to SWIN through 33 ohms; 47 pF connects from AOUT to the amplifier output. CH1 and CH2 each have 2700 pF to ground and a unity-gain buffer.

Two NJM4560D packages serve each converter. The four packages run from AUDIO_5V and AUDIO_NEG_5, keeping the 2.5 V converter center voltage inside their input and output ranges.

9. Filtering and Stereo Mixing

Each buffered channel passes through 3.3 kohms to a 2.2 nF capacitor to ground. This 21.9 kHz single-pole filter reduces sampling energy. A 1 uF film capacitor then removes the converter bias.

DAC A -- 3.3k --+-- 1uF -- 47k --+
                |                 |
               2.2nF              +-- VOLUME_L high terminal
                |                 |
               GND                |
                                  |
DAC C -- 3.3k --+-- 1uF -- 47k --+
                |
               2.2nF
                |
               GND

DAC B and DAC D use the same network for VOLUME_R.

RV_OPL_VOLUME is a dual-gang 10 kohm logarithmic potentiometer. Its low terminals connect to audio ground. Each wiper feeds one headphone channel through 2.2 uF. The 47 kohm summing resistors prevent one DAC channel from driving another.

The recommended part is the Bourns PDB182-K415K-103A1, a dual-gang 10 kohm audio-taper panel potentiometer. Any dual-gang 10 kohm logarithmic potentiometer with the same footprint is acceptable.

10. Headphone Output

U_OPL_HP is an NJM4556AD dual high-current amplifier on AUDIO_12V and ground. Two 10 kohm resistors create OPL3_AUDIO_BIAS at half supply; 100 uF and 100 nF bypass that node.

Each channel is non-inverting. A 100 kohm resistor biases its positive input. A 10 kohm resistor from the negative input to the bias node and a 10 kohm feedback resistor set gain to two. Each output reaches the jack through 470 uF, positive terminal toward the amplifier, followed by 10 ohms.

The recommended jack is the Same Sky SJ1-3535N, a through-hole 3.5 mm stereo switched jack. Any 3.5 mm TRS jack with the same footprint and the contact assignment below is acceptable.

J_OPL_AUDIO 3.5 mm TRS jack
Contact Connection
Tip Left output through C_OPL_HP_L and R_OPL_HP_L
Ring Right output through C_OPL_HP_R and R_OPL_HP_R
Sleeve Audio ground

The 10 ohm resistors isolate cable capacitance and limit fault current. The intended load is 32 ohms or higher. The AC-coupled output can also feed a line input at a reduced volume setting.

11. Power and Grounding

Converter Supplies

FB_OPL_5V feeds AUDIO_5V from +5 V. The YAC512 VDD pins and NJM4560D positive-supply pins use this rail. Each supply pin has 100 nF, and each converter has 10 uF beside the package. The YMF262 and bus adapter remain on the logic rail.

U_OPL_NEG is an LT1054CN8 data-sheet voltage inverter. A 10 uF flying capacitor connects CAP+ to CAP-, 2.2 uF bypasses VCC, and 100 uF connects VOUT to ground with its positive terminal at ground. FB/SHDN and OSC remain open.

Ten ohms separates VOUT from AUDIO_NEG_5. A 470 uF capacitor, positive terminal at ground, and 100 nF bypass the filtered rail. Only the four NJM4560D packages use it. Their load remains below the LT1054's 100 mA rating.

Headphone Supply

FB_OPL_12V feeds AUDIO_12V from +12 V. A 470 uF electrolytic and 100 nF ceramic capacitor sit beside U_OPL_HP. Audio returns join the continuous ground plane in the audio area. There is no isolated audio ground.

12. Package and Pin Maps

YMF262-M

U_OPL 24-pin SOP connections
Pins Signals Connections
1, 12 VDD, VSS +5 V and ground
2 /IRQ No connection
3 /IC OPL3_IC_n
4, 5 A0, A1 CPU A1, CPU A2
6, 7, 8 /WR, /RD, /CS Adapter strobes
9 TEST No connection
10, 11, 13-18 D0-D7 CPU D0-D7
19, 20 SMPBD, SMPAC Both YAC512 sample inputs
21, 22 DOAB, DOCD DAC_AB DIN, DAC_CD DIN
23 phiSY Both YAC512 CLK inputs
24 phiM OPL3_CLK_14

YAC512-M

Both 16-pin SOP converter connections
Pin Signal Connection
1, 3 VDD AUDIO_5V
2 VSS Ground
4 DIN DOAB or DOCD
5 CLK OPL3_DAC_CLK
6 FSEL +5 V
7, 8 SMP2, SMP1 SMPBD, SMPAC
9 TST1 +5 V
10, 11 CH1, CH2 2700 pF hold capacitors and buffers
12, 13 SWIN, AOUT 33 ohm settling loop and buffer
14, 16 MP, CV Reference follower; 10 uF at CV
15 TST2 No connection

Adapter and Analog Packages

Standard package assignments
Part Package Pin use
SN74HCT74N 14-pin DIP Standard dual-D pinout; local cycle state drives asynchronous clears.
CD74HCT4040E 16-pin DIP Pin 10 clock, pin 11 reset, pin 6 Q3, pin 4 Q7.
CD74HCT123E 16-pin DIP First half uses pins 1-7; pin 3 receives peripheral reset and pin 5 supplies OPL3_RESET_PULSE_n.
NJM4560D 8-pin DIP Standard dual-op-amp pinout; pin 8 is +5 V and pin 4 is AUDIO_NEG_5.
NJM4556AD 8-pin DIP Standard dual-op-amp pinout; pin 8 is AUDIO_12V and pin 4 is ground.
LT1054CN8 8-pin DIP 1 FB/SHDN, 2 CAP+, 3 GND, 4 CAP-, 5 VOUT, 6 VREF, 7 OSC, 8 VCC.

13. Timing and Electrical Checks

Timing margins
Requirement Device limit Circuit result
Master clock 10 to 16 MHz; 40% to 60% duty 14.31818 MHz oscillator, +/-100 ppm
Write width 100 ns minimum More than 218 ns at the 16 MHz device limit
Read width and access 150 ns Q3 completion after four edges, nominally 279.4 ns
Write recovery 32 clocks minimum 60 clocks from strobe completion to acknowledgement
Reset low 400 clocks minimum 4.5 ms nominal after incoming reset release
YAC512 clock 0.65 to 6 MHz YMF262 phiSY, about 2.386 MHz
Headphone load NJM4556AD high-current output 32 ohms or higher through 10 ohms per channel

Completion Release

The MC68EC000FN10 requires /DTACK to negate no later than 110 ns after AS_n or the data strobes negate. OPL3_DTACK_n releases from AS_n alone, through the U_OPL_INV inverter and the U_OPL_ACK NAND, without waiting for the counter or the state registers. Release is a rising edge at every node after the inverter.

U_OPL_INV SN74F04, tPHL      5.3 ns maximum
U_OPL_ACK SN74F00, tPLH      6.0 ns maximum
group SN74F21, tPLH          5.3 ns maximum
final SN74F21, tPLH          5.3 ns maximum
timeout-mask SN74F32, tPLH   6.6 ns maximum
------------------------------------------------
component total             28.5 ns
MC68EC000 limit            110.0 ns
board allowance             81.5 ns

Loading

The YMF262 adds one CMOS load to each lower-byte bus line. The local oscillator adds no motherboard clock load. U_OPL_RESET and U_OPL_RESET_GATE add two HCT inputs to PERIPH_RESET_n.

14. Parts Added

OPL3 subsystem ICs and controls
Reference Part Function
U_OPL YMF262-M FM synthesizer, 24-pin SOP.
U_OPL_DAC_AB, U_OPL_DAC_CD 2 x YAC512-M Four-channel conversion, 16-pin SOP.
Y_OPL_CLK 14.31818 MHz packaged oscillator; Epson SG-615 series or ECS ECS-100AX-143 Dedicated master oscillator.
U_OPL_SYNC, U_OPL_STATE 2 x SN74HCT74N Synchronization and state.
U_OPL_COUNT CD74HCT4040E Read and write timing.
U_OPL_RESET CD74HCT123E Reset stretcher.
U_OPL_REQ SN74F02N Cycle, address, and chip-select logic.
U_OPL_INV SN74F04N Direction, reset, and strobe inversion.
U_OPL_STROBE_A, U_OPL_STROBE_B 2 x SN74F08N Read, write, and completion terms.
U_OPL_ACK_OR SN74F32N Completion combination.
U_OPL_ACK SN74F00N Active-low completion.
U_OPL_RESET_GATE SN74HCT08N Reset combination.
U_OPL_DAC_BUF_1..4 4 x NJM4560D DAC references and buffers.
U_OPL_NEG LT1054CN8 Negative converter-buffer supply.
U_OPL_HP NJM4556AD Stereo headphone amplifier.
RV_OPL_VOLUME Dual 10 kohm logarithmic potentiometer; recommended part Bourns PDB182-K415K-103A1 Volume control.
J_OPL_AUDIO 3.5 mm TRS jack; recommended part Same Sky SJ1-3535N Stereo output.
OPL3 subsystem passive parts
Quantity and value Use
1 x 33 ohms OPL3 clock source termination.
2 x 33 ohms, 2 x 47 pF YAC512 settling loops.
4 x 2700 pF YAC512 channel hold capacitors.
4 x 3.3 kohms, 4 x 2.2 nF Reconstruction filters.
4 x 1 uF film, 4 x 47 kohms DAC bias blocking and stereo summing.
2 x 2.2 uF Volume-wiper coupling.
4 x 10 kohms, 2 x 100 kohms Headphone bias and gain networks.
2 x 470 uF, 2 x 10 ohms Headphone output coupling and isolation.
1 x 100 kohms, 1 x 100 nF Reset one-shot timing.
1 x 10 uF, 1 x 2.2 uF, 1 x 100 uF LT1054 flying, input, and output capacitors.
1 x 10 ohms, 1 x 470 uF Negative-rail post-filter.
4 x 10 uF YAC512 CV bypass and local rail reservoirs.
1 x 470 uF, 1 x 100 uF Headphone-supply and bias reservoirs.
2 x ferrite beads Filtered +5 V and +12 V audio feeds.
One 100 nF per IC supply pin Local high-frequency bypassing.

The YMF262 and YAC512 were sold as an OPL3 pair before 1994. Their SOP packages are exceptions to the through-hole IC rule. Yamaha's period YAC512 circuit names the NJM4560. The NJM4556A, LT1054, HCT, and FAST families also predate 1994. All other ICs use DIP packages. Each IC has a 100 nF ceramic bypass capacitor at its supply pins.

15. Board Layout

16. Assembled-System Acceptance

Required subsystem results
Test Required result
Reset OPL3_IC_n stays low during reset and for at least 40 us after release.
Port decode Four byte-write ports complete; only port 0 reads; invalid reads and upper-byte accesses produce a bus error.
Write spacing Successive writes have at least 32 master clocks between strobe endings.
Timer polling Both flags appear at port 0 and clear through register $04 without an MFP interrupt.
Channel identity A and C reach left; B and D reach right before software routing.
Channel match Left and right stay within 1 dB from 100 Hz through 10 kHz at equal settings.
Headphones A 32 ohm stereo load plays cleanly without sustained oscillation or excessive U_OPL_HP heating.
Silence No digital clock or 25 kHz charge-pump tone dominates with all operators keyed off.

17. Internal Signal Reference

OPL3 subsystem signals
Signal Source Destination
OPL3_CYCLE U_OPL_REQ Synchronizer and access gates.
OPL3_AS_ACTIVE U_OPL_INV from AS_n Synchronizer clears and completion gate.
OPL3_CLK_14 Y_OPL_CLK YMF262, synchronizer, and counter.
OPL3_REQ_SYNC U_OPL_SYNC Counter, state, and strobe gates.
OPL3_STROBE_DONE U_OPL_STATE first half Read completion and write-strobe end.
OPL3_WRITE_DONE U_OPL_STATE second half Completion OR gate.
OPL3_CS_n, OPL3_RD_n, OPL3_WR_n Adapter gates YMF262.
OPL3_DTACK_n U_OPL_ACK Motherboard completion tree.
OPL3_IC_n U_OPL_RESET_GATE YMF262 initial clear.
OPL3_DAC_CLK YMF262 phiSY Both YAC512 CLK inputs.
AUDIO_5V FB_OPL_5V Both YAC512 devices and four NJM4560D packages.
AUDIO_NEG_5 U_OPL_NEG and filter Four NJM4560D packages.
AUDIO_12V FB_OPL_12V U_OPL_HP and bias divider.
OPL3_AUDIO_BIAS 10 kohm divider Both headphone channels.

18. Sources