An alternative firmware for STC15F2K60S2-based game kit that turns it into a musical instrument.
Because just soldering few parts together and playing Tetris for few minutes is not fun enough.
This firmware requires some changes in original kit schematic:
-
Reconnect resistor from
P5.5(pin 19 of MCU) toP3.5(pin 26 of MCU). This connects audio amplifier input to hardware output of timer T0, so no (interrupt) code is required to output the signal, MCU hardware does it automatically. This change is necessary for the device to play any sound. -
Connect
P1.5(pin 14 of MCU) to pin 3 of 5631AS seven-segment indicator. Pin 6 of the indicator is missing. This connection enables displaying dots on the seven-segment indicator, so it's not really critical for device function.
The STC15F2K60S2 MCU can be programmed using a USB to TTL serial converter, connected as follows:
MCU pins Converter pins
[22] -------/\/\/\/--------- [RxD]
300R (330R)
[21] ----------|>|---------- [TxD]
(diode)
Most likely, any converter will work. I used a CH340-based one.
Be sure to select the right MCU type and system clock frequency in the programming application.
This project uses MCS-51 assembler (as31) created by Paul Stoffregen.
The firmware is assembled by the following command:
as31 -l pixel_play_boy.a31If you want to have different tone range, tempo options or use a different MCU frequency, you can change constants in generate_freq_tables.py, run it
python3 ./generate_freq_tables.py > ./freq_tables.a31and replace the tables in pixel_play_boy.a31 by new contents of freq_tables.a31.
One of names present on the kit I've got was "Pixel Game Boy". With this firmware this thing still plays, but not games, so...
Another attempt to rewrite firmware of similar device, 1, 2, 3
Full sources of original firmware, direct