TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Ian Moote
from: Will Honea
date: 1999-12-05 15:05:01
subject: Clocked!

Ian Moote wrote to JONATHAN DE BOYNE POLLARD on 12-05-1999

IM> I reiterate, the design is such that it was understood that the
IM> RTC did  not have a century byte. The century byte was provided in
IM> CMOS to be set  by the "user". Each byte has a range of 00 to 99
IM> BCD. Ergo, the RTC/CMOS  is good until the the year 9999. Claiming
IM> otherwise, simply because the  RTC by itself doesn't actually have
IM> control of the _existing_ century  byte, simply ignores the existing
IM> facts and is simply being contrary for  the sake of contrariness
IM> itself. 

Ian, the PC RTC was made a defacto standard in the IBM AT, circa 1984.
 IBM chose the Motorola MC146818 chip which I have used in hardware
designs since the early 80's.  The original 6818 was touted to be the
'univeral' clock as it accomodated both the Motorola 68xx and the Intel
bus timing and specs (almost).  The original chip had several problems,
one of the minor ones being incorrect Y2K leap year detection - and a
bunch of those are still in the pipeline lo these many years later. 
The 146818 was replace in the late 80's by the 146818A which had
significant performance and power enhancements.  Dallas Semi and
Hitachi licensed the part and Dallas extended some of the functions as
well as adding an integral battery.  The original 6818 had some
problems with the year update, but my spec sheet for the part shows
that the the part "Counts Seconds, Minutes, and Hours of the Day",
"Counts Days of the Week, Date, Month and Year".  If it doesn't, then I
have several thousand units in the field which are gonna generate a
FLOOD of irrate phone calls come 1/1/2000.  Tests have shown that the
part DOES keep the year at offset 10. The whole date/time array is
stored at offsets 0-10 in the part.  A fair number of the 6818 parts
from Hitachi have a problem with Feb 29, 2000 so we have included a
software 'kludge' to take care of that but the part itself keeps on
ticking.  Interestingly enough, even the flawed parts keep the
day-of-week right: they just won't roll over the 28 -> 29th.

So much for the original part: it DOES keep the year and count it but
as a 2 digit value.  Even if you use binary values in the date/time
registers (an option) the circuit still rolls from 99 - 00.  Otherwise,
even legacy software would have no problem: add 1900 to the value and
you are good to 2155.  As for the built-in clock functions in the
integrated controllers, they are supposed to be faithful emulations of
the 6818.  They may extend the functions, but they are licensed to
perform exactly as the 6818 design.  Enhancements include added RAM
(that's where your BIOS settings are stored) and some additional alarm
functions.  BTW, the alarm functionality is fully available - but I
don't know of anyone else who uses it.  I use it for a 'tell em you're
alive' event in my instrumentation designs so that the monitor up on
the snow shed reports in once every week or so even in the summer.

The use of offset 32h for century storage is a convention that
evolved.  Add-in boards for the XT used whatever they felt like but
IBM's dominance in the PC market (at the time) pretty well defined
their choice as the standard.  Did they make an error?  Depends on your
definition of error.  The design lifetime of the AT was on the order of
5 years.  Low battery conditions were common early on and a battery
failure rendered the PC brainless - it lost the CMOS setup - so the
reset value of year 00 was chosen to indicate battery loss and
potential corruption.  Later BIOS's used the battery indicator flag in
the clock to make a more intelligent decision but why worry when the
product was destined for the scrap heap in 6-7 years anyway?

IM> IMO, of course. I've been repairing and upgrading clones
IM> professionally  since about 1990. 

I've got a good 10 year lead on you.  I was designing those same
'clones' when the first PC came out and I still design and produce
equipment using the same structures - altho it's more of a 'grab 3
parts, add memory' exercise today.

I'm not aware of any major PC maker today writing custom BIOS's.  They
will all take a licensed verion of AWARD or AMI - the survivors - and
add whatever unique hardware interfaces are needed but the essential
BIOS is pretty much vanilla.  I normally use AWARD and the only mods I
make are to accomodate A/D and D/A functions where it's more efficient
than to do the entire function from the app.  I also initialize the
built-in modems if included on the board but I can even buy the video
routines as part of the package.

The clock routines are not broken.  They are Working As Designed
(WAD).  You may bitch about the design specs but (as you might guess
from the times above) I could care less about what happens after 2079. 
If my customers are so damned cheap that they haven't upgraded by then,
tough.  The NEMA enclosures will probably have rotted anyway.  More
importantly, if I or my successors have not made sufficient
improvements in the products so as to warrant replacement by then (to
include necessary functionality) I can assure you that this business
will be dead even before I am.

Finally, I have some questions for you:  How many pre-1990 PC's are in
active use today? (yes, Linda, I know!)  How many of todays 'killers'
will be functional in 2038, much less 2079?  The spec'd lifetime for
data on EPROMS is 10 years, BTW, and the myriad electrolytic capacitors
in your PC have a similar MTBF.
 
Will Honea 
--- Maximus/2 2.02
* Origin: OS/2 Shareware BBS, telnet://bbs.os2bbs.com (1:109/347)

SOURCE: echoes via The OS/2 BBS

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.