Jump to content
IGNORED

SN76494 (or SN76489) Arduino project


acadiel

Recommended Posts

I'm playing around with a SN76494 (same as the SN76489 except it has a 500kHz maximum input clock rate), and attempting to hook it to an Arduino.

 

I'd like to hook up a speaker to the chip (probably that small Radioshack 9V battery amp that I have), and feed it either DATA from assembly programs or CALL SOUNDS from TI BASIC programs (TI-99DIR will come in handy for exports here), and have it "play" the TI songs.

 

Wikipedia has a great article with a pinout: http://en.wikipedia....ruments_SN76489

I've also found a guy who has a schematic here of something he did with a MIDI synthesizer: http://little-scale....ega-master.html

 

Being that I'm still not an EE by trade, and still have to ask questions, I figured I would ask a ton of stupid ones here in hope that I can get the end result up and running like I want.

 

First question:

 

1) The guy has a schematic with a 74HC14D up (which is doing clock generation, apparently). Is that still a good way to do it with the SN76494, or does someone have a better idea for a clock generator? What kind of pulse should I be doing? (Being that the 494 apparently has a 500kHz maximum input clock rate.)

 

As soon as I can get whatever additional parts in (like the 74HC14D if that's what I go with - I have tons of caps and resistors in my kits), I'd like to fire the thing up and write an Arduino program that just feeds the sound chip the equivalent of a CALL SOUND (1000, 440, 2) or something just to verify that it's working. I'll then fire up the other sound channels and noise channel to see if I can get some decent output in them, and then finally write a shell script (or even translating Arduino code) to import the DATA or CALL SOUND statements into the program to play the sound.

Edited by acadiel
  • Like 1
Link to comment
Share on other sites

Inverters (typically the 7404) are used a lot for making system clock circuits, and almost exclusively in coin-ops and home computers in the early '80s. The designers use the chips as MOS transistors (which is basically what they really are) and not necessarily as logic gates. You will usually see a tuned tank circuit on the output somewhere that sets up the frequency, and sometimes a divider stage or two. It is *definitely* in the EE realm, and I suggest you find a circuit that does what you need and copy it. I don't know if anyone here has the background to actually design such a circuit. You might try an electronics dedicated forum? EDA board is a good place.

 

You can also look at the ColecoVision schematics, Defender (coin-op) schematics, SpectraVideo 328 schematics, or Chapter 4 in the book "Microcomputer and Microprocessors, The 8080, 8085, and Z-80 Programming, Interfacing, and Troubleshooting" by John Uffenbeck. There is a complete description of exactly this kind of system clock generation in that book that looks exactly like all the Z80-based systems I have seen.

 

The 99/4A used the 9904 since it has a complicated 4-phase clock. Intel also made a clock generator and driver, the 8224. But I still recommend doing some Google searches and just find an existing circuit that does what you need. If you really want to generate your own clock circuit, for something in the 500KHz range you might look at a 555 timer.

 

As for getting noise out of the SN76489, remember that the chip "wakes up" with all channels ON and volume at FULL, so your first order of business is to shut the thing up.

 

There are also lots of Youtube videos of people who made dedicated circuits to drive old sound chips, so you might try a SN76489 search there as well.

Edited by matthew180
Link to comment
Share on other sites

I'm playing around with a SN76494 (same as the SN76489 except it has a 500kHz maximum input clock rate), and attempting to hook it to an Arduino.

 

I'd like to hook up a speaker to the chip (probably that small Radioshack 9V battery amp that I have), and feed it either DATA from assembly programs or CALL SOUNDS from TI BASIC programs (TI-99DIR will come in handy for exports here), and have it "play" the TI songs.

 

Wikipedia has a great article with a pinout: http://en.wikipedia....ruments_SN76489

I've also found a guy who has a schematic here of something he did with a MIDI synthesizer: http://little-scale....ega-master.html

 

Being that I'm still not an EE by trade, and still have to ask questions, I figured I would ask a ton of stupid ones here in hope that I can get the end result up and running like I want.

 

First question:

 

1) The guy has a schematic with a 74HC14D up (which is doing clock generation, apparently). Is that still a good way to do it with the SN76494, or does someone have a better idea for a clock generator? What kind of pulse should I be doing? (Being that the 494 apparently has a 500kHz maximum input clock rate.)

 

As soon as I can get whatever additional parts in (like the 74HC14D if that's what I go with - I have tons of caps and resistors in my kits), I'd like to fire the thing up and write an Arduino program that just feeds the sound chip the equivalent of a CALL SOUND (1000, 440, 2) or something just to verify that it's working. I'll then fire up the other sound channels and noise channel to see if I can get some decent output in them, and then finally write a shell script (or even translating Arduino code) to import the DATA or CALL SOUND statements into the program to play the sound.

 

As far as your clock signal goes you could just use an oscillator Jon. The more important issue would be using a clock frequency that ends up being the same or close to the one that gets fed to the chip in the TI. Otherwise your value/output frequencies are going to be different. IE you want the same tone produced on your device that is produced by a Ti for a given value I if you want to keep the data as is. I don't believe the sound processor really cares what freq the clock is provided it isn't too fast or too slow.

 

When you write data to the chip just pull CE and WE low. Monitor the ready line and wait for it to go high before you write any more data. Easy peasy.

 

You have to AC couple the output to your amplifier (or amplified speaker) but that's easy as well.

 

EE's ? We don't need no stinking EE's ;-).

Link to comment
Share on other sites

I don't know if anyone here has the background to actually design such a circuit. You might try an electronics dedicated forum? EDA board is a good place.

I am as far removed from the engineering world as you can possibly get, i.e. circumcision is probably as technical as I get by trade :grin: Nonetheless, I have found that Google can make you an instant expert on almost anything. I found this great page http://www.epanorama.net/links/oscillator.html which will tell you everything you need to know about oscillator circuits.

Link to comment
Share on other sites

... and then finally write a shell script (or even translating Arduino code) to import the DATA or CALL SOUND statements into the program to play the sound.

 

I did some work on a "MIDI file to DATA converter". Notes only. Ordinary ISR sound-list output. Now that you mention CALL SOUND, that could be an option too. Other plans were drums, custom player (small), envelopes, vibrato, sweeps and software sound emulation (load in MIDI file and listen to TI sound only emulation).

 

I tried to find a good and free MIDI recorder and editor, and somehow got stuck with Emagic’s Logic Fun 4.7. I would like something simpler and more user-friendly, something “easy” to share in the TI community. I’ve avoided Trackers, but that might be a way to go.

 

The noise is different because the SN76489 part you're using has a different noise generator configuration from the custom variant Sega put in the Master System et al. It seems they tuned it for more percussive noise rather than the staticy noise you're hearing.

 

Is this true ? It sounds plausible.

Link to comment
Share on other sites

Yes, the Sega noise generator has a longer period and a different tap than the TI one.

 

As for your clock generator, if you're using an Arduino anyway, why not just let it generate the clock for you? Should be able to set it up to generate a clock on one of the output pins (easiest might be to set one up for a 50% PWM output).

 

No extra parts needed! AVRs can do a lot. :)

Link to comment
Share on other sites

As for your clock generator, if you're using an Arduino anyway, why not just let it generate the clock for you?

 

Exactly what I was going to say! The processor itself is your friend. If you can write a clock generator routine on an NMI you should get a nice jitter-free clock signal.

Link to comment
Share on other sites

Just sort of a mini update as to where I am with this...

 

I have the Uno hooked up to the sound chip in the following manner:

 

Arduino Pin SN76489 Pin

----------- -----------

0 n/c (this is an i/o pin for the usb/serial)

1 n/c (this is an i/o pin for the usb/serial)

2 10 (D0)

3 11 (D1)

4 12 (D2)

5 14 (CLOCK) - Arduino Timer0

6 n/c

7 13 (D3)

8 15 (D4)

9 1 (D5)

10 2 (D6)

11 3 (D7)

12 5 (/WE)

13 6 (/OE)

GND 8 (GND)

VCC +5 16 (VCC)

n/c 4 (READY)

 

Since this SN variant takes a 500kHz or less clock, I next need to figure out how to initialize Timer0 to something like 244Hz or 61hz (dividing from the 16Mhz ATMega clock):

 

Value Divisor Frequency

0×04 256 244.140625 hz

0×05 1024 61.03515625 hz

Code: TCCR0B = (TCCR0B & 0xF8) | value ;

 

.. and then get it to run properly.

 

The Arduino has a great way to bit bang the ports (so to speak), PORTD (pins 0-7) and PORTB (pins 8-13). I need to create an 8 bit word out of pins 2-4 and 7-11 (darn timer had to be right in the middle there!) Still need to figure out how to do that. The guy running the serial port read does it this way, but it's still a little confusing because he's only setting two bits on PORTD, but six on PORTB?

 

Arduino Code
byte data;
int WE = 10;
int CE = 11;
void setup() {
Serial.begin(57600);
DDRD = DDRD | B11111100;
DDRB = DDRB | B00111111;
pinMode(WE, OUTPUT);
digitalWrite(WE, HIGH);
pinMode(CE, OUTPUT);
digitalWrite(CE, HIGH);
}

void loop() {
if(Serial.available() > 0) {
data = Serial.read();
PORTD = data << 2;  # 2 bits to PORTD or pins #0-7?
PORTB = data >> 6; # 6 bits to PORTB or pins #8-13?
digitalWrite(CE, LOW);
delay(1);
digitalWrite(WE, LOW);
delay(1);
digitalWrite(CE, HIGH);
delay(1);
digitalWrite(WE, HIGH);
delay(1);
}
}

 

Stay tuned.. still trying to figure this out :)

Link to comment
Share on other sites

  • 1 year later...

I'm playing around with a SN76494 (same as the SN76489 except it has a 500kHz maximum input clock rate), and attempting to hook it to an Arduino.

 

I'd like to hook up a speaker to the chip (probably that small Radioshack 9V battery amp that I have), and feed it either DATA from assembly programs or CALL SOUNDS from TI BASIC programs (TI-99DIR will come in handy for exports here), and have it "play" the TI songs.

 

Wikipedia has a great article with a pinout: http://en.wikipedia....ruments_SN76489

I've also found a guy who has a schematic here of something he did with a MIDI synthesizer: http://little-scale....ega-master.html

 

Being that I'm still not an EE by trade, and still have to ask questions, I figured I would ask a ton of stupid ones here in hope that I can get the end result up and running like I want.

 

First question:

 

1) The guy has a schematic with a 74HC14D up (which is doing clock generation, apparently). Is that still a good way to do it with the SN76494, or does someone have a better idea for a clock generator? What kind of pulse should I be doing? (Being that the 494 apparently has a 500kHz maximum input clock rate.)

 

As soon as I can get whatever additional parts in (like the 74HC14D if that's what I go with - I have tons of caps and resistors in my kits), I'd like to fire the thing up and write an Arduino program that just feeds the sound chip the equivalent of a CALL SOUND (1000, 440, 2) or something just to verify that it's working. I'll then fire up the other sound channels and noise channel to see if I can get some decent output in them, and then finally write a shell script (or even translating Arduino code) to import the DATA or CALL SOUND statements into the program to play the sound.

I have been working for several years with SN76494, developing the entire Hardware and Software interface.
At this moment, I've managed to run the chip sending data from the arduino, and after a long attempt to create a special keyboard, I finally decided to implement the MIDI protocol successfully. This is what you can get for now.
Check out the link below to see my project.
The original project with the specifications to run the project without MIDI
The Arduino code with the MIDI protocol.
You can see the operation of the project in the following videos
If you have specific questions you can contact me on twitter at @ SergioRAlvarezP.
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...