Oldschool 1-bit ZX-Spectrum chiptune on a domestic RISC microcontroller

    KP1878BE1

    Inspired by the topic, Tristan Peritsch's 1-bit symphony dug up a yellowed cardboard of 8 years ago in old rubbish. It turned out to be quite difficult to find the file with the firmware, upload it to the controller (LPT port? What is the LPT port?) And digitize the sound, but the resulting dose of nostalgia was worth it! Listen to the result> ( mirror ).


    I will give the pleasure to the author of the composition and the toy where it sounded to the commentators (and so that there was a video or picture!), And I will tell you a little about the technical side of the issue.

    The 8-bit RISC microcontroller KR1878BE1 was produced (and is still being manufactured) by the Russian company Angstrom. This instance has on board 1024 words of instruction memory, 128 bytes of RAM and 64 bytes of non-volatile memory. Unlike Microchip controllers, the instruction set is richer and they execute in 2 cycles instead of 4. Now, in terms of peripherals, it is far from assorting the same Microchip or Atmel, but the kernel is pretty good. And if I remember correctly, at the price he also won a little against competitors.

    The process of porting the audio engine, manual beat synchronization and cramming it into the limited resources of the microcontroller took a total of several days, but lasted for 3 months. Almost everything was done on the Spectrum and only compilation / debugging was performed at work where there was access to the PC. Apparently, does it really make sense in the expression “Constraints stimulate creativity”?

    The installation clearly does not claim to grace and aesthetic value, but among the spektrumistov this thing invariably caused delight, because they KNOW what kind of perversion it is from the point of view of the code:
    Demo board

    Device layout (in the classic ASCII version):
    Schematics

    It is worth noting that the digitized sound is slightly different from the original due to inaccurate selection of the face value of quartz. Ideally (at 7 MHz), 2 clock cycles of the controller should be equal to 1 clock cycle of Z80.

    The source and binary version of the firmware can be taken here .

    I answer the question of how all this was stitched. To fill in the code, the microcontroller, in addition to 5-volt power, requires 12 volts and three lines for data transfer. The recommended programmer circuit seems to be in the documentation for the chip, plus somewhere on the Internet a simpler circuit was found (or maybe it’s done independently, I don’t remember). It looks like it was assembled (like it erased all the dust :) It was
    Programmator

    connected either to a PC through an adapter for LPT, or to the Spectrum through a connector independently connected to the case and with nothing. It was controlled respectively by proprietary software under DOS, or by a self-written stray that seemed to be something better and even contained a simple decompiler:
    Software



    If I'm not mistaken, orangefox was the first to name the toy in which this composition sounded. This is of course Savage 3:

    Screen shot 1Screenshothot 2

    There are ambiguities about the author. In some places I have met the mention of Jason C. Brooke, but at least in the second part of the trilogy David Whittaker is mentioned.

    Also popular now: