You may have never heard of the Texas Instruments SN76489, but if you are reading this article, there’s a good chance you have heard it.
The SN76489 is a sound chip which, according to the Wikipedia entry, was used in systems such as:
- ColecoVision (and it’s home computer counterpart, the Adam)
- Sega Game Gear portable (a clone chip)
- Sega Master System (a clone chip)
- Tandy 1000 (and the IBM PC jr?)
- Texas Instruments TI-99/4A (earlier variation)
…and in arcade games such as:
- Lady Bug
- Mr. Do! and its three sequels.
- Time Pilot ’84 (clone chip)
- Congo Bongo
…and many more. I am just naming the machines and games I have heard of or seen/played.
Side Note: The Wikipedia entry also claims the Sega Genesis used one, but it had far fancier sound. A quick search shows the Genesis did not use this chip, so other systems may also be incorrect. Ah, Wikipedia…)
This chip is able to produce three tones and one white noise at a time, which sounds an awful lot like the audio capabilities of my first computer, the VIC-20.
The chip has none of the fancy synthesizer features found in other chips, such as the famous Commodore 64 SID chip. The only thing you can do is adjust the volume level of each channel of sound. Clever software uses this to produce bell sounds and other effects. (If Congo Bongo is really using this chip, it’s doing some fancy things to make those bongo sounds!)
Thanks to StrongWare‘s John Strong, I now have one of these chips to experiment with. It is wired up to an Arduino Nano clone. (NOTE: I had issues getting this clone recognized on my Mac, due to it using a different serial chip. I found the solution, and wrote about it earlier this week.)
John pointed me to this short tutorial on how to use the chip:
Using sample code there, I was able to get the device making tones, and then expanded it to play a sequence of tones to make a tune.
The next day I added more code so it could do a multitrack sequence.
I thought it might be fun to share what I have learned the first two days of playing with the device, and share the code I have come up with.
I will do a full article on the chip and how it works (summarizing some overly complex explanations I have been reading), but until then, here is my sample project:
It contains routines to poke bytes to the SN76489, plus a work-in-progress multitrack music sequence that currently plays the 2-voice intro music to Pac-Man :)
I’ve been fixing up the comments and squashing some bugs, so check back for the latest. I still have to add real/better support for the “noise” channel, but it works right now for playing simple tunes.
More to come…
Pingback: Introducing the Sir Sound CoCo Sound Card | Sub-Etha Software
I’m getting a srange hummmmm sound which wont go away. Music is played, with that humm.
The Arduino Nano and SN76489 are connected as on the http://danceswithferrets.org/geekblog/?p=93 page.
I tried your MusicSequencerTest.ino too. It worls fine. The hummm dirves me nuts.
– Arduino Nano
– 4 Mhz clock osc.
– SN76489AN audio chip.
All help appreciated!
Yeah, it’s noisy. There may be some circuitry that could be added to reduce the hum, or it could just be the cheap part is noisy. Mine has a hum but it’s not too bad unless you turn the volume up.
Thanx! It was solved by using adding LM386-chip mini amp from audio out to gnd.
I’ve posted a short demo here –> https://www.youtube.com/watch?v=2yiJwjH7VW8 in my dev update.
@Michiel, I can answer the question for your Hum :-)
By default when the SN76489 is powered on, it emits a continuous tone on channel 2, to let you know that it’s getting a clock signal and everything started up ay-ok.
Problem is, unless you initialize the chip in a very specific way, it seems to stick around like a bad smell, and is very difficult to get rid of. The reason it’s difficult to get rid of, is because of a bug in the hardware on the chip. I don’t know the exact details of the bug, but I do know it’s there, and how to stop it.
I was a dedicated Acorn BBC Model B dev back in the 80’s/90’s (Still am… ish :-) ) but I was also one of only a handful of people who figured out how to use that hum to force the SN to play back digitized sampled sound on a BBC Model B micro, and as a result was one of the reasons so many games had very primitive sample sounds in them on that machine.
ANYWAY… back to this….
I’m just on uploading all my project files for an arduino setup I put together, to allow me to playback actual BBC Model B music data from a PC, to an SN chip, using an Arduino to control the chip, it’s nothing flash, BUT….. if you look in the arduino code that’s there, you’ll see a function to correctly initialize the chip, and get rid of that annoying hum.
My Project is at:
Iv’e not finished the circuit diagrams yet, I’ll get them done soon, but all the codes there, and as soon as I finish typing this, I’m gonna upload a bunch of sample VGM files containing genuine SN76489 music data too.
@Allen – how about mentioning the BBC Micros A/B/B+/Master/Master 128/Master 512 and Master ET-Turbo too :-) No one who does anything with these wonderful little sound chips ever mentions them, they deserve a bit of the lime light too (Please) :-D
(@shawty_ds – on twitter)
I’ll take a look at your code. The BBC machines were never over here in the States, so beyond knowing that “BBC Micro” was a thing from some 80s computer TV show (probably a BBC show actually), I never heard of it until recent internet years. I also learned about the MSX, since it has an extended PLAY command in BASIC that does multi voice an I have a serial controlled sound player I am sorta modeling after that version of Microsoft BASIC.
Ah, that makes sense (The State Side thing) – Yea the BBC Micro was huge over here.
You had 2 groups of children in 80’s geek culture, you had your Sinclair Specrum/Amstrad crowd, they where the one that became the games players of the generation, and ultimately moved onto the Commodore Amiga & the Atari ST etc
Then you had your hardcore geeks that took things apart, build things, and generally abused machines like the BBC Micro (It’s hardware capabilities where immense for the time). The BBC Micro folks where the ones that went on to do careers in computer engineering, robots, communications, electronics all that kind of stuff, and ultimately grew up through the ranks ending with the Acorn Archimedes Series and RiscOS.
Ultimately though we all ended up on the PC Platform in one way or another :-(
If your really interested in this side of the pond, look for a book called “Digital Retro” by “Gordon Laing”, it covers the MSX, The BBC Micro and many, many more machines of the era both sides of the Atlantic.
Ultimately what I want to do with my version of the Arduino player, is to set it up so that it can be used by my BBC Micro emulator, and instead of emulating the sound, can use real hardware to play it.
What I want to do next, is to figure out how to program my Arduino so that it appears to windows as a USB Hid device, then write a driver of some kind for it that can then be detected, rather than depending on comports.
The circuit diagram (When I get it done) is almost identical to the one ‘danceswithferrets’ came up with, and if you need a source for the chips, there’s a number of suppliers here in the UK that seem to still have them available, I get mine from a company called “Electro TV Parts” (They have an eBay page).
I’d also recommend the doculemtary Micro Men for anyone interested in UK home computers of the 80’s.
It looks like my Radio Shack Color Computer followed a similar paths… over here, the Commodore guys were the gamers, and the CoCo folks go into multitasking OS-9 operating systems and device drivers and such.
Quite likely. I do know the Radio Shack (or it’s UK version which I owned at some point “The Tandy TRS-80” was a reasonably powerfull machine.
I have to confess though, I know very little about US geek culture. :-)
+1 for “The Micro Men”, great film just for watching, even if your not into that kind of thing.
I have a project called SirSound which uses a Microsoft BASIC PLAY command parser and a serial port. I hook it to my CoCo, and using the BASIC command to print to the printer serial port, and can make it play autonomous background music. I’ve done much work on the sequencer and such since I first posted this, so I will have to get a full update posted. I’ve learned much.
Well it’s been a LOOOOOOONG time since I touched anything like that. (I’m a profession software developer by trade by the way) , I’m more used to dealing with multi million line C#, Java and web projects these days, but I’m always happy to take a look at small bits of code here and there and offer my opinion and/or help.
I do embedded C programming, so Arduino hardware is not too much smaller than what my day job has me work on :-(
Sweet. Yea i was doing too much software and starting to miss the hardware side of things, thats why I started getting back into arduinos/pi’s etc.
I’ve never been a hardware guy, beyond soldering some serial cables, but I’m getting pretty good at plugging wires into breadboards and hooking things up. Having a blast! Wish I had learned this thirty years ago.
Thirty years ago, dang that’s almost as long as Iv’e been in the I.T game :-)
My first professional I.T job was in 1988, for a year while I studied one day a week to do a BTEC In computer studies. Then I swanned off and joined the Army for 3 years, did networks, radio, communications all that jazz, came back out circa 1992, wen’t on to university graduated with a 3 part degree in 1995 in CPU Design, Industrial Robotics and Software Engineering practices, wrapped up under an umbrella of “Computing for Industry”
Spent some time doing everything from Game music (Worked on a lot of the 1990’s era Amiga/Atari titles and late 90’s C64 titles) to being a sysadmin building data centers etc, then 4 and a half years in the comms industry working for orange as a radio access networks engineer.
I wrote a large chunk of the radio access software for the (Then new) 3G service they where rolling out in the UK.
Since then Iv’e worked all over the world, 3 of my biggest clients are in the USA, Iv’e had clients in the middle east, europe, australia, these days I’m happy just being a self employed code slinger with my own ltd company.
Keeps me happy, pays the bills and keeps me out of trouble :-)
I wrote my first bit of code however, way back in 1979 on a Sinclair ZX81 with 1k memory :-)
I’ve updated my SN76489 with I2c;
– PCF8574P I2C
– LM358 op amp
– 50k potmeter for volume control
– Arduino Nano as clock generator.
See here –> https://github.com/pappavis/EasyLab-retro-synth-SN76489/blob/master/KiCAD/SN76489%20arduino%20nano%20shield/plaatje/EasyLabMuziek%20editie_SN76489_3d_0.2.png
Coming here just to point out something:
“Side Note: The Wikipedia entry also claims the Sega Genesis used one, but it had far fancier sound. A quick search shows the Genesis did not use this chip, so other systems may also be incorrect. Ah, Wikipedia…)”
It does have it (specifically the same one as the Master System, with its slightly different noise generator), but it’s also coupled together with a YM2612 which is the one doing the fancier sounds. Probably the most iconic use of the SN76489 on the system is when Sonic jumps :P (there’s also the opening of Streets of Rage if you’re looking for music instead of sound effects, and the noise channel was commonly used for hithats in general)
Note: you won’t find any actual SN76489 chip if you look at the board since they integrated it into the same chip as the video hardware.
Thanks for this info! When I did some digging. I read it was the Master System chip, and just assumed whoever did that entry didn’t know the difference between those two Sega units.
On Streets of Rage II, the PSG is used quite a bit. Playing the VGM files and switching off the various output channels, it has quite an effect on the music and some of the digitised speech.
Thanks for sharing this info!
Clears up some confusion for me too. I always wondered, because I actually took a master system apart and could’t find the TI on it.
FYI. Updated my SN76489
– Added LM358 OpAmp and volume control.
– Changed shifregister to I2C
– Add 3.5mm stereo SRT jack for ouput
– Add onboard Piezzo speaker,
Latest version 0.7.01 of my SN76489 Arduino shield;
– Now only I2C
– Uses the library https://github.com/maxint-rd/mxUnifiedSN76489
– Onboard LM358 OpAmp with volume control
– Output via 3.5mm audio jack (type PJ-307)
Assmebled ready to use ==> https://github.com/pappavis/EasyLab-retro-synth-SN76489/raw/master/KiCAD/SN76489%20arduino%20nano%20shield/plaatje/EasyLabMuziek%20editie_SN76489_klaar.jpg?raw=true
Are these Shields available for purchase, assembled?
yes, check my Tindie store pre-assembled.
Looking Good :-)
The genesis did have an SN76489, but also had an OPN2 FM chip. You could use both simultaneously, but few games bothered with the older chip
Was the SN76489 in the Sega Master System?
No. The Sega Master System used a clone and it was added the Video Display Processor (IC5) the chip has audio out on pin 19. Sega’s implementation of the SN76489 is slightly different and that causes problems for people wanting to re-create the same music as the SMS or Genesis.