Resumen del contenido incluido en la página 1
Not Recommended for New Installations.
Please contact Technical Support for more information.
Stable Real Time Clock for PCs
Model PCRTC
Documentation Number PCRTC2095
This product
Designed and Manufactured
In Ottawa, Illinois
USA
of domestic and imported parts by
B&B Electronics Mfg. Co. Inc.
707 Dayton Road -- P.O. Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5105
Internet:
http://www.bb-elec.com
orders@bb-elec.com
support@bb.elec.com
B&B Electronics March 19
Resumen del contenido incluido en la página 2
Table of Contents CHAPTER 1. GENERAL INFORMATION ....................................1 INTRODUCTION ........................................................................................1 PACKING LIST..........................................................................................1 SPECIFICATIONS.......................................................................................1 CHAPTER 2. SETUP ..........................................................................2 H
Resumen del contenido incluido en la página 3
Chapter 1. General Information Introduction The PCRTC is real time clock for PCs based on a highly stable oscillator circuit. Using the software driver provided, the PCRTC will update the DOS clock every minute, ensuring that all applications have access to accurate time information. With a simple function call, the PCRTC also reports battery status and the time of the last power loss or computer reset. Packing List Examine the shipping carton and contents for physical damage. The following item
Resumen del contenido incluido en la página 4
Chapter 2. Setup Hardware Setup The address switch on the PCRTC must be set to an address which doesn’t conflict with other devices in the host computer. The address settings are listed in Table 1, and are also printed on the PCRTC card. The PCRTC is shipped from the factory set for 200h. If you need to change this address, select one from the table which will not conflict with another device in the host computer. If the PCRTC does not operate properly, select a new address. Remember to edit the
Resumen del contenido incluido en la página 5
Hardware Installation 1. Shut the host computer power off. 2. Remove the computer cover. 3. Remove the expansion slot cover of an unused slot. 4. Handle the PCRTC only by its edges. Avoid touching any conductors on the PCRTC. Install the PCRTC into the slot. Be certain that the card is inserted completely into the slot. 5. Secure the card with the mounting screw from the slot cover. The PCRTC is shipped with the oscillator halted to extend battery life. To start the PCRTC, the card must be initi
Resumen del contenido incluido en la página 6
Chapter 3. Operation Overview The most common application of the PCRTC is to simply maintain the correct time on the host computer. Loading the device driver in the CONFIG.SYS file will accomplish this function by setting the DOS clock to the PCRTC clock time once every minute. This allows the user and all applications access to the correct time without any special commands or function calls. The PCRTC has two additional features which may either be incorporated using the provided “include file”
Resumen del contenido incluido en la página 7
PCRTC v1.00, (c) Copyright 1995, B&B Electronics Mfg. Co. PCRTC address: 200h Battery Status: Good If this message appears, the driver has been installed and is running. The DOS clock will be updated every minute using the time from the PCRTC. The driver will report any errors found upon installation. Command Line Options All of the PCRTC features can be accessed and controlled from the command line as well. The program PCRTC.EXE has the following command line options. PCRTC /t [address] Set PCR
Resumen del contenido incluido en la página 8
The best method of updating the PCRTC time is to use the shareware program Timeset. Note that although this program is included on the PCRTC diskette, it is shareware and should be registered with its author. Timeset uses your modem to obtain the precise time from one of five atomic clocks in two continents, then sets your DOS time. The batch file RTCSET.BAT included in the Timeset directory should be used in conjunction with Timeset. Running the batch file will execute the following operations.
Resumen del contenido incluido en la página 9
Start_RTC_API Purpose: Initializes API, must be the first PCRTC function called in the program. C: int Start_RTC_API(unsigned int address); Pascal: FUNCTION Start_RTC_API(address: WORD): WORD; BASIC: FUNCTION StartRTCAPI% (BYVAL address AS INTEGER) Remarks: Start_RTC_API takes the address at which the PCRTC is installed at. The device driver must be installed. Returns: 0 = device driver is not installed. non zero = address of PCRTC. Example: See below. Battery_RTC Purpose: Check battery status o
Resumen del contenido incluido en la página 10
Get_RTC_Time Purpose : Returns the RTC time within a structure. C: struct GetTime_T { unsigned int hours; unsigned int min; unsigned int seconds; unsigned int h_seconds; }; int Get_RTC_Time(GetTime_T far *gt); Pascal : TYPE GetTime_T = RECORD hours: WORD; min: WORD; seconds: WORD; h_seconds: WORD; END; TYPE GetTime_Ptr = ^GetTime_T; FUNCTION Get_RTC_Time(time: GetTime_Ptr): WORD; BASIC: TYPE GetTimeT hours AS INTEGER min AS INTEGER seconds AS INTEGER hseconds AS INTEGER END TYPE FUNCTION GetRTCT
Resumen del contenido incluido en la página 11
Last_Power_Down_RTC Purpose: Returns date and time of last power down within a structure. C: struct TimeSave_T { unsigned int month; unsigned int day; unsigned int hour; unsigned int minute; unsigned int second; }; int Last_Power_Down_RTC(TimeSave_T far *ts); Pascal: TYPE TimeSave_T = RECORD month: WORD; day: WORD; hour: WORD; minute: WORD; second: WORD; END; TYPE TimeSave_Ptr = ^TimeSave_T; FUNCTION Last_Power_Down_RTC(timeSave: TimeSave_Ptr): WORD; BASIC: TYPE TimeSaveT month AS INTEGER day AS
Resumen del contenido incluido en la página 12
QuickBASIC Example: '$INCLUDE: 'RTC_API.BI' ‘Must be first executed statement in your program DIM timeS AS TimeSaveT ‘Define Variable Structure DIM time AS GetTimeT address% = StartRTCAPI(0) ‘Initialize API IF (address% <> 0) THEN ‘Check that it initialized OK IF (GetRTCTime(VARSEG(time), VARPTR(time)) <> 0) THEN PRINT “RTC time: “; time.hours; “:”; time.min; “:”; time.seconds; “.”; PRINT time.hseconds END IF IF (LastPowerDownRTC(VARSEG(timeS), VARPTR(timeS)) <> 0) THEN PRINT "Last Power Down (R
Resumen del contenido incluido en la página 13
C Programming Example #include #include "rtc_api.h" void main() { TimeSave_T *ts = (TimeSave_T *) malloc(sizeof(TimeSave_T)); GetTime_T *time = (GetTime_T *) malloc(sizeof(GetTime_T)); unsigned int battery; unsigned int address; cprintf("Demo (PCRTC-c) v1.00, (c) Copyright 1994, B&B Electronics Mfg. Co.\r\n\r\n"); address = Start_RTC_API(0); if (address) { if (Get_RTC_Time(time)) cprintf(“RTC time: %u:%u:%u.%u\r\n”, time->hours, time->min, time>seconds, time->h_seconds); if (Last_Power
Resumen del contenido incluido en la página 14
Chapter 4. Calculating Error PPM Terminology The unit ppm (parts per million) provides a number similar to error expressed with percentages, but reduces the number of decimal places required. For example, 0.001% converts to 0.00001 which is equivalent to 10 ppm. Using the ppm notation makes it easier to deal with very small deviations. The ppm terminology is also useful for calculating PCRTC error in terms of seconds per month. Since an average month has approximately 2.63 million seconds, if th
Resumen del contenido incluido en la página 15
Aging All crystal oscillators have an aging characteristic. The crystal used in the PCRTC uses the coldweld manufacturing technique, which exhibits the lowest aging characteristic of 1 ppm/year. In practice, this aging rate improves significantly with time, but for practical purposes the value of 1 ppm is adequate. To estimate the error in your application, sum the error from the three sources above. This estimate can be used to determine how frequently the time should be updated using Timeset o
Resumen del contenido incluido en la página 16
Appendix A. Hardware I/O Map I/O Map of XT Class Machines Hex Address Address Function in XT Class Machines 000-00F DMA controller (8237A) 020-021 interrupt controller (8259A) 040-043 timer (8253) 060-063 PPI(8255A) 080-083 DMA page register (74LS612) 0A0-0AF NMI - non maskable interrupt 200-20F game port joystick controller 210-217 expansion unit 2E8-2EF COM4 serial port 2F8-2FF COM2 serial port 300-31F prototype card 320-32F hard disk 378-37F parallel print 380-38F SDLC 3B0-3BF MDA - monochrom
Resumen del contenido incluido en la página 17
Hardware I/O Map of AT Class Machines Hex Address Address Function in AT Class Machines 000-01F DMA controller #1 (8237A-5) 020-03F interrupt controller #1 (8259A) 040-05F timer (8254) 060-06F keyboard (8042) 070-07F NMI - non maskable interrupt & CMOS RAM 080-09F DMA page register (74LS612) 0A0-0BF interrupt controller #2 (8259A) 0C0-0DF DMA controller #2 (8237A) 0F0-0FF 80287 math coprocessor 1F0-1F8 hard disk 200-20F game port joystick controller 258-25F Intel Above Board 278-27F parallel pri