close-circle
Close
0%
0%

OPL2 Audio Board for Arduino & Raspberry Pi

An easy to use audio board with a YM3812 OPL2 chip like used in the Adlib and SoundBlaster cards from back in the day...

Similar projects worth following

I've had a soft spot for OPL2 music ever since I was a kid playing DOS games on my parents' computer. Hearing the Apogee fanfare tune after typing in the exe always meant I was gonna have a great time and I fondly remember the music from games like Commander Keen, Hocus Pocus, Bio Menace and many more!

The music is produced by the Yamaha YM3812 audio chip that was used in the Adlib and SoundBlaster sound cards. After reading through the datasheet of the YM3812 it seemed easy enough to hook it up to an Arduino and play some tunes. I started by adding a 74595 to serve as a serial interface to the YM. I send data to it using SPI. At first I overlooked that the YM requires an external Y3014B DAC and an OPAMP for you to actually hear anything, so I became a bit confused as to how to get the audio out of the chip. I started looking around for schematics that could show me how others did it. I found several.

The first one I found linked in a forum post on the EEVblog. It seems to be from a C64 sound expander. I copied the filtering stage on my breadboard, but all it did was produce terrible hissing and other noises. With a bit more searching I found the reconstructed schematic of the actual Adlib card. The filter used in that one was also quite involved and also didn't work for me. So I started to poke around with the speaker wire until for the first time I could hear some OPL2 music through the noise that this circuit was producing. From there I started experimenting by adding and removing components until I settled on an LM358 OPAMP and two 10 uF caps which give me great audio, as you can hear form the demo video.

I drew the schematic and PCB layout in Fritzing and sent it to them to have my PCB produced. I turned out really nice. Note that the board does need an external amplifier. The code in the video is playing a DRO file (IMF is also supported) from an SD card that was captured using DosBox from the game Stunts. You can find the OPL2 library that I wrote for this project on my GitHub page.

OPL2_Arduino_Final.fzz

Fritzing schematic and PCB layout

fzz - 98.13 kB - 12/16/2016 at 21:22

download-circle
Download

  • 1 × YM3812 OPL2 Audio Chip
  • 1 × YM3014B Data Converters / Digital to Analog Converters (DACs)
  • 1 × 7404 Electronic Components / Misc. Electronic Components
  • 1 × 74595 Inductors, Chokes, Coils and Magnetics / Pulse, Signal, Datacom, Telecom Transformers
  • 1 × LM358 Amplifier and Linear ICs / Operational Amplifiers

View all 12 components

View project log

Enjoy this project?

Share

Discussions

mikednm123 wrote 03/21/2017 at 03:34 point

Great project for quality sound.  My suggestion is that the schematic be more representative of the functionality of each block, not the physical body of the chip.  

  Are you sure? yes | no

Bruce wrote 03/15/2017 at 13:03 point

Nice work! I'd really like one of these! Do you have any extra boards for sale? Where did you find the Yamaha parts?

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates