Summary of required mods for audio to work in 7Mhz?

Page 2/4
1 | | 3 | 4

Par Meits

Scribe (5536)

Portrait de Meits

04-10-2017, 16:47

I've got some MSX Audios with their own clock crystal. On a 7MHz modded machine they once in a while skip a part of a tone. Could this be related to the fact that the program that writes to these cartridges feeds the chip too fast?
Same goes for any FM (even the internal MSX-Music) I tried on a Panasonic 2+ in turbo mode.

This "loss" of tone can easily be heard in this track. This particular tune is recorded on a 2+ in turbo mode, but the same goes for an MSX2 with a 7MHz mod.

The only setup in which speed and sound are good on native speeds, which includes r800 mode where no external audio cartridge responds irregular on high speed.

Par msd

Paragon (1372)

Portrait de msd

04-10-2017, 15:22

@meits. Yes it does.
The only good solution would be to use the wait signal and give opl1/opll their own clock. Fix ports on 3.58Mhz is not ideal. A lot of performance is lost when the z80 is switched back to 3.58Mhz on I/O access.

Par Meits

Scribe (5536)

Portrait de Meits

04-10-2017, 16:47

msd:
So even a slot on 3.58MHz will not prevent note skipping when in turbo mode?

Par mohai

Paladin (838)

Portrait de mohai

04-10-2017, 18:58

I think the solution for this issue is no too complex.
A clock source of 7.1 Mhz is just right for a turbo CPU mode, as it is the double of the base frequency for the rest of the electronics inside an MSX, even the slots.
A 7.1 clock needs to be connected to the Z80(h) only but, for the rest of the electronics, a simple flip-flop (7474 IIRC) is enough to divide clock by 2.
Philips NMS 8280 does it this way, but 7.1 Mhz is not used in any point in the PCB, so I think the original design was to have a double speed CPU option.
As a standard, even the cartridge slots need to be connected to 3.58 Mhz, not 7.1, as the standard specification says.
You could connect 7.1 to one of the slots, as some hardware does not care about clock speed or even it enhances behavior, but that would not be a standard one.

Par mohai

Paladin (838)

Portrait de mohai

04-10-2017, 18:59

Of course, do not forget to slow down when accessing to I/O ports, as it is very convenient for some peripherals, as VDP.

Par Meits

Scribe (5536)

Portrait de Meits

04-10-2017, 19:43

That's where the PSG goes really bananas on a plain 7MHz machine where the PSG on a Panasonic 2+ goes pitch up, but keeps a stable pitch. Is that because it's 5.something MHz instead of 7.16MHz?

One wants 7MHz to increase speed. Handling speed of IDE/SD devices increases quite significantly as well, so keeping a default slot on a computer in that regard would hold you back.

Par Grauw

Ascended (8454)

Portrait de Grauw

04-10-2017, 21:33

The PSG going bananas is because most 7 MHz circuits temporarily switch back to 3.5 MHz whenever the I/O is accessed, so the PSG never gets a stable frequency and the output will reflect all those frequency changes. Maybe there’s a nice feature: I bet you can produce an extra channel of sound by accessing the PSG I/O at carefully timed intervals, because the frequency changes themselves will generate an extra waveform Tongue.

It’s a misconception that keeping the external cartridge slots at standard speeds would lose the performance benefit; the MSX bus is largely unused, you can pack several times as much data on there. As long as the internal RAM does get accessed at high speed, and the program runs from that memory, access to the external bus will be infrequent, and when it does occur can be several times closer together than on a normal MSX.

For example. The fastest I/O instruction takes 12 cycles, or 3.4 µs @ 3.58 MHz. Three of those cycles are when it actually accesses the device. If the machine runs twice as fast, to preserve the bus timing three additional cycles need to be added. Now the instruction takes 15 cycles, 2.1 µs @ 7.16 MHz. Still nearly twice as fast, and this is just that instruction; all instructions around it which do the calculations, data preparation, etc. all run at full double speed (even more if you remove the M1 wait).

This also illustrates how the bus is barely used and has much spare room remaining. The only thing that matters for the connected devices is that when it is accessed, it will receive the signals for the duration of those 3 cycles, 0.8 µs. So for this OUT, 75% of the time spent executing the instruction, all the external devices are twiddling thumbs.

So therefore, since the standard speed bus is typically going to be nearly as fast as a full speed bus, I think having two separate cartridge slots, one “full speed” and one “standard speed” is unnecessary complication for the user, and just a source of problems and annoyances (e.g. the no. of sound chips you can connect is reduced to 1).

Additionally, the concept of a nonstandard bus-speed may work most of the time at 7 MHz (if you mute the sound), but quickly breaks down as you go above that because less and less cartridges will be compatible as you go higher. While with a bus whose timing is properly controlled, why not just have a 20 MHz Z80 (= R800 speed).

I’m just describing the S1990 here btw Smile. TurboR is the proof. If someone made a daughterboard which fits in the Z80 socket, with a 20 MHz Z80, 4MB of internal RAM and a CPLD bus controller, that’d be awesome.

Par Meits

Scribe (5536)

Portrait de Meits

04-10-2017, 22:35

Yes, but there was one thing more I was wondering. As the upgraded MSX2 computers switch back to 3.5MHz on several occasions the PSG suffers a lot. The Panasonic 2+ computers do not suffer this. The pitch goes up and stays clean. Why can that be achived?
Not that a helium PSG is a desired result, but it's tons better than a critter.

Par Grauw

Ascended (8454)

Portrait de Grauw

04-10-2017, 23:29

The Panasonic 2+ never switches back to 3.5 MHz. Wait signals are sent to the CPU instead to delay it.

I think the reason people throttled the clock is to make cheaper/simpler turbo kits, they can use signals like IORQ from the Z80 to drive the frequency division, whereas if that would be used to drive WAIT then it would get infinitely stuck because the I/O request would never end. More logic is needed to handle it, IORQ going active should load a cycle counter which asserts WAIT until it reaches 0, something like that.

A helium PSG is definitely already way better, also because at least, it can be compensated for in software (at the loss of 1 octave though). SMW does it on the Panasonic 2+. If the turbo mods had used wait and all our PSGs would be clean, I think more software would’ve done that kind of thing, but as 7 MHz circuits are now there’s little point.

Par olliraa

Champion (296)

Portrait de olliraa

05-10-2017, 07:28

Grauw wrote:

If someone made a daughterboard which fits in the Z80 socket, with a 20 MHz Z80, 4MB of internal RAM and a CPLD bus controller, that’d be awesome.

Grauw wrote:

If the turbo mods had used wait and all our PSGs would be clean, I think more software would’ve done that kind of thing, but as 7 MHz circuits are now there’s little point.

Ok, so with the current turbo kits having correct sound from PSG is not possible/feasible? Then again, as there are some really awesome retro computer related upgrades (on various different platforms) using modern CPLD/FPGA technology, how complex would this kind of "Z80 socket, with a 20 MHz Z80, 4MB of internal RAM and a CPLD bus controller" thingy be? Smile

Just curious, as I don't have any clue oO

Page 2/4
1 | | 3 | 4