SN76489AN sound chip

I am a complete noob here but excited about the forum community and hope that I might be able to lend your expertise about an issue that I'm having with regards to outputting a stable sound sample from a Texas Instruments SN76489AN sound chip.

I followed a tutorial over at:

http://danceswithferrets.org/geekblog/?p=93

But rather than using a clock, I have attempted to run a clock from the the Arduino Nano itself. I managed to find some resources that puts out a 4Mhz output on pin 11, so I slightly modified the pinout on the sketch provided on the tutorial (Link above).

Most notably, the changes occur in the pin out definitions:

const int kPin_D0 = 2;
const int kPin_D1 = 3;
const int kPin_D2 = 4;
const int kPin_D3 = 6;
const int kPin_D4 = 7;
const int kPin_D5 = 12;
const int kPin_D6 = 8;
const int kPin_D7 = 10;
const int kPin_NotWE = 5;
const int kPin_Clock = 11;
And also changes to output a 4MHz output on PIN11. (Albeit, I'm ultimately guessing about this entire setup).

pinMode(kPin_Clock, OUTPUT);

TCCR2A = ((1 << WGM21) | (1 << COM2A0));
TCCR2B = (1 << CS20); // prescaler = 1
TIMSK2 = 0;
OCR2A = 3;

The complete modified sketch can be seen here:

I have followed the pin out schematic, found at:

http://www.vgmpf.com/Wiki/images/7/78/SN76489AN_-_Manual.pdf

I have included an image of my breadboard which is admittedly difficult to make out but I've included it for completeness.

I'm also confused about the output enable pin, so for now I have tied that to ground since I believe it to be active low, but this might be an issue?

So, to the problem. I am hearing clicks and pops and bits of audio and such, but nothing that resembles what I would be expecting to hear. I'm relatively sure that the chip is being clocked as I've played around a little with a few register values and have been able to get some tonal sounds out, but it definitely seems like there is something about the sketch, or perhaps the pins or even perhaps the endianness of the data. If anyone is able to help trouble shoot this, I'd be most grateful.

Many thanks

I recently wrote a library for this IC. You can find it here (GitHub - MajicDesigns/MD_SN76489: Library for SN76489 sound generator) or from the library manager on the IDE. It also uses the CPU to generate the 4Mhz clock.

You may be able work out what is wrong with yours by to looking at the code, or just use the library as is to test your own hardware.

There is a also a series of blog posts about what I worked out/did for this project here (Making noise with a SN76489 Digital Sound Generator – Part 1 – Arduino++).

I'm also confused about the output enable pin, so for now I have tied that to ground since I believe it to be active low, but this might be an issue?

This should not be a problem. What is more likely an issue may be that the analog and digital grounds are too closely coupled and you are getting digital switching noise on the analog sound output. Breadboards are pretty terrible for audio projects as well, so that won't help.

What also doesn’t help is the lack of supply decoupling on the chip layout. In addition to the normal 0.1uF ceramic capacitor you also need a large capacitor with audio chips. Something like a 470uF.

Hi marco_c

These articles are great! I did notice that you have an image of the SN76489AN chip in your article and then your pinouts are slightly different to the datasheet that I linked to in my original post. I'm hoping that this is where the confusion has been so can you confirm that you were using the AN variant of the chip?

Many thanks

marco_c:
I recently wrote a library for this IC. You can find it here (GitHub - MajicDesigns/MD_SN76489: Library for SN76489 sound generator) or from the library manager on the IDE. It also uses the CPU to generate the 4Mhz clock.

You may be able work out what is wrong with yours by to looking at the code, or just use the library as is to test your own hardware.

There is a also a series of blog posts about what I worked out/did for this project here (Making noise with a SN76489 Digital Sound Generator – Part 1 – Arduino++).
This should not be a problem. What is more likely an issue may be that the analog and digital grounds are too closely coupled and you are getting digital switching noise on the analog sound output. Breadboards are pretty terrible for audio projects as well, so that won't help.

Yes, it is AN. There were 2 versions with the same pinout, A and AN. As per the data sheet, the A has a 500KHz clock.

I used the same datasheet as you, so there should be no difference in the pin assignment (section 8 of the document). Looks like the geekblog site you posted disagrees with the manufacturers document (I think he has numbered the bits D0 to D7 in reverse, although the datasheet makes it clear D0 is the MSB so there should be no confusion how to send the bits across).

This was actually ridiculous since it seems to have been caused by poor connections on the breadboard and was in fact working all along. It believe it to have been related to the grounding wire and another wire around D5 or D6.

The resources that you've provided are really a great next step for me so thanks and I'll now take a look at where those capacitors might fit into this thing (Hopefully to stabilise the poor connections)

Many thanks to you!

(Hopefully to stabilise the poor connections)

Sadly not.

As to what they do and why they are needed see this:-
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html