Design Idea
Use a system's real-time clock to "hide" a code sequence
Keep key code sections protected from prying users.
Mihaela Costin, Delmhorst Instruments, Towaco, NJ; Edited by Brad Thompson and Fran Granville -- EDN, 10/27/2005
Although the concept of a totally accessible system represents an ideal situation for users, designers now must limit access to—and conceal code sequences for—software routines for calibration, diagnostics, memory erasure, system reset, and more. In a system that includes a computer-compatible interface, such as an RS-232, a GPIB, or an infrared-I/O port, the system's software can detect unique input patterns and execute the "secret" code sequences. But if a system lacks a data port, any attempt to implement a secret-access feature in a publicly accessible user interface makes it transparent to the user, even if the feature includes password protection. This Design Idea offers an efficient way to activate a code sequence without making the customer aware that such a feature exists and without requiring any hardware modifications.
If a system includes an RTC (real-time clock), you can define a date and time stamp that invokes the hidden code. The date acts as a password, and, if you choose a date far in the past, a casual user would be unlikely to stumble across it. To implement the routine, you can modify the system software by inserting a date- and time-check routine at the location in which the hidden code executes. Under normal conditions, the program skips the hidden code and executes the routine only if the system's date matches the one that the routine specifies.
For example, the following pseudocode illustrates the use of Aug 12, 1980, as a system "password":
Check_date:
if (Read_RTC(year)= = 1980 and
Read_RTC(month)= = 8 and
Read_RTC(day)= = 12)
run_hidden_sequence( );
Continue_the_Code( );
After completing the procedure, you must remember to reset the system's clock to the current date and time. Otherwise, the system executes the special code for the remainder of the day until the clock rolls over to the next day.


















