Jump to content
  • 0
Elektron72

YM2151 Clock Frequency

Question

7 answers to this question

Recommended Posts

  • 0
Posted (edited)

I believe it's supposed to be 3.579MHz. However, the emulator is currently set to 4MHz.

There was a PR to fix the clock speed of the YM2151, but for some reason that PR was attempting to set the YM's clock speed to 2x the intended value, and that sounded wrong. It should be a trivial change to set the clock speed correctly (s/4000000/3579545/g in audio.c), but I think we just need to make sure it sounds consistent on a variety of platforms.

Edited by StephenHorn

Share this post


Link to post
Share on other sites
  • 0

I think 4 MHz would work better on the hardware, since it can be easily divided from the CPU's 8 MHz speed.

Share this post


Link to post
Share on other sites
  • 0
34 minutes ago, StinkerB06 said:

I think 4 MHz would work better on the hardware, since it can be easily divided from the CPU's 8 MHz speed.

Actually, 3.579MHz is just as easy, as that is already being used for the NTSC color subcarrier by VERA.  Plus, it is the manufacturer's suggested frequency.

Share this post


Link to post
Share on other sites
  • 0
17 hours ago, SlithyMatt said:

Actually, 3.579MHz is just as easy, as that is already being used for the NTSC color subcarrier by VERA.  Plus, it is the manufacturer's suggested frequency.

Oh, I didn't know the VERA actually exposes the NTSC color clock to the system board!

But the main gripe for me is, how would an 8 MHz CPU communicate with a 3.58 MHz peripheral? I'm pretty sure the exact wait-cycle counts would slightly vary depending on the phase of both clocks.

Share this post


Link to post
Share on other sites
  • 0

3.58  MHz is the chip clock rate, not the bus frequency. The YM2151 can receive aperiodic commands from the bus, one at a time. The general interface process is to check the chip to see if it's ready before writing to it. If you need to do a bunch of writes at once, it can take an indeterminate amount of time, as the CPU is spending much of the time busy-waiting as the YM2151 ingests each instruction.

Share this post


Link to post
Share on other sites
  • 0
21 minutes ago, SlithyMatt said:

3.58  MHz is the chip clock rate, not the bus frequency.

I know. I'm pretty sure that (by contrast) the SAA1099 would run at the CPU's 8 MHz frequency, as that's what the datasheet suggests.

Share this post


Link to post
Share on other sites
  • 0
On 8/28/2020 at 4:05 AM, StinkerB06 said:

I think 4 MHz would work better on the hardware, since it can be easily divided from the CPU's 8 MHz speed.

Except exactly 8MHz would put it asynchronous with Vera, so it's more likely 8.33MHz (50MHz dot clock /6, 25MHz external master clock /3).

It is much better to use the spec sheet frequency generator clock for a music chip ... especially when a large number of frequency synthesis chips in that class share a common frequency, as do basically ALL instrument implementations, so almost all of the existing operator set-ups will be tuned for that frequency.

Share this post


Link to post
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.

Guest
Answer this question...

×   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.


×
×
  • Create New...

Important Information

Please review our Terms of Use