Spectrum Chiptunes On An STM

Some of us here at Hackaday are suckers for a bit of chiptune music as the backdrop for many excellent times. The authentic way to create chiptunes is of course the original hardware, but in 2019 it’s far more common to do so with an emulator on a modern computer. That computer doesn’t have to sport a high-end processor and desktop operating system though, as [Deater] shows us with his ZX spectrum chiptune player on an STM32L46G Discovery board.

The impetus for the project came he tells us while teaching students to code simple sine wave music players, having code already in the bag for emulating the classic AY-3-8910 sound chip on the Raspberry Pi and the Apple II he decided to port that to the STM32L476 dev board. An earlier version used the internal DAC, but this was refined to send I2S data to an external DAC. The code can be had from GitHub (confusingly buried among code for an LED driver), and we’ve attached a video below of it playing some chiptune goodness.

Of course, Sinclair chiptunes don’t grab all the limelight. There have been plenty of Nintendo and Sega players too. You might also recognize [Deater] from his non-chiptune work, porting Portal to the Apple ][.

5 thoughts on “Spectrum Chiptunes On An STM

    1. I would tend to agree — since the chiptunes are being simulated rather than being produced by the original chip.

      (In this case any chip capable of simulating them would work, and the cheaper, the better).

        1. Just to be clear, there was no soundchip in the original ZX Spectrum.

          The sound output was a nothing but a 1 bit digital output, no volume control, no DAC, it was all done in software. There was not even a dedicated hardware PWM. The sound was all made by the Z80 CPU microprocessor writing that output single bit latch.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.