Topic: Reverse engineering of a music greeting card chip
May be a very interesting read to some, the reverse engineering process of a music greeting card chip. There are numerous chips of this kind, but they're function much alike, so it is very likely they're all share a very similar design. Read the original tweets or a condensed thread.
TL;DR - it is a hardwired machine with a 64-byte ROM that uses 4 bits for pitch and 2 bits for duration. No real computations are going here, it is not an MCU of sorts, just a very simple state machine. The most interesting part is how it produces the frequencies. I was wondering on this matter in the regards of the Game & Watch, with its 32 kHz oscillator, and it seems this one uses the same trick: an RC generated 32 kHz source get divided with a 7-bit LFSR instead of an actual counter, which is also cheaper on the transistor count. Actual pitch for the 16 notes is pre-programmed with the values loaded to the LFSR, so it is not square wave, but some bit patterns unique for each note.
As it is a mask ROM hardwired non-programmable chip, we can't really reprogram one for our needs. However, we can emulate it with a modern MCU, and drive it with a custom 64-byte sequence. Like, the tiniest ATTiny10 should be able to do the trick easily (and it has 1024 bytes, enough for a dozen of the short songs).