Now Reading
The substitute of YM2151 – Wired && Coded;

The substitute of YM2151 – Wired && Coded;

2023-12-22 03:21:12

This doc discusses the FM sound synthesis within the Commander X16 and in my x65 computer.

Sound in Commander X16

Sound in Commander X16 is generated by two sources which are combined collectively:

  1) by the Programmable Sound Generator (PSG) in VERA FPGA, and

2) by the MIDI FM-synthesis chip YM2151.

The next image is a block diagram of the sound subsystem in C’X16:

The PSG in VERA FPGA is a stereo sound generator loosely primarily based on SID. It helps 16 channels (voices) and PCM playback. There isn’t any ADSR or filters. This should be offered by software program. The PSG is an integral a part of VERA FPGA consumer logic that additionally generates the VGA video output. MIDI-like sound synthesis is offered by YM2151. Yamaha known as it an FM operator Sort-M (OPM). That is how the chip appeared like:

The chip outputs sound digitally as a 10-bit mantissa / 3-bit exponent samples, two channels (left and proper), on the audio pattern frequency of about 55 kHz. This digital sound stream is transformed to an analog sign utilizing particular a D/A converter YM3012, additionally developed by Yamaha. The image under illustrates the fundamental circuit, as taken from the datasheet:

YM2151 was created by Yamaha in 1980’s, being utilized by Atari and Sega arcade programs beginning in 1984. As of 2023, this chip is maybe 1 / 4 of century out of manufacturing. The chip interfaces with then-standard 5V TTL logic, and the D/A converter YM3012 even requires +/- 12V rails for its analog output.

Precept of FM Sound Synthesis

FM sound synthesis is kind of advanced matter and I don’t declare to grasp it so nicely. I’d suggest the next article which gives some background and particulars:

https://www.perfectcircuit.com/signal/what-is-fm-synthesis

Sound in x65

I used to be on the lookout for a contemporary software program suitable substitute of those chips and, for the reason that structure is exclusive, the one sensible resolution is through an emulation in FPGA. I needed to make use of a Lattice iCE40 FPGA, to maintain consistent with the remainder of my x65 design (each NORA and VERA are iCE40 FPGAs). There are a number of YM2151 emulations for FPGA obtainable on the open-source web; I discovered two: jt51 and IKAOPM.

The issue with each, or fairly the issue with the unique design is that it’s utilizing numerous flip-flops as delay shift-registers. That is really not an enormous deal for contemporary FPGAs from Altera/Intel or Xilinx/AMD, as they might implement shift-registers effectively in LUTs. However an previous structure like iCE40 struggles and is compelled to make use of numerous primary logic blocks to implement these shift registers. Due to this fact, jt51 couldn’t be used as a result of it doesn’t slot in an appropriate FPGA of the iCE40 line. The IKAOPM, after some configuration (USE_DPRAM=1), fortunately suits within the 5K system (ice40up5k-sg48) – allocating round 80% capability of the 5K system.

I name the FPGA system implementing the suitable FM-synthesis “AURA”, from AUdio Retro Adapter. It’s Lattice ice40up5k-sg48 FPGA, the identical sort used for VERA, so the x65 has twice the identical FPGA on the board – for audio and for video. The emulation foremost half is completed by IKAOPM undertaking, which is a verilog synthesisable reproduction of the YM2151.

The image under reveals the sound subsystem of x65:

AURA outputs the sound within the stereo 16-bit I2S format, which is transformed to the analog sign by the WM8524 D/A converter. The PSG sound from VERA can be in the identical I2S format. AURA has an auxiliary I2S enter for the PSG sound; mixing of each sound sources is completed digitally in AURA.

Implementation on the x65 Board

The picture bellow reveals the x65 audio/video board with the VERA and AURA FPGAs labelled. The DAC chip and the audio and video output connectorsare additionally seen and marked.

Value Comparability

Each Yamaha chips are lengthy out of manufacturing (discontinued). It isn’t doable to purchase them from regular distributors of digital components  like Mouser, Farnell, Digikey and many others. The Yamaha chips are usually available on ebay from numerous sellers, in numerous portions and costs. A quick ebay listings overview reveals that the D/A YM3012 prices round 1 EUR/1pc, and the FM-synth YM2151 round 9 EUR/1pc. Due to this fact the entire price utilizing Yamaha components could possibly be 10 EUR, plus the analog sound mixer.

The AURA FPGA, ice40up5k-sg48, prices round 9.30 EUR/1pc, or 7.8 EUR in 100-piece amount. To this we must always add the price of one SPI-Flash reminiscence essential to retailer the FPGA bitstream; I take advantage of W25Q16JVSNIQ which prices 0.45 EUR/1pc. I don’t calculate the price of the D/A converter WM8524 since it’s equally current in each resolution (for VERA PSG). Due to this fact, the entire price utilizing AURA FPGA is round 10 EUR in 1pc amount (or higher, if purchased in amount).

Demo

Calliope is a participant / jukebox software for Commander X16. It could actually play information within the ZSM format. It helps output by way of the VERA PSG and YM2151 FM-synth. It is a picture od Calliope working on X65 {hardware}, enjoying a sound file by way of the AURA:

Conclusion

In conclusion, the answer with AURA FPGA has the next benefits:

* the identical or higher price,

* direct interfacing with the three.3V LVTTL logic used within the x65 design,

* good availbility of chips at distributors,

* not requiring +/- 12V for the DAC,

* smaller complete footpring dimension on the PCB due to small part packages.

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top