YMF262 Player

Authors: Wesley Ivester and Nathan Olivares

The YMF262, also known as FM Operator Type L3 (OPL3), is a chip uses FM synthesis to generate sound. It outputs digital samples which are then converted to analog with the YAC512 D/A Converter chip. The YMF262 was used in many sound cards in the 90's. It has 36 operators, which are function generators that can generate 8 different wave forms and have various other settings. In 2-operator mode, the chip has 18 channels with 2 operators each. In a different mode, it can have up to 6 4-operator channels and the rest 2-operator.

Useful Guide for Programming the YMF262

YMF262 Datasheet

YAC512 Datasheet

The YMF262 The YMF262. It is unfortunately not available in a DIP package so it is a bit more difficult to work with.

Description

This project is a music and MIDI player for this chip. A file browser is displayed on an LCD screen and allows you to browse files and directories on an SD card. For now the only supported music format is Reality Adlib Tracker v2 (rad). A button can be pressed to switch between music and MIDI mode. In MIDI mode, all channels are set to the same 2-operator instrument, so up to 18 notes can be played at once. Settings are displayed on the LCD to customize the parameters of this instrument. Virtual MIDI Piano Keyboard can be used to test MIDI operation if a real MIDI keyboard is unavailable. You can also use MIDI-OX. It comes with a program called MIDIBar, which can be used to play MIDI files.

A circuit board was also designed for this project.

Bill of Materials

Schematic

/media/uploads/wesleyivester/circuit_design.png A schematic cleared of most connections to be easier to read. Labels on pins correspond to other locations where the labels are present.

PCB Layout

/media/uploads/wesleyivester/pcb_design.png This PCB was made within the constraints of an in-house PCB etcher without the ability to make vias or remove excess copper. The board is designed to leave space around particularly hard-to-solder components and minimize the amount of vias that would need to be manually filled. I would not recommend anyone try this again, as it is incredibly painful to solder a chips leads to both sides of a board, particularly for components with pins within their dimensions.

Source Code

Because we wanted to use C++11 features we used the GNU Arm Embedded Toolchain GCC compiler. The code repository can be found here on github. The Mbed online compiler does not support C++11 yet, so some code would have to be modified for it to compile.

Images

/media/uploads/wesleyivester/20190429_121701.jpg After soldering the chip to a breakout board for use on a breadboard.

/media/uploads/wesleyivester/20190429_123919.jpg The final working design on a breadboard.

Video Demo

Improvements

The USB header pins and breakout could be replaced with a USB socket directly on the PCB. Because we did not think to order one initially, we used a USB breakout we already had because of time constraints. The NJM2100 op amp cannot provide much current. This is fine for a line out because line in usually has high impedance, however headphones usually have low impedance. Thus, turning up the volume too high causes bad distortion for headphones. Another amplifier or an op amp with greater output voltage swing at low load resistance would improve this. This project uses 2 separate potentiometers for controlling volume of left and right speakers. It would have been better to have a single stereo potentiometer. Also the potentiometers should have been logarithmic.


Please log in to post comments.