Help with an Arduino Micro and the AY-3-8912

I finally got a working version of an Arduino Micro and an AY-3-8912.

Anyway, I am following this tutorial:

The music plays just fine on Channel A but Channel B does nothing (and there is no code for Channel C).

I am reading over the data sheet for the AY-3-8912 ( but I’m just not understanding how the control registers work. I know I have a lot to learn on that chip but I was wondering if anyone had any idea why channel B doesn’t work?

When I try to play the music like:

	for(int i=0;i< 47;i++){
		set_chB(song[i][0]);  //    set_chA(song[i][0]);   works.   B does not.

I get nothing. And I’ve confirmed that I am connecting all three channels to the same speaker. Channel A works.

Any guidance on what I’m doing wrong (or simpler explanation of the AY) would be greatly appreciated.


Hi, did you get this figured out?

I have been reading and rereading the manual for the chip, and I still can’t get my chip to make any noise. However, I have read it enough to have some ideas about why your channel B might not be working.

Have you enabled channel B in the Mixer address? You would have to send the following binary 0b111101 to disable A and enable B.

Then, you would probably have to give channel B volume in the Amplitude address.

So, if you are using the tutorial code, you would change your setup to look like this…

void setup()
    //init pins
    pinMode(latchPin, OUTPUT);
    pinMode(dataPin, OUTPUT);  
    pinMode(clockPin, OUTPUT);
    pinMode(pinBC1, OUTPUT);
    pinMode(pinBCDIR, OUTPUT);        

    // Initialize the mixer of the AY

    write_data(0x06, 0x00);
    write_data(0x07, 0x3d); //<--enable channel B
    write_data(0x09, 0x0f);//<--give volume to channel B

…just keep in mind my chip doesn’t work at all. XD



Actually, no, I gave up on the AY. Not completely, I might take it back up.

But I received 10 SN76489 from eBay and managed to get it working pretty quickly. So I'm excited about that.

About to see if can stream a VGM file to it from an SD card.