7 ms·
Reverse-engineering a tiny 1980s chip that plays Christmas tunes
- kens 5y agoAuthor here if anyone has questions about the chip...
- hugolundin 5y agoI’ve been following your blog for a while and just wanted to thank you for your work. Keep it up! :)
- RodgerTheGreat 5y agoWhat is the "options" section in the block diagram? Does that represent the debug functionality you mention on unexposed pins? Anything else interesting that someone could do with these chips in a different package?
- vatys 5y ago> The chip has 3 pins, but there are 8 pads on the die. The other pins appear to be used for testing. By activating one of the pins, the chip can be put into a test mode. The test mode runs through the songs at 512× speed so the chip can be tested quickly without waiting for the tunes to play. The other test pins appear to expose other internal data for testing. This makes me wonder if you put one of the other test pins on a scope, if you'd see a pattern representing the song or sequence, allowing quick verification of the chip. I think at 512x speed, even a more limited storage scope of the era of these chips could capture the full output on-screen. Each flavor of the chip probably had an expected pattern based on ROM which could be checked. I'm imagining a technician sitting at a test bench, having to do verification work on these all day, thankful for having a test pin instead of having to listen to the same dang beeping song over and over :)
- kens 5y agoThe options are things such as staccato notes vs held notes or making the chip loop continuously. These are implemented in the logic section through connections in the metal layer to power or ground. In other words, different versions of the chip have the metal layer constructed slightly differently to obtain different behavior.
- vatys 5y agoThe block-diagram level breakdown of the different sections of silicon is really a wonderfully helpful way to look at this. It makes the zoomed in view of each section more meaningful. Then seeing the die photo of individual transistors or groups of them, next to schematic level interpretation, really drives it home. Thanks for making something so instructive. Have you decapped other sound-making devices? The greeting card chip makes me think of the ubiquitous "laser noise" chip from countless 80's kids toys. That or one of the many kid's keyboards or baby noise console devices, that have all of the function inside a single epoxy-blobbed die. It would be pretty fascinating to see a similar breakdown of which sections encode samples, note values, rhythm and sequences, control inputs, etc.
- scoot 5y agoYour description immediately made me think of the TI SN76577 "Complex Sound Generator" IC [1]. If I'm not mistaken it was used in the early versions of the MB Games Electronic Battleship game (think falling missile and white-noise explosion sounds). Edit: Not a decap, but this page [2] has links to the datasheet and other reference material that includes a block diagram, and even has circuit diagrams of the internal circuitry. Edit 2: A video [3] demonstrating some of the possible sounds. [1] https://en.wikipedia.org/wiki/Texas_Instruments_SN76477 https://en.wikipedia.org/wiki/Texas_Instruments_SN76477 [2] http://sandsoftwaresound.net/sn76477-complex-sound-generator/ http://sandsoftwaresound.net/sn76477-complex-sound-generator... [3] https://www.youtube.com/watch?v=atH1MvXDYYE https://www.youtube.com/watch?v=atH1MvXDYYE
- kloch 5y agoCan boiling sulfuric acid like you used to dissolve the epoxy package be used to successfully de-bayer a CMOS camera sensor?
- kens 5y agoMaybe; I haven't tried that. I don't know what the Bayer layer is made of; if it's glass, you'd need HF or something nasty.
- genewitch 5y agoYou'd think someone would have a service dedicated to this, but I've wanted a monochrome dslr or mirrorless for like a decade and a half, already. Preferably Nikon, but my limited understanding is that the canon sensors are easier to debayer.
- jcims 5y agoCrazy thing is you can buy the same sensors monochrome for industrial and astro applications but the cameras are twice as expensive. Eg Sony IMX455 61MP sensor in the $4k ASI6200: https://astronomy-imaging-camera.com/product/asi6200mm-pro-mono https://astronomy-imaging-camera.com/product/asi6200mm-pro-m...
- strenholme 5y agoThe cheapest I have seen an IMX455 in a new camera is $3000 for the Sony A7RIV when it’s on sale. And that doesn’t have a lens. Once one has a couple of lenses, a case, a tripod, filters, and memory cards, we’re in the $5000 ballpark. The IMX455 is an incredible hi end sensor; there’s only about three medium format sensors that exist with higher resolution—forget getting one of those for “only” $5000—but the cost of entry to have one in a usable camera is pretty substantial.
- kragen 5y agoNice work! How many transistors does it have in all? They could have used an LFSR for the PC too. Would that have saved some area? If not, I wonder why they used them elsewhere. Are the resets (on 10000...) synchronous? If not I wonder how they handled glitch safety.
- kens 5y agoI estimate about 1500 transistors. Yes, they could have used the LFSR for the PC; I've seen that in early microcontrollers. I actually expected to see a LFSR there. Maybe they wanted to have a linear ROM layout to make their life simpler. Yes, the resets are synchronous.
- kragen 5y agoThank you very much! I wonder if you could do a CMOS μC in 1500 transistors; my best ideas so far are barely under 3000. Of course to make music that way you need a much faster clock plus some code memory.
- RodgerTheGreat 5y agoThe Intel 4004 had 2250 transistors, and it was designed to work in concert with support chips, unlike a modern MCU. A quick search doesn't turn up any known models with fewer. 1500 for an MCU might be possible, but it'd be a tight squeeze. Registers and multiplexers chew through transistors rather quickly.
- kragen 5y agoThe 4004 had to go fast enough to run a calculator at 0.75 MHz though. A modern chip typically runs at 100 MHz and can run at 4 GHz. If you could fab it in indium phosphide (which wouldn't be CMOS!) you could maybe run it at 400 GHz and use an optical fiber as a delay-line memory, 1 bit per millimeter. This sort of thing might enable you to use less transistors than a 4004. I got down about that low with a bit-serial design whose only arithmetic instruction was a subtract, but I haven't simulated it at even the RTL level, just done a gate-level design on paper and a couple of software instruction-level sims.
- jhpankow 5y agoIs it possible that your "Structure of an inverter" image is mislabed? NMOS would be on the left and PMOS on the right. My thinking is the PMOS has the extra diffusion step to create the n-well for the channel under the gate.
- kens 5y agoIt's quite possible that they are reversed; I'm sort of guessing. PMOS transistors are usually bigger, so I think it's the one on the left. The chip could have n-wells or p-wells, so it could go either way with the extra diffusion.
- _joel 5y agoExcellent work Ken, as always. Love the detail.
- ashleyn 5y agoOne of my earliest memories is my grandmother giving me a musical christmas card that played a medley of Jingle Bells and Santa Claus is Coming to Town. I thought it was the cutest thing ever. This had to have been it. Thank you so much for reminding me of this old memory on Christmas. :)
- rvba 5y agoCan you post a video of all songs? My parents had that card when I was a kid, it really was great.
- bshep 5y agoAny idea where i can source some of the -01L or 01S versions ( or something similar ). My google fu seems to be rusty… Id like 5-10 for some projects with the kids.
- kens 5y agoSorry, I don't have any sources other than what turns up on eBay.
- linker3000 5y agoJust an 08 equivalent: https://kitronik.co.uk/products/2939-happy-birthday-melody-ic https://kitronik.co.uk/products/2939-happy-birthday-melody-i...
- TedDoesntTalk 5y ago> I dissolved the epoxy package in boiling sulfuric acid to expose the silicon die inside What!!?
- kragen 5y agoI take it you prefer boiling colophony? Or are you a nitric man? Or are you, like me, surprised that even little old sulfuric could handle the job?
- textcortex 5y agoI hope he did not inhale the fumes.
- authed 5y agoI wonder why it needs to be boiling...
- SAI_Peregrinus 5y agoIt's very slow with cool acid.
- kens 5y agoThe boiling sulfuric acid was not as scary as it sounds. I put the chip in a test tube with a small amount of sulfuric acid and heated it with a hot air gun outside. (I wore protective gloves and eye protection, and didn't breathe the fumes of course.) It took a couple of minutes to dissolve the epoxy.
- _joel 5y agoBehold, the Santasizer courtesy of LMNC (Highly recommended sub, if you like circuit bending, old tech being used to make music, Gameboy/Megadrive arrays etc etc etc) https://www.youtube.com/watch?v=qcqGqpI4qBU https://www.youtube.com/watch?v=qcqGqpI4qBU Merry Christmas!
- _joel 5y agoOh and flame-throwing pipe organs, as well, why not?
- textcortex 5y agoIt’s hard to imagine, how they designed this chips without having modern wafer design tools. Crazy
- retrac 5y agoCreating masks by hand at Intel corporation, c. 1970: http://images.computerhistory.org/revonline/images/500003094-03-01.jpg?w=600 http://images.computerhistory.org/revonline/images/500003094...
- pvitz 5y agoThe linear-feedback shift register method is also used for procedurally generating content in e.g. demos. Funny to see this implemented in hardware and it would be interesting to know when this trick was used firstly.
- NobodyNada 5y agoI don’t know the history, and I agree it would be fascinating to hear from someone who does — but the fact that we call it a “shift register” strongly suggests it was implemented in hardware first, because “shift register” is usually a hardware term rather than a software term. The earliest example of an LFSR I’ve seen is the Nintendo Entertainment System’s white noise generator, implemented in hardware. But many NES games used software LFSRs to generate random numbers for gameplay, so the trick was probably long-established and well-known at that time.
- kens 5y agoI don't know the full history, but a bit of searching shows that linear feedback shift registers were in use in the 1960s, so it's a pretty old technology.
- pvitz 5y agoIt's not about how old the technology is, but from when on it wasn't used as e.g. a pseudo-RNG, but rather for storing data. So, formally, still a RNG, but using a special seed to get a sequence that is equal to the data that one wants to store. I have found that "River Raid" (1982) and "The Sentinel" (1986) were using it for game data. Apparently, the original "Elite" was supposed to use one, too, but they decided against it.
- marcan_42 5y agoIt's common where area or performance are paramount, since it performs better than an equivalent (binary) counter in silicon. The Numerically Controlled Oscillator in the Apple M1 that is used to generate audio sample rates uses an LFSR as its first stage clock divider, and the driver has to load the right LFSR initializer value directly. It was fun working that one out. They use an LFSR because the input clock is a rather fast 1GHz or so, and dividing that down requires a bit of optimization. There are some 4-bit CPUs that use an LFSR as the program counter, so the ROM gets stored in pseudorandom order. It's fun how the lowest tech chips and the highest tech chips both end up resorting to the same old techniques, isn't it? :)
- zw123456 5y agoBack in 1980 when I was working on my Masters in EE, my capstone project was a chip that would play music. The problem was; that back then, the amount of ROM you could fabricate (at least at our facility) was limited to about 1K at best. I decided to take a music class to learn a little more about music and thought that would help me with my project. The professor would play various classical pieces and lecture about them. Our homework was to go in a listening room and familiarize ourselves with the music. Everything was on vinyl so you would put a record on, listen, take notes etc. When the first exam came, the professor would take out a record, and place it on a turntable and play a piece and you were supposed to identify it. I was amazed that all the other students seemed to be getting all of them and I was struggling. I went to the professor's office hours and I explained to him my project and what I was working on. He was very intrigued and suggested that I consider Bach especially Fugue's which has a lot of repetition and cycles (good advice I ended up using Bach Toccata Fugue in D minor, which is used a lot in old timey horror movies and I just loved it). Later, after talking with other students, they showed me their "system" which was crib notes with things written on them like "Blue label with yellow text = Bethoven", things like that. In other words, they were cheating. They were making crib notes about the record labels in the listening room and paying no attention whatsoever to the music. Since the professor was so nice to me, I decided to tell him about it. He listened to what I said, and he just said "I see", then asked me about my project. He asked if he could come when I presented my project and I was thrilled he was interested. But he seemed to continue to use the records and the same method, until the final exam when he announced to the class he was going to use a new system, a Tape Deck! You could hear an audible gasp in the classroom. Needless to say, a lot of students did not do so well on the final. I got an A. I also got an A on my capstone and the EE professors were all very impressed I had taken the time to research the music and my music professor got up and said a few words for me. It was a really cool experience in my life. I hope it is OK that I shared such a long boring story, but every time I see something about a music chip like the kind in greeting cards or whatever, it kind of reminds me a little of my project and how much I enjoyed that experience. As for the technology of the chip Ken covered, it is of course, quite a bit more sophisticated than mine was, at least as memory serves me (pun intended).
- picture 5y ago
- yc-kraln 5y agoThese chips are everywhere in Shenzhen--usually playing loudly when a gate is opening. It was a bit strange the first time I heard it. Of course, they have no cultural connection to these tunes, so it works fairly well as a warning.
- pilsetnieks 5y agoI wonder if someone could get the Apollo source code compiled and running on this chip to finally once and for all prove that old chestnut (i.e. the musical greeting card has more computing power than the Apollo Lunar lander)
- marcan_42 5y agoIt's not a CPU, so no... But if it were a microcontroller then it could've worked. The thing is you still need to look at slightly less ridiculously mass produced stuff for that, since the absolute cheapest stuff is still optimized to hell and back and won't include a CPU if it doesn't need one.
- AussieWog93 5y agoI had no idea this was a specialised IC that played this tune! I assumed it was a jellybean microcontroller, but thinking about it it makes a lot of sense. These must have been produced in the literal billions over the past few decades. For what it's worth, I've come across at least three variants of this particular chip that play slightly different versions of the Jingle Bells/Santa Claus is Coming to Town/We Wish You a Merry Christmas tune. In addition to the one in the video, there's one that holds a note for slightly too long during Jingle Bells ("oh what fun it is to ride" becomes "oh what fun it is - -", and another that repeats the first line of "We Wish You A Merry Christmas" a third time. I wonder if they're knockoffs, and if so how they're constructed!
- tluyben2 5y agoAs a kid I used open up those handheld games beginning 80s to try to figure out how they worked; most has just 1 blob on the pcb which contained the chip and not much more but I did get some good results, like a Pacman clone had 2 blobs; one if them was a music chip which contained 100s of tunes mosty unrelated to Pacman; by figuring out what was the power and what was the signal to select the tunes (there was not much choice and if I remember the correctly the signal was serial). Great fun. Took me a lot of time and the games would be broken afterwards; luckily my parents liked that I was learning stuff instead of playing the actual games.