linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: i386: Selectable Frequency of the Timer Interrupt
@ 2005-07-12 12:50 Jan Engelhardt
  2005-07-12 13:02 ` Richard B. Johnson
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2005-07-12 12:50 UTC (permalink / raw)
  To: Linux Kernel Mailing List

Hi,


Vojtech Pavlik @ Tue, 12 Jul 2005 14:10:08 +0200 wrote:
(http://lkml.org/lkml/2005/7/12/122)

>On Mon, Jul 11, 2005 at 05:38:05PM -0700, George Anzinger wrote:
>> HZ  	TICK RATE	jiffie(ns)	second(ns)	 error (ppbillion)
>>  100	 1193180	10000000	1000000000	       0

>The PIT crystal runs at 14.3181818 MHz (CGA dotclock, found on ISA, ...)
>and is divided by 12 to get PIT tick rate
>	14.3181818 MHz / 12 = 1193182 Hz

What exactly is the frequency of the PIT? Many internet resources say 1193180 
(including the original post), some say 1193181, and you say 1193182 Hz.
Which one is correct? (Ignoring temperature for now..)

IMO 1193181 could be, because it matches the almost-magical number 0x1234DD.


Jan Engelhardt
-- 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: i386: Selectable Frequency of the Timer Interrupt
  2005-07-12 12:50 i386: Selectable Frequency of the Timer Interrupt Jan Engelhardt
@ 2005-07-12 13:02 ` Richard B. Johnson
  0 siblings, 0 replies; 4+ messages in thread
From: Richard B. Johnson @ 2005-07-12 13:02 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: Linux Kernel Mailing List

On Tue, 12 Jul 2005, Jan Engelhardt wrote:

> Hi,
>
>
> Vojtech Pavlik @ Tue, 12 Jul 2005 14:10:08 +0200 wrote:
> (http://lkml.org/lkml/2005/7/12/122)
>
>> On Mon, Jul 11, 2005 at 05:38:05PM -0700, George Anzinger wrote:
>>> HZ  	TICK RATE	jiffie(ns)	second(ns)	 error (ppbillion)
>>>  100	 1193180	10000000	1000000000	       0
>
>> The PIT crystal runs at 14.3181818 MHz (CGA dotclock, found on ISA, ...)
>> and is divided by 12 to get PIT tick rate
>> 	14.3181818 MHz / 12 = 1193182 Hz
>
> What exactly is the frequency of the PIT? Many internet resources say 1193180
> (including the original post), some say 1193181, and you say 1193182 Hz.
> Which one is correct? (Ignoring temperature for now..)
>

The original specification was based upon the NTSC color subcarrier
frequency of 3.579545. The dotclock is 4 times this:

 	3.579745 * 4 = 14.31818000

You can type 3.579545 into google and see it's used practically
everywhere as the magic number that started it all ;^) The
crooked-earth society uses this for PI (just kidding).


> IMO 1193181 could be, because it matches the almost-magical number 0x1234DD.
>
>
> Jan Engelhardt
> -- 
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
>

Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
  Notice : All mail here is now cached for review by Dictator Bush.
                  98.36% of all statistics are fiction.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: i386: Selectable Frequency of the Timer Interrupt
  2005-07-12 14:05         ` Jan Engelhardt
@ 2005-07-12 16:07           ` Vojtech Pavlik
  0 siblings, 0 replies; 4+ messages in thread
From: Vojtech Pavlik @ 2005-07-12 16:07 UTC (permalink / raw)
  To: Jan Engelhardt
  Cc: Con Kolivas, linux-kernel, George Anzinger, Martin J. Bligh,
	Lee Revell, Diego Calleja, azarah, akpm, cw, torvalds, christoph

On Tue, Jul 12, 2005 at 04:05:16PM +0200, Jan Engelhardt wrote:

> >> >     HZ   ticks/jiffie  1 second      error (ppm)
> >> > ---------------------------------------------------
> >> >    100      11932      1.000015238      15.2
> 
> I was not quite able to reproduce these values, probably because I got the
> math wrong. I used:
>   $oneSecond = $ticksJiffie * $HZ / 1193182
> which yields 11932*100/1193182 = 1.00001508571198693912, !=1.000015238
> Math corrections welcome.

I used 1.19318[18] MHz periodic as the true clock speed - 1/3rd of the
NTSC color subcarrier frequency.

1193182 Hz is already a rounded value, and as such introduces some error
by the rounding.

It is possible the standard value is 1.1931816[6] MHz periodic, as
Richard B. Johnson corrected me, being 1/12th of 14.31818000 MHz, the
CGA dotclock. 

Anyway, both 14.31818 MHz and 14.3181818 MHz crystals are being
manufactured, and thus we'll see both these numbers in the wild.

> Anyway, I've done some graphs. Intersting that the smaller the HZ, the less
> error (seen on a whole, esp. view_1k and view_8k.png) we get. 20Hz seems to
> be the 0.0 case, and 18Hz is not bad either. IIRC, DOS used 18HZ ;)
> http://jengelh.hopto.org/tick/

DOS used 65535 as the divisor (ticks/jiffie), which doesn't give an
integer HZ.

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: i386: Selectable Frequency of the Timer Interrupt
  2005-07-12 13:30       ` Vojtech Pavlik
@ 2005-07-12 14:05         ` Jan Engelhardt
  2005-07-12 16:07           ` Vojtech Pavlik
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2005-07-12 14:05 UTC (permalink / raw)
  To: Vojtech Pavlik
  Cc: Con Kolivas, linux-kernel, George Anzinger, Martin J. Bligh,
	Lee Revell, Diego Calleja, azarah, akpm, cw, torvalds, christoph

Hi,

>> >     HZ   ticks/jiffie  1 second      error (ppm)
>> > ---------------------------------------------------
>> >    100      11932      1.000015238      15.2

I was not quite able to reproduce these values, probably because I got the
math wrong. I used:
  $oneSecond = $ticksJiffie * $HZ / 1193182
which yields 11932*100/1193182 = 1.00001508571198693912, !=1.000015238
Math corrections welcome.

Anyway, I've done some graphs. Intersting that the smaller the HZ, the less
error (seen on a whole, esp. view_1k and view_8k.png) we get. 20Hz seems to
be the 0.0 case, and 18Hz is not bad either. IIRC, DOS used 18HZ ;)
http://jengelh.hopto.org/tick/




Jan Engelhardt
-- 
| Alphagate Systems, http://alphagate.hopto.org/


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-07-12 16:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-12 12:50 i386: Selectable Frequency of the Timer Interrupt Jan Engelhardt
2005-07-12 13:02 ` Richard B. Johnson
     [not found] <200506231828.j5NISlCe020350@hera.kernel.org>
2005-07-12  0:38 ` [PATCH] " George Anzinger
2005-07-12 12:10   ` Vojtech Pavlik
2005-07-12 12:39     ` Con Kolivas
2005-07-12 13:30       ` Vojtech Pavlik
2005-07-12 14:05         ` Jan Engelhardt
2005-07-12 16:07           ` Vojtech Pavlik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).