Premium Content

New Signal Chain Resources from Texas Instruments:

Solving The Year 2000 Real-Time Clock Dilemma

Failure Of Any Part Of A System To Provide, Recognize, Or Process Dates Into The Next Century Can Cause Catastrophes.

Date Posted: October 01, 1998 12:00 AM

A variation of the windowing technique uses 1 byte of the non-volatile RAM built into the RTC to store the century. The PC-AT architecture uses location 32h of the DS12887 for the century storage, while the PS/2 architecture uses location 37h. Reserve 1 byte in the memory space to store the century value. When the application program or OS reads the two-digit year counter and the century location to get a full four-digit year, the four-digit year is compared to the entire four-digit pivot year. If the four-digit year from the RTC is less than the four-digit pivot year, the value 20 should be written to the century location. This will cover the period from the pivot year to 2099.

The windowing techniques will work fine in closed systems, however, it does provide some risks in open systems. Various OSs, compilers, and assemblers from various vendors support the most successful open systems.

The compiler run-time library is another source of date-handling errors. Compilers that have routines to get and set the time and date are normally designed for a specific hardware platform, where the location of the raw system clock and the RTC are well defined. The compiler library routines take on the responsibility of converting the system-clock data to a form required by the compiler. The compiler library routines have to be verified for correctness, and possibly replaced with your own routines.

Most compilers allow assembly-language routines to be mixed in with the compiler code, using pseudo operands to show the start and finish of the assembly code. Some allow assembly code routines to be linked into the object during the linking process. This allows the programmer to replace run-time library routines with in-house routines. Assembly language routines allow direct access to all of the I/O ports and memory in the system, so that they can be manipulated by the application program. In-house-developed code that accesses the date and time registers in the RTC or the system clock must be tested to ensure there are no conversion errors, and that they handle the date properly through the century date change.

In a nutshell, developing systems expected to function properly before, during, and after the century date change requires thorough testing of the hardware platform and the platform-development tools. Year-2000 failures can occur in the hardware, operating system, compiler, date-conversion routines, and application programs. Everything needs to be checked for correct date handling.

microcontrollers
Part Inventory
Go
powered by:
 

 
You must log on before posting a comment.

Are you a new visitor? Register Here
    There are no comments to display. Be the first one!