Electronic Genets wrote on 2022-06-01, 12:58:
Thank you ripsaw8080. It means the crystal frequency is 1193182 Hz and the "8254" timer counts to 65536 (interrupt at overflow)?
Morally yes, technically no.
The crystal frequency is 14.31818MHz, not 1.193182MHz, but the crystal frequency is divided by 12 before it is sent into the 8254 timer. Thus, if the crystal frequency were infinitely precise (which it isn't, of course), the timer would be clocked at exactly 1193181.6 MHz, with boldface indicating infinite repetition of that 6, which is pretty close to 1193182MHz. It makes no sense to argue whether the frequency is intended to be 1'193'182 Hz or 1'193'184 Hz, as crystals are not that precise. But it might make sense to lock the OPL2/OPL3 rate to the 8254 rate, as they might be derived from the same crystal (depending on the sound card). So locking in the OPL3 to be "ticked" exactly every 24 timer ticks makes sense. If you run the OPL3 at a nominal rate of 49'716Hz, it would make sense to run the PIT at a nominal rate of 1'193'184Hz just to keep the ratio. If you don't care about the PIT clock, but just about the IRQ0 clock: The OPL3 is intended to run at a 8192/3 times the IRQ0 clock.