0

I want to improve intrinsic (hardware) precision of windows/linux (OS) time (specifically, in my case it's AMD X570 platform), without relying on periodic correction via NTP servers. Common approach is to replace simple crystal to TCXO or OCXO. Many did that for Raspberry PI's, but I don't see much references for PC.

I am interested in clock that is used by OS for timing when it is working. I do not want to improve precision of battery backed RTC clock (as it only offers 1 second resolution - I assume it is not used when PC is working). RTC crystal (32kHz) is easy to find, but unfortunately I afraid it's not it.

How to find crystal which is used for timing in OS? Is my assumption that it's not RTC crystal correct? Does this happen near chipset or there is some dedicated clock generator?

I see that windows has multiple timers (ACPI, QPC, RTC) - but are they all derived from same source?

BarsMonster
  • 3,267
  • 4
  • 45
  • 79
  • What is it that you want to time? It might be more sensible to get an external frequency counter or similar which has an interface you can use with a PC (e.g. [LXI](https://en.wikipedia.org/wiki/LAN_eXtensions_for_Instrumentation)). – Andrew Morton Oct 23 '22 at 19:19
  • 1
    That's basically a software question. Unless you know how operating systems use the hardware, there's no point hacking the hardware. In the end the RTC is used to keep time while system is powered off. – Justme Oct 23 '22 at 19:19
  • 1
    Your mainboard will have a [clock generator](https://en.wikipedia.org/wiki/Clock_generator). – CL. Oct 23 '22 at 19:27
  • @Justme On software side solution is known, but there are also known disadvantages: time is corrected by small jumps, and there is significant noise. Hardware solution with high-quality oscillator will offer much cleaner timer without noise. – BarsMonster Oct 23 '22 at 19:40
  • @AndrewMorton I want to improve general time precision on hardware level without any software changes. – BarsMonster Oct 23 '22 at 19:46
  • 1
    Time jumps aside, what noise there would be and how it would affect the system? What problem you have and why it needs solving by improving motherboard crystal? Generally a motherboard has a single clock crystal and everything is derived from it. And again if you don't know how an OS uses the clocks you don't know how to improve the hardware. For example back in the day Windows used 1024 Hz interrupts from RTC and this was used for 1000 Hz system timekeeping. So sometimes if you wanted to have a delay of one 1000 Hz tick, you would get delay of either one or two 1024 Hz ticks. – Justme Oct 23 '22 at 20:03
  • 2
    How much precision do you need? --Tying your clock to an external source is a very common way to get a more precise clock on the cheap, though. If you don't want to rely on network time, the other main option would be a GPSDO, that uses GPS (which consists of some of the most precise clocks ever built, constantly broadcasting the current time) to synchronize to. – Hearth Oct 23 '22 at 20:12
  • 2
    I wish you success in your endeavour, but I also suggest (if your requirements allow) using a serial gps module and gpsd to condition your local clock. – Bryan Oct 23 '22 at 20:27

1 Answers1

0

AMD AM4 processors (including ones running on X570 boards) have integrated clock generator. 48Mhz oscillator is connected to X48M_X1/X2 pins of the CPU.

14Mhz clock can be generated by onboard PLL.

https://en.wikichip.org/wiki/amd/packages/socket_am4

BarsMonster
  • 3,267
  • 4
  • 45
  • 79