Date: Fri, 30 May 2003 13:05:33 -0500 From: Eric Rudd Subject: Re: uclock() still out by 1 in 65536 In-reply-to: <3ED6E375.60909@bigpond.com> To: djgpp-workers AT delorie DOT com Cc: Andrew Cottrell Message-id: <3ED79D6D.1050108@cyberoptics.com> Organization: CyberOptics MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit X-Accept-Language: en,pdf User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.3) Gecko/20030312 References: <4wyBa.45993$1s1 DOT 615094 AT newsfeeds DOT bigpond DOT com> <200305300208 DOT h4U28vDV031441 AT envy DOT delorie DOT com> <3ED6C0EB DOT 3080403 AT bigpond DOT com> <200305300229 DOT h4U2T5vd031704 AT envy DOT delorie DOT com> <3ED6CF29 DOT 5060803 AT bigpond DOT com> <000e01c32663$436b9e50$0100a8c0 AT acp42g> <3ED6E375 DOT 60909 AT bigpond DOT com> X-MailScanner-Information: Please contact the ISP for more information X-MailScanner: Found to be clean Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Ben Peddell wrote: > I'll have to try to investigate that. I'll see just what frequency the > RTC 1024Hz interrupt actually is. > > I know that the RTC is supposed to use a common 32768Hz crystal, and > the PIT is supposed to use 14318180Hz / 12 (=1193181.66Hz). If you are concerned about small frequency errors, you may be interested in the origin of the 1.19-MHz rate that is used in the PC timer chip. In the early days of personal computing, it was considered important to maintain compatibility with NTSC, since people used NTSC monitors on their computers. According to the EIA RS 170 A spec, the chroma subcarrier is at 3.579545 MHz +/- 10 Hz, and the PC clock was chosen to be 1/3 of that, or 1.19 MHz approximately. The specified 3.579545 MHz rate itself is an approximation; it is exactly 455/2 times the horizontal sweep rate, which was originally 15750 Hz in the early black-and-white days, but was changed to 15750/1.001 when NTSC was devised. Thus, the chroma subcarrier works out to 39.375/11 MHz, and the PC timer chip runs at 13.125/11 MHz. As I recall, the system clock on the original IBM PC was 4 times that, or 4.77 MHz. -Eric Rudd rudd AT cyberoptics DOT com