YM3812 Part 2 – FACE Reveal

Post Categories:   YM3812 ModuleTags:   ,

16 thoughts on “YM3812 Part 2 – FACE Reveal

  • Tyler,

    This is really a great project…thanks for all the work you’ve put into it!

    I put in an order to mouser for an AVR128DA28, but I couldn’t wait to get started, so I substituted an Arduino Nano and I’m happy to say that with the Nano I’ve successfully generated the Fmaj7 chord. Unfortunately, I’ve not been so lucky with the AVR128DA28. I’ve been able to program it (the Blink sketch works, at least); the YM3812_Breadboard.ino sketch loads successfully, too, but when I replace the Nano with it and wire it up, nothing. I’ve rechecked the wiring and power circuit many times, so I’m a bit flummoxed by this. I suppose I can go back to the Nano, but I’d wanted to follow along as closely as possible with what you’re doing in the articles.

    Any suggestions?



    • Hey Peter, so glad to hear you are following along! Couple things to try:

      I’ve noticed that sometimes the AVR locks right at the beginning, but if you hold the reset button for a second or two and let go it starts working. I have no idea what’s causing that but it seems to work after a couple of tries. If you added the debug light, then it should be off when the thing starts up. If it is on, hit the reset button a couple of times.

      Another thought, did you change the sendData or setup functions to work with the pins on the NANO? You might have to change those back.

      Anyway, let me know if the issue continues. The NANO works for now, but once we get to drums, you will need more than 2k of RAM.


  • Tyler,

    Thanks for your reply! I’ve made a bit of progress, but still no sound, unfortunately. Mostly, when I apply power to the circuit, the debug light comes on solid…pressing, or pressing and holding, the reset button seems to have no effect, however. Occasionally, when I power up though, the debug light pulses in the rhythm of the Fmaj7 arpeggio, which seems right–I just don’t hear anything. I don’t know if there’s a fault in my breadboard or some other component, but I’m going to start fresh with some new parts. I’ll report back.


    • One other thought that I’ve been meaning to try… maybe see what happens if you use an older version of the DXCore library. I’ve noticed that the latest had some issues and ended up going back a version. But I think even that version might not play well. Maybe roll back a couple versions and see if that helps.

  • Tyler,

    Well, I got it working. Apparently, every time I wired it up for the Nano I connected SCK and MOSI correctly, but I must have consistently reversed those two connections whenever I hooked up the AVR. Also, after I switched to USB power instead of 9v battery power through a 5v regulator, the reset button started working correctly (I wired it like in the AVR data sheet, too). I also discovered that the program works with DXCore versions 1.45 up to the latest version (1.56). So, finally, I’m ready to move on to Part 3!!



    • Awesome! Glad to hear it is working! Should have an update in a week or so… next up, percussion! 🙂

  • I just realized why I kept mis-wiring the AVR! On your schematic, SCK and MOSI are switched…SCK should be on pin 28 and MOSI on pin 26. I wish I would have checked this against the pinout diagram sooner!

    • /facepalm. You are totally right! Thank you for catching that. I will get that updated here pronto.

  • Ok, schematic is updated. It looks like it was just the labels, the wires themselves go to the correct spots. Again, thanks for the catch!

  • Is it possible to use a Teensy 2.0 with this? I am trying to use the AVR128 but I am unable to get dxcore in my arduino IDE, when I add the URL to preferences and open boards manager I get an erro downloading http://drazzy.com/package_drazzy.com_index.json message pops up. I even tried using Ardunio IDE 1.8.15 like yourself. When I try to upload the code to the Teensy 2.0 I get an issue with portd.outclr.

    Man I really want to follow along, I have dreamed of doing a project like this. Would love to do the RP2A03 someday, but I am hitting so many roadblocks. Argh.

    • Hey Joshua,
      This definitely won’t compile directly for a teensy. The Teensy labels their pins differently, so you will have to change any references to PORTD, etc. to correspond to the correct pins on the Teensy. You could probably replace them all with digitalwrite commands to the appropriate pins. I didn’t do that here because it is a bit slower. One note of caution on the Teensy 2.0, it only has ~2K of RAM, and you will definitely hit the limit of that in part 6.

      I poked at that URL a bit and it looks like the server might be down. Take a look at the installation instructions on the DxCore Github. They go through a manual installation process that might work. https://github.com/SpenceKonde/DxCore/blob/master/Installation.md

    • It looks like the drazzy.com site was down for a short time, but they got it back up within a day or two. You should be able to get the AVR128 dxcore board libraries now. Good luck!

  • Hi, I’m Manuel Perales, from Seville (Spain).
    Thanks for these greats posts and videos. I’m planning to buy a YM3812 chip to build a simple synth, probably with a different microcontroller. Looking to the schematic, I don’t understand why do you use a 74HC545, having in mind that there are many pins unused in the AVR. Wouldn’t it be better to connect directly in parallel, lets say port 1 of the AVR to the data bus pins of the YM?

    • Hey Manuel, Great question! I ended up using the 74HC545 to keep those extra pins free for other sections of the module. Eventually, we will need to add keys, a screen, a rotary encoder, and chip select lines for separate sound chips. In one of my earlier versions of the project, I just used the 8 pins of PORTD as the data bus, but then had to switch over to the SPI bus to save pins.

Leave A Reply

YM3812 Part 10 – Pitch BendYM3812 Part 9 – Synth CardYM3812 Part 8 – Velocity Sensitivity