VOGONS


First post, by stamasd

User metadata
Rank l33t
Rank
l33t

I've been thinking for a while, and the recent discussion about OPL3 vs OPL3-L pitch reminded me of it. Basically convert the OPL2 card into a ISA card with true OPL3 complete with glorious pseudo-stereo sound. 😀

I've rummaged over the datasheets and I think it's quite possible, in fact it shouldn't be too difficult at all. The way I plan it, it would be reusing the same PCB but with modifications. The OPL2 chip, its DAC and all the audio circuitry would be removed, along with small changes to remaining circuitry. Instead of the YM3812 there will be a socket in which a daughterboard will be plugged. On the daughterboard there will be the YMF262, its DAC and 2 separate audio pathways for the 2 channels. The autput would either be through a jack on the daughterboard, or looped back to the main board and reusing the existing socket there.

Main issues that I see (just quick thoughts for now)

1. Clock. The YM3812 needs division of the ISA clock of 14.318MHz by 4 to generate the OPL2 clock. The YMF262 can use the ISA clock directly. That would eliminate the 2xLS74 chips used to divide the clock currently, which would be instead jumpered to the YMF262 directly

2. Output. Obviously since we would be getting 2 channels instead of one the audio circuitry would be doubled on the daughterboard. Consider using another OpAmp instead of the nonstandard and hard-to-find RC4136.

3. Addressing. Thge YMF262 has 4 available channels controlled by 2 sets of registers; the YM3812 has only 1 channel and 1 set of registers. The 2 sets on the former are selected through an additional signal, A1 which is not present on the OPL2 chip. That extra line only matters if you want to use the alternate set of registers that controls channels C and D - which we don't; channels A&B will suffice. Thus we tie pin A1 of the YMF262 to GND and be done with it (and make sure that the DAC is connected to channel A+B output only). The rest of the address decoding circuitry remains the same.

What do you think of this project? I'm open to suggestions.

(These are just some quick thoughts I have had for this and some preliminary planning, I'm nowhere near to implementing it in real hardware).

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 1 of 5, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie

Neat idea. I can help with hardware design if you like. I don't know how useful the Sergey's board would be as it requires so much modding. Also keep in mind that some games or software might check for the card to actually be something like Sound Blaster or PAS or whatever before it uses OPL3 features. If you only make pure OPL3 card then many games would most likely use it as standard Adlib (pure OPL2) card.

stamasd wrote:

1. Clock. The YM3812 needs division of the ISA clock of 14.318MHz by 4 to generate the OPL2 clock. The YMF262 can use the ISA clock directly. That would eliminate the 2xLS74 chips used to divide the clock currently, which would be instead jumpered to the YMF262 directly

I'd suggest at least to buffer the signal to have it conditioned a bit, instead of jumpering it directly.
Another thing is that many sound cards, for some reason, don't actually use the ISA 14.31818 MHz signal but have a separate crystal to generate this frequency onboard the sound card.
On some sound cards, there is a slight problem of the frequency being maybe 14.32 MHz instead, but some may have gotten used to it.
I'd maybe put a jumper to select either onboard crystal or ISA OSC, and this even gives the possibility to run the OPL3 at some other master clock frequency, like maybe on some arcade systems. It can run at frequencies between 10 to 16 MHz if I recall.

stamasd wrote:

2. Output. Obviously since we would be getting 2 channels instead of one the audio circuitry would be doubled on the daughterboard. Consider using another OpAmp instead of the nonstandard and hard-to-find RC4136.

It may not be so hard to find, but it is definitely archaic, and not suggested for OPL3 DAC. What makes a real Adlib to sound the way it does is the combination of the RC4136 op-amp and the low pass filter (and the speaker amp etc..) More recent OPL3 cards have "better" op-amps like TL074 but very few sound cards I know have a low pass filter after the DAC (Adlib GOLD might have it, I haven't got a card so I haven't double checked). This can alter the timbre noticeably. Also the OPL3 DAC uses demultiplexing of single DAC output to two sample/hold outputs for getting two channels out, a better op-amp is suggested in datasheets. If using standard pinout devices and DIP sockets, you could swap op-amps as you like, within reasons of course (very fast op-amps don't like to be on sockets and they could become unstable). If someone thinks TL074 is too mainstream, it would be possible to use something more audio grade like OPA2134 or NE5532.

stamasd wrote:

3. Addressing. The YMF262 has 4 available channels controlled by 2 sets of registers; the YM3812 has only 1 channel and 1 set of registers. The 2 sets on the former are selected through an additional signal, A1 which is not present on the OPL2 chip. That extra line only matters if you want to use the alternate set of registers that controls channels C and D - which we don't; channels A&B will suffice. Thus we tie pin A1 of the YMF262 to GND and be done with it (and make sure that the DAC is connected to channel A+B output only). The rest of the address decoding circuitry remains the same.

No, that is not right, it does not control channels C and D. You need A1 signal if you want to go into OPL3 mode and to use the other 9 channels. Otherwise you are limited to OPL2 compatibility mode only (9 channels, 4 waveforms, 2 operator channels, monophonic, no panning whatsoever). But when in OPL3 mode, you have all 18 channels and 8 waveforms, and can use 4 operator channels. The side effect is that in OPL3 mode, you can freely select to which instrument channels (1..18) are connected to which output channels (A..D).

Hmm, why not add circuitry for optional second DAC as well to have 4 channel output.

Reply 2 of 5, by stamasd

User metadata
Rank l33t
Rank
l33t
Jepael wrote:

Neat idea. I can help with hardware design if you like. I don't know how useful the Sergey's board would be as it requires so much modding. Also keep in mind that some games or software might check for the card to actually be something like Sound Blaster or PAS or whatever before it uses OPL3 features. If you only make pure OPL3 card then many games would most likely use it as standard Adlib (pure OPL2) card.

Thanks for the offer, I may take you on it. 😀 Actually I don't think too much modding would be involved - like I said, a plug-in daughterboard where the YM3812 currently is. Since the YMF262 and YAC512 are small SMD chips it wouldn't even be a large board (the audio circuitry will take more real estate though unless made SMD also). Also I think the detection problem wouldn't be a real issue if you use this in conjunction with another sound card that has its FM disabled, or moved to another address.

I'd suggest at least to buffer the signal to have it conditioned a bit, instead of jumpering it directly.

Good suggestion; though will take an extra pin to deliver the clock signal to the daughterboard (where the buffer chip would be placed)

Another thing is that many sound cards, for some reason, don't actually use the ISA 14.31818 MHz signal but have a separate crystal to generate this frequency onboard the sound card.
On some sound cards, there is a slight problem of the frequency being maybe 14.32 MHz instead, but some may have gotten used to it.
I'd maybe put a jumper to select either onboard crystal or ISA OSC, and this even gives the possibility to run the OPL3 at some other master clock frequency, like maybe on some arcade systems. It can run at frequencies between 10 to 16 MHz if I recall.

Hmm, what would be the advantage of using an on-board oscillator instead of the ISA clock? Stability maybe? BTW a discrete 14.32 MHz oscillator doesn't exist; Mouser carries a 14.32MHz ceramic filter, and that could possibly be used to make an oscillator, but I don't think it would be too stable (ceramic not quartz) plus it is not stocked and has a lead time of 52 weeks. 🙁 I guess 14.318 will have to do.

It may not be so hard to find, but it is definitely archaic, and not suggested for OPL3 DAC. What makes a real Adlib to sound the way it does is the combination of the RC4136 op-amp and the low pass filter (and the speaker amp etc..) More recent OPL3 cards have "better" op-amps like TL074 but very few sound cards I know have a low pass filter after the DAC (Adlib GOLD might have it, I haven't got a card so I haven't double checked). This can alter the timbre noticeably. Also the OPL3 DAC uses demultiplexing of single DAC output to two sample/hold outputs for getting two channels out, a better op-amp is suggested in datasheets. If using standard pinout devices and DIP sockets, you could swap op-amps as you like, within reasons of course (very fast op-amps don't like to be on sockets and they could become unstable). If someone thinks TL074 is too mainstream, it would be possible to use something more audio grade like OPA2134 or NE5532.

I wasn't actually thinking of using sockets, but rather going the opposite direction with SMD parts. Since the audio circuits would be doubled (or quadrupled as you suggest below) that will take considerable real estate on the board. I was thinking of the OPA2134 which I've used in the past successfully in other projects. Though I don't have many of those left, and I do have a significant amount of NE5532s, both in PDIP and SOIC packages... Hmm.

No, that is not right, it does not control channels C and D. You need A1 signal if you want to go into OPL3 mode and to use the other 9 channels. Otherwise you are limited to OPL2 compatibility mode only (9 channels, 4 waveforms, 2 operator channels, monophonic, no panning whatsoever). But when in OPL3 mode, you have all 18 channels and 8 waveforms, and can use 4 operator channels. The side effect is that in OPL3 mode, you can freely select to which instrument channels (1..18) are connected to which output channels (A..D).

Hmm, why not add circuitry for optional second DAC as well to have 4 channel output.

You're right, I was reading the datasheet wrong. Hmm, need to figure out how A1 is driven on a real OPL3 board. May need additional address decoding thus additional pins to contact the daughterboard. Shouldn't be much of a problem.

(edit) found the answer at http://repetae.net/computer/opledit/tech/opl3.txt A0(ISA)->A0(OPL); A1(ISA)->A1(OPL) in conjunction with OPL_CS

As for 4-channel output, perhaps in a second revision. For the first iteration I'll probably keep it at 2 channels. Simpler is better, because I'm stoopid.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O

Reply 3 of 5, by Jepael

User metadata
Rank Oldbie
Rank
Oldbie
stamasd wrote:

Hmm, what would be the advantage of using an on-board oscillator instead of the ISA clock? Stability maybe? BTW a discrete 14.32 MHz oscillator doesn't exist; Mouser carries a 14.32MHz ceramic filter, and that could possibly be used to make an oscillator, but I don't think it would be too stable (ceramic not quartz) plus it is not stocked and has a lead time of 52 weeks. 🙁 I guess 14.318 will have to do.

Oscillator type does not matter much, you could use a 5V crystal oscillator (one that gives out square wave) or build a simple oscillator circuitry around a crystal.
The thing is if you put a clock source right next to OPL3 chip, you don't have to take it from ISA bus or mod the OPL2 board not to divide the OSC by four. Sure you can leave some parts out and still take it from ISA OSC.

stamasd wrote:

I wasn't actually thinking of using sockets, but rather going the opposite direction with SMD parts. Since the audio circuits would be doubled (or quadrupled as you suggest below) that will take considerable real estate on the board. I was thinking of the OPA2134 which I've used in the past successfully in other projects. Though I don't have many of those left, and I do have a significant amount of NE5532s, both in PDIP and SOIC packages... Hmm.

Neat. I've more into digital electronics although much of it involves analog audio circuitry. Since the sample/hold circuitry is sensitive to op-amp input current, I think the FET-input OPA2134 would be more suitable right near the DAC. After that is properly buffered, even the BJT-input NE5532 could be used for any filters or output buffers. If I recall, to keep sample/hold signal droop below half of one DAC step, you'd want less than 2.5nA of bias current.

Reply 4 of 5, by BloodyCactus

User metadata
Rank Oldbie
Rank
Oldbie

Ill keep an eye on this topic to see where you go with it. I'm sticking to sergeys board as is, I think an adlib clone is perfect for an 8088!

You should prototype up a new board in diptrace or circtuit maker or something (please not eagle or kicad they are abortions!)

--/\-[ Stu : Bloody Cactus :: [ https://bloodycactus.com :: http://kråketær.com ]-/\--

Reply 5 of 5, by stamasd

User metadata
Rank l33t
Rank
l33t
Jepael wrote:

Neat. I've more into digital electronics although much of it involves analog audio circuitry. Since the sample/hold circuitry is sensitive to op-amp input current, I think the FET-input OPA2134 would be more suitable right near the DAC. After that is properly buffered, even the BJT-input NE5532 could be used for any filters or output buffers. If I recall, to keep sample/hold signal droop below half of one DAC step, you'd want less than 2.5nA of bias current.

Fron the datasheet the RC4136 has bias current of 150nA typical, 500 max. I/e/ nowhere near. The 5532 is actually worse with 200/800. The x134 however has bias in the few pA. 😀 OPA2604 is about 100pA typ.

I/O, I/O,
It's off to disk I go,
With a bit and a byte
And a read and a write,
I/O, I/O