Electronic – Which microcontroller to use to control Yamaha YM2612 arpeggiator

audiosynthesizer

Okay guys, I searched the forum and didn't find anything relevant. Here it is:

I am planning on building an arpeggiator project based on the Yamaha YM2612 IC which was the sound chip used in the Sega Genesis console. I ordered the chips online and am waiting patiently for them to get here, and meanwhile researching as much as I can to find out what I need to do to make this project work.

My question is: which of these microcontrollers would be the best to use for this project? (These are the microcontrollers I already own, although I could buy another one if none of the ones I have will work)

*-Arduino Uno R3

-PIC 18

-Raspberry PI

-Arduino Nano

-Teensy x.x* (I do not own one of these but this may be the best option based on other projects I have seen.)

I would guess that the PIC18 would be the best to use since I could program it in assembly language, but I am just now beginning to learn assembly language and C would be much easier for me. I saw a guy on YouTube who was using an Arduino Uno who built a project like this and it wouldn't run corrently, and he suspected that it was due to latency problems, so maybe the Arduino is out. Any help here is welcome.

For a little bit of background on the YM2612, it is a 6-channel FM synthesis chip with 4 operators which can be routed in 8 different configurations. It uses data exchange to write values to its internal registry to alter parameters like attack, decay, sustain, release, frequency, amplitude, etc. It is suggested to operate at a 7.67 MHz frequency and so I was planning on using an 8 MHz crystal oscillator (resonator) to provide the clock. Eventually I will integrate this project with a keyboard that outputs midi data (or maybe even bypassing midi, just using the microcontroller to control the chip manually) so I will be leaving this project open for further changes/revisions.

Also this is my first project of this type, I know it could be considered a big bite but I am here to learn. Any help is welcome, thanks guys

P.S.
Here is a datasheet for the YM2612:
http://www.datasheetspdf.com/PDF/YM2612/865751/1

…and here is a video of something similar:
https://www.youtube.com/watch?v=XlDlF1MOaUA

Best Answer

YM2612

This chip was designed to be used as a peripheral to 8 bit CPUs running at a handful of MHz. When you look at the "datasheet" (just a pinout, really), you'll find that there are three groups of pins you have to care about:

  • D0 to D7
  • Control pins (CS, WR, RD, A0, A1)
  • IRQ

The data bus is bi-directional, the control pins are input-only, and the IRQ is output-only. It is obvious that this chip was originally designed to be mapped into the address range of an 8-bit CPU, but none of the devices you have on your list can do that (to my knowledge).

What you need

There are two features you want on your board that will make your life easier, and this rules out a few of them:

  • 5 V I/O so you can hook the board up directly to the chip, without having to bother with level-conversion.
  • At least one complete 8 bit bi-directional port so you can write values directly without having to split your data up and write it several times.
  • 6 more pins for the control signals

This rules out the Raspberry Pi, the Arduino Nano, and some of the Teensy boards, and leaves the Arduino Uno, PIC, and some older Teensy.

I would consider these three more or less equivalently suited for your purpose. The latency problem you hinted is likely a newbie mistake, trying to use some software-delays in the Arduino. That just won't work for these things, you need a stable hardware timer to synchronize every write. You can do this with the integrated Arduino IDE.

Suggestion

Considering that you already have a PIC, and you seem to know how to program it in assembly (even if you're not yet comfortable doing so), I would suggest that this is your best option for a number of reasons:

  • Nothing is stopping you from programming most of it in C using MPLAB X, perhaps using a mix of assembly routines where you think it's required.
  • It has the requisite timers and interrupt mechanisms.
  • You already have one.
  • Depending on the PIC, you may be able to use its internal FOSC/4 clock output as your 8 MHz clock.
Related Topic