ESPboy PT3 - AY-3-8910 music player, using standard speaker or additional ESPboy PCM5102 I2S DAC module for better sound quality
initial version by Shiru
https://www.patreon.com/shiru8bit
This is a PT3 format chiptune music player. The format is kind of standard de-facto for AY-3-8910 chiptune music on Russian ZX Spectrum clones. About ten thousands songs has been made since mid-90s when it was first introduced.
The program emulates AY sound chip and plays PT3 files loaded into the SPIFFS. The sound is output through the sigma-delta modulation based DAC via the built-in speaker. It also supports i2s stereo DAC if connected (change define in the sketch, no run-time option to switch between outputs at the moment).
Programming lesson learned: do not use sigma-delta while accessing SPIFFS, it crashes the device (i.e. disable sigma-delta while accessing files).
I have included some of my own music to test it out. See zxtunes.com or the TrSongs archive to get much more.
You can buy this DAC module ready-made or make it yourself.
- PCM5102 module link to buy
- VIN -> VCC
- GND -> GND
- LCK -> G2 (GPIO2 / D4 / I2S0-WS)
- DIN -> RX (I2S0-DATA)
- BCK -> SS (CS / GPIO15/ D8 / I2S0-BCK)
- SCK -> 10k resistor -> GND
NOTE1: Before compilation, set Arduino IDE settings
- Board: ESP8266 WeMos D1 mini
- !CPU frequency: 80Mhz
NOTE2: After compilation upload music files to SPIFFS