25 Years Old
Norwegian Male
Saskatoon, CA
Contributed by MicroMinded
Well that sure didn't take long!
I just put the finishing touches on on my Windows -> Serial -> AVR -> YM2149 music player, I call it YMstream as I like to point out the obvious. The is a very easy project to wire up and I do not have a schematic and don't think anybody will need one either. Here is how to do it:
I use a Mega164P with 8MHz crystal in a DIP package to make breadboarding easier, in software the mega is ran at 4MHz.
Sounds much harder than it is, its only 5 resistor and 9 wires to get it working. Please note that the YM2149 cannot run faster than 4MHz so if you want to use a faster AVR then you need to supply the YM with its own oscillator. I chose not to because I have no crystals slower than 8MHz and I wanted to keep the project easy.
Here is an audio clip from the project to bring back some memories!
Captured via digicam between headphones (Very good quality sound!)
Earlier on in the project (yesterday) I had planned on just sending the data address then data and bouncing between the two but when I first tried to stream it was a world of noise. The first transmission error and the registers and data would be going to the wrong locations and the SSG would freak out. The solution to this is not very elegant, I just tossed in a character check for each transmission and then allowed the next byte to goto the proper register. So when you want to send an address preceded it with 0x00, and precede data with 0x31. (eg. Tone on chA: 0x30 0x00 0x31 0xFC)
Their is a lot of room for improvement such as decoding the *.psg file in the player, adding play/pause, allowing the +/- to adjust the delay, maybe an interface even? I move in 3 days so will not be able to play with any hardware but I might whip up an interface and try my hand at decoding the psg's as I know what format everything needs to be dumped out in. A handy tool for this is a virtual comm that allows you to re-direct say COM4 back to your on board COM1. That way you can check the output thats actually leaving the serial port without needing to dump a lot of printf's to the console.
Another thought is that I opened a file to allow access to the comm port and apparently you can do the same for LPT's. I am unsure how you would set status and control bits but I might take a peak at that before writing anything else as it would be nice to do away with the AVR and just have a simple LPT interface. Would make the project cost nearly nothing (IF you find a SSG that is...)
Source is available for download from my Sourceforge