Atari ST OPL3 cartridge design, OPL3 Duo! interfacing, RetroWave OPL3 Express support

I had a little time in last months to do some work (,which was alot, I partially shared it on my Mastodon profile) on OPL3 support on Atari ST and up. I’ve created first OPL3 cartridge prototype schematics / made ST cartridge->OPL3 interface on proto board and designed an adapter for OPL3 Duo! board. I’ve got also some news about OPL3 Express support too..

OPL3 Duo! adapter

After some time spent with OPL3Duo! documentation and source code I’ve ran some samples on Raspberry Pi 400. Turned out that device uses SPI interface to send data (had to enable it on RPi400, because it isn’t enabled by default).

SPI interface maybe saves some wires, but sending data is awkward if it isn’t supported by hardware. Atari doesn’t have hardware SPI support, so I had to wire three signals to Centronics port data lines, connect external +5V (OPL3Duo! supports 3,3V too, but using it might create problems when interfacing with Atari I suppose) and perform some bit banging with a simple test program.

I needed only data sending support for one device and used SPI mode 0, which OPL3Duo! uses. Adding reading from slave device is easy, but it needs one wire more. It wasn’t needed in my case, so I just ommited it.

After some development time logic analyzer started to decode expected values:

This lead me to Atari OPL3Duo! adapter design:

OPL3 Duo! to Atari LPT adapter schematics

And created prototype, which is very easy to make:

OPL3Duo! via Atari Centronics adapter prototype

I guess SPI could be implemented with cartridge interface too (about which I will write later), so OPL3 Duo! could also be connected directly to cartridge port, but in this case external power supply isn’t needed and power could be drawn directly from cartridge port. It of course would require another set of drivers.

As a next step I’ve wrote function, based on original sources, which selects OPL3 unit (there are two), sets register and sends data to OPL3.

Idea of adding second OPL3 is very tempting and now I’m considering adding second OPL3 chip on ST cartridge version now, because why not? :)

Atari ST (dual?) OPL3 cart

This is my first attempt to create dedicated OPL3 cartridge for Atari ST ever. At first I had no clue how to interface OPL3 with cartridge port – it’s read only, but we can deceive it.

I’ve looked through all available resources related to interfacing Atari ST cartridge and I’ve found some information in “ST Log Magazine” Issue 27 from January 1989 (p. 38, article “A 16-bit cartridge port interface” by Randy Constan). I took an idea of setting address signals and using two transparent D latches, when $FBxxxx address space is accessed (74LS373), so state of signals will stay after adress lane is changed and is not from cartridge address space.

Will it blow up and fry up Atari? Follow up in next episode….

I’ve also managed to finish schematics for a first OPL3 cartridge prototype: included all needed things like interfacing OPL3 with cartridge signals, hardware reset, OPL3 to YAC512 DAC connections, feeding clock signal to OPL3, connecting DAC to opamp’s and audio outputs.

From cartridge port there are pins for +5V/GND, Address bits (A1-15), UDS, LDS, ROM Select 3, ROM Select 4. On output latched cartridge address space bits.

Still waiting for a parts for full prototype and I still need to test ST cartridge interface board on real hardware (this bunch of wires above) with logic analyser to see if nothing explodes and signals outputs behave as expected, when accessing cartridge adress space. After that I will be able to finalise first pcb prototype. I believe I will switch to SMD and SMT parts then and send small batch to production.

So, this will be the base for further improvements. I’m considering adding separate audio output without any aplification (so could be feed for instance to Atari Falcon Audio In or external audio mixer), volume potentiometer for one amplified audio output(,so headphones could be attached) and probably introduce second OPL3 chip (,which could be used independently or driven by same input as the first one similarly like in OPL3Duo!). I’m also thinking about changing opamp’s used / upgrading DAC audio output circuits, currently I’ve ripped everything from YAMari by T0ri (hi!) for 8-bit Atari’s to speed up development a little.

OPL3 Express support (USB)

I’ve contacted Claude Labelle (Perdrixx), who develops USB drivers for Atari and he provided me functions (many thanks if you’re reading this!), which allow sending data from Atari USB to Retrowave OPL3 Express serial interface. OPL3 Express is a little different than other devices, because in this case we are not directly interfaced with OPL3 chip and we have to send data in serial using special protocol, which is decoded and ‘translated’ to OPL3 chip writes.

Soon I believe I will be able to create set of drivers for OPL2LPT / OPL3LPT, OPL3Duo!, OPL3 Express and create some kind of API, so it could be used more easily in programs / games. I plan to add loading existing instrument formats, supply custom players and add midi support.

So, this is a small round up for now.

If you like this project or others feel free to donate to help cover partially my development time and expenses related to hardware / electronics parts. Thank you!

O wpisie