qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hw/misc/mos6522: What is VIA_TIMER_FREQ value?


From: Mark Cave-Ayland
Subject: Re: hw/misc/mos6522: What is VIA_TIMER_FREQ value?
Date: Mon, 6 Feb 2023 22:14:17 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0

On 06/02/2023 16:22, Philippe Mathieu-Daudé wrote:

Hi Mark & Laurent,

In commit d811d61fbc6 Mark defined VIA_TIMER_FREQ as 4700000 / 6
(783333.33) and in commit 6dca62a0000 Laurent defined it as 783360.

What is the correct value?

Could we define it once in include/hw/misc/mac_via.h or
even include/hw/misc/mos6522.h?

Thanks,

Phil.

Hi Phil,

The 6522 VIA has a 16-bit counter which is driven by an external clock crystal which is set to 783kHz for Macs. Commit 6dca62a0000 is the correct value since that was given in the Macintosh hardware documentation, and needs to be accurate since it was used for timing in older Macs. The value in commit d811d61fbc6 came from Ben, and it may be that this is how it is implemented on real PMU hardware by dividing a 4.7MHz clock for compatibility purposes: certainly newer Macs have a much more accurate hardware timer that would be used by the OS instead.


ATB,

Mark.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]