Abstract:
An integrated circuit wherein remapping logic permits the output-driver characteristics of a given pin to changed in software, by changing the data stored in a nonvolatile control bit.

Description:
CROSS REFERENCE TO OTHER APPLICATIONS 
     The following applications of common assignee contain some disclosure and drawings in common with the present application: 
     Ser. No. 264,193, filed Oct. 28, 1988, entitled FEEDBACK-CONTROLLED OSCILLATOR (Attorney&#39;s Docket No. 2846-74), now U.S. Pat. Nos. 4,871,982 and 4,912,435, and copending applications with Ser. Nos. 499,853, filed Mar. 27, 1990 and 717,238, filed Jun. 18, 1991; 
     Ser. No. 264,233, filed Oct. 28, 1988, entitled LOW-POWER CLOCK/CALENDAR ARCHITECTURE (Attorney&#39;s Docket No. 2846-132). Each of these applications has an effective filing date identical with that of the present, copending application, and is hereby incorporated by reference. 
     BACKGROUND AND SUMMARY OF THE INVENTION 
     The present invention relates to integrated circuits generally, and particularly to integrated circuits which are closely associated with a microprocessor. 
     Microprocessors will commonly have two types of externally initiated branching conditions, namely Resets and Interrupts. (The term &#34;interrupt&#34; is often used more generically, but in this application the term interrupt will be used to exclude Reset signals.) Typically an Interrupt signal will cause the microprocessor to halt execution of its current program, and branch to an interrupt-handling routine. (The interrupt-handling routine may be, for example, a routine which polls possible interrupt sources, to find where the interrupt actually came from.) By contrast, a Reset signal will not only cause the microprocessor to halt execution of its current program, but will also cause the microprocessor to set all of its logic to a predetermined state. Thus, a Reset is a more drastic action than an interrupt. 
     Resets are extremely useful insurance, since they do provide a way to retrieve a microprocessor from a &#34;stuck&#34; state. It can often happen that a software error will cause a microprocessor to remain in a state where it is looping, or waiting for an impossible event to happen; and in many such cases nothing short of a Reset may be able to return the microprocessor to normal operation. 
     Interrupts are particularly useful for real-time control applications. In such applications, interrupts generated by real-time circumstances provide a way for the microprocessor&#39;s program flow to be synchronized with external events (of some known type). 
     Microprocessors must often keep track of two clocks: one clock for time of day, and one clock which is used as an interval timer. In many systems, one or both of these clocks is maintained by circuits external to the microprocessor. If the interval timer is external to the microprocessor, an Interrupt signal will often be used to signal the end of an interval which the microprocessor has previously programmed into the interval timer. 
     Since software faults can cause microprocessors to lock up, and since it is very difficult to eliminate all possible software faults, it has been suggested that a &#34;watchdog&#34; chip could be used to minimize the problem of lockup. The &#34;watchdog&#34; chip would be a simple integrated circuit, which would send a Reset command to the microprocessor whenever the microprocessor appeared to be locked up. A possible lockup condition can be detected, for example, by having the watchdog chip monitor the microprocessor&#39;s output lines, and initiate an interrupt, and then a Reset, if no activity is seen for a very long time interval. Alternatively, the watchdog chip may include an interval timer, and be programmed to send a Reset command if its interval timer ever counts down to zero. In this case, the microprocessor (in addition to its primary program flow) would periodically reprogram the watchdog&#39;s interval timer, so that the watchdog&#39;s interval timer never counts down to zero while the microprocessor is fully operational. Since the watchdog function is relatively simple, other functions may be combined with it. 
     The extra insurance provided by the watchdog operation does impose some burden on the software structure. Therefore, it is highly desirable, in many applications, for end users to have the capability to disable the watchdog operation. 
     In low-power applications, it is often desirable for the processor to go to sleep until a specified time, regardless of intervening events. (This is often an objective in systems using microprocessors such as the 80C51, 80C31, 68HC05, 68HC11, or 146805 models) Thus, the processor in such a case may wish to receive an interrupt signal from the timer, but not receive any Reset signals which may be generated in the interim. 
     Thus, these considerations imply some conflict regarding possible uses of the interrupt and Reset pins. 
     The present invention provides an innovative improvement in microprocessor support chips, which is also applicable to a wide range of integrated circuits generally. 
     The present invention provides an integrated circuit which includes, as part of its I/O interface for certain pins, logic for steering the signals. Thus, the Reset and Interrupt pins, in the example of the presently preferred embodiment, can be swapped at will, by rewriting the data values in a (battery-backed nonvolatile) memory cell whose output controls the logic to switch the data routing from one of two or more internal logic lines to the pins (and associated drivers, ESD protection circuits, etc.). 
     This functionality goes beyond a mere reconnection of wires. In the presently preferred embodiment, the I/O buffers used are programmable in other features as well. For example, in the presently preferred embodiment, the output buffers can be set to either sink or source current when an interrupt occurs, and they can be set to provide a pulsed output or a constant output. 
     It should also be noted that, although the presently preferred embodiment uses pinmapping logic to select and modify the output buffer used for outgoing interrupts, this concept can also be adapted to provide selection among alternative input buffers. This too may be very advantageous in some applications, as will be discussed below. 
     The presently preferred embodiment permits two pins, on which outgoing interrupts are routed, to be exchanged as desired. It should be noted that, among the options provided by this embodiment, the interrupts driven onto these pins can be defined either as pulses or as constant levels. Thus, the integrated circuit of this embodiment can be used to provide interrupts to either a level-sensitive or an edge-sensitive input of another integrated circuit. This is particularly convenient where compatibility with existing system practices, or with other integrated circuit designs, may mean that certain signals may be defined according to one or the other of these two standards. For example, in many microprocessor architectures, the Reset and Interrupt pins are defined differently: Reset signals are very commonly defined as level-related signals, and interrupts are very commonly defined as edge-related. 
     Thus, the present invention is particularly advantageous in integrated circuits which implement a functionality which is ancillary to a microprocessor. A wide variety of such architectures have been proposed, and the &#34;watchdog&#34; operation of the preferred embodiment is merely one example. In applications of this kind, the ability to remap the outgoing stream of interrupts is particularly advantageous, since it increases the versatility of the ancillary chip. Such versatile chips, which can coordinate with more than one microprocessor, can greatly increase a system designer&#39;s options, and may also increase the speed with which a system design can be completed. 
     However, it should also be noted that the novel concepts in this embodiment can be further adapted to a much wider range of embodiments. In general, the present invention permits the interface characteristics of a pin to be separated from the signals which are sent or received over that pin. 
     Thus, for example, various pins of a single packaged device may or may not have the ability to go into a high-impedance state (be tristated); may interface to various signal families (e.g. single-ended ECL, differential ECL, TTL, or full CMOS levels); may have higher or lower source impedance (depending on the size of the driver transistors used at an output); and higher or lower input impedance (depending on the device types used for the first-stage input buffer and ESD protection). 
     The present invention permits the pins to be remapped onto signals. This capability can be particularly advantageous in biCMOS integrated circuits: a growing number of integrated circuits use this hybrid technology, where designers can use PMOS, NMOS, or NPN transistors. This capability is being adapted for a variety of purpose: one direction of development is to introduce a limited number of bipolar drivers into a mostly-CMOS circuit design, at points where a strong drive capability is needed (typically at external pins, or sometimes for driving long internal busses). Another line of development is to use bipolar logic for the key internal data paths of a chip which still has normal CMOS interface standards. Another line of development is used in analog design, where the high gains available from bipolar devices can be used to advantage in a largely-CMOS circuit design. A related field is for high-voltage devices, where specialized bipolar devices may be used to switch high voltages. In many of these subclasses of biCMOS, the use of CMOS is motivated by the very low static power consumption of CMOS logic and memory. Another powerful motivating factor is compatibility with the very large installed base of system designs which are primarily built around CMOS integrated circuits. 
     The present invention can be particularly advantageous in such contexts. The present invention enables integrated circuits wherein (for example) the output driver size can be optimized for the particular application contemplated, to minimize power consumption. Similarly, integrated circuits which have ECL internal logic can provide the option of bringing out ECL levels at a pin, so that systems which are able to use this capability can avoid the additional delay caused by translation to CMOS I/O levels. This flexibility can also provide system designers the option of combining small sections of ECL local busses with a largely-CMOS architecture. 
     The innovative pin-remapping structures can also be particularly useful in applications using analog and hybrid technologies. This capability can be used to permit users to dynamically change the I/O buffers in accordance with the signal types expected for various signals. 
     However, the range of potential applications is even larger than this. Such pin-remapping structures can be used to address a tremendous variety of applications, in digital, analog, and hybrid technologies. This provides a generally applicable tool for adaptable integrated circuits, including, but not limited to, &#34;glue&#34; logic circuits, application-specific integrated circuits (ASICs), and semi-custom integrated circuits. In fact, the flexibility provided by the present invention may permit standard integrated circuit designs to be used in many locations where ASICs or semicustom ICs might otherwise have to be used. 
    
    
     BRIEF DESCRIPTION OF THE DRAWING 
     The present invention will be described with reference to the accompanying drawings, which are hereby incorporated by reference, wherein: 
     FIG. 1 shows a first embodiment of a low power frequency-stabilized CMOS oscillator which can be used in the system of FIG. 4. 
     FIG. 2 shows an alternative, less preferred embodiment of a low power frequency-stabilized CMOS oscillator which can be used in the system of FIG. 4. 
     FIG. 3 shows timing diagrams of waveforms appearing at various points in the circuit of FIG. 1. 
     FIG. 4 shows the overall organization of a sample system embodiment employing the oscillator of FIG. 1. 
     FIG. 5 shows the trimming capacitances used in the presently preferred embodiment. 
     FIG. 6 shows a typical curve of output voltage (V out ) versus input voltage (V in ) behavior of an inverter stage for a typical MOS inverter circuit. 
     FIG. 7 shows the detailed circuitry preferably used, in the presently preferred embodiment, to remap interrupts. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     The present invention will now be described in great detail with reference to a sample preferred embodiment. However, it must be realized this embodiment is illustrative only. As will be recognized by those skilled in the art, a wide variety of modifications and variations can be made to still take advantage of the inventive concepts. 
     FIG. 4 shows a sample system embodiment employing the oscillator shown in FIG. 1. This sample subsystem embodiment uses the timing capabilities of this precision oscillator to provide a battery-backed clock circuit, which retains a very accurate time signal even when system power goes down. In addition, in a larger subsystem environment, the timing function is also used to monitor the activity of a microprocessor. For example, if a processor has not shown any activity on the pins being monitored over a certain length of time (for example one second or 100 seconds), this subsystem may be programmed to activate a signal which would indicate to the system that the microprocessor may have crashed. (This capability is referred to as the WatchDog (TM) mode of operation.) 
     FIG. 7 shows the detailed circuitry preferably used, in the presently preferred embodiment, to remap outgoing interrupt signals to one pin or another, and to modify the electrical format of the outgoing interrupt signals. 
     Transmission gates 710A, 710B, 712A, and 712B control the connection of signal lines WAF and TDF to output buffer 720A (which drives the contact pad leading to pin INTA) and output buffer 720B (which drives the contact pad leading to pin INTB). When signal IPSW is high, transmission gates 710A and 710B will be turned on, so that internal line WAF (masked by WAM) will drive pin INTB and internal line TDF (masked by TDM) will drive pin INTA. When signal IPSW is low, transmission gates 712A and 712B will be turned on, so that internal line TDF (masked by TDM) will drive pin INTB and internal line WAF (masked by WAM) will drive pin INTA. 
     Relative device dimensions are shown for some of the logic gates: the dimension &#34;WP&#34; indicates the width of the PMOS transistors (in microns, unscaled), and the dimension &#34;WN&#34; indicates the (unscaled) width of the NMOS transistors. Channel lengths are 2 microns, except where noted otherwise. Where not specified, inverter and transmission gates have a PMOS width of 16 and an NMOS width of 6.5; NAND and NOR gates use a PMOS channel width of 16, and an NMOS channel width of 13 (microns unscaled). As is well known to those skilled in the art of integrated circuit design, straightforward scaling rules can be applied to shrink these dimensions. 
     Note also that signal IBHL determines whether the signal on pin INTB will be active-high or active-low. 
     The signals TDF and WAF are also modified by other logic which is not shown in FIG. 7. If pulse-mode operation has been selected, as described above, then a signal on lines TDF or WAF will be cut off after 10 milliseconds by an internal timing circuit. 
     Since the subsystem environment of the preferred embodiment is intended to be proof against a system power failure, a wide range of voltages must be tolerated on the on-chip power supply (V DD ). Normally, the system power supply voltage (V CC ) will be specified to a range between 4.5 and 5.5 Volts. The battery 499 (shown in FIG. 4) provides a backup for the system power supply. However, to avoid excessive drain on the battery, the battery 499 will be connected to provide the on-chip power supply V DD  only when the system voltage falls down as low as three Volts. Therefore, the local supply voltage V DD  seen by the timing circuit may range from 5.5 Volts (when the system is operating, and at the high end of its voltage range) all the way down to 2.5 Volts (when the battery back-up has been activated, and is operating at the low end of its voltage range). 
     In FIG. 4, oscillator 410 includes the stages shown separately, in FIG. 1, as 110, 140, 130, 150, and 160. Divide-by-8 circuit 440 includes three flip-flops 170 (one of which is shown in FIG. 1, and each of the two divide-by-40.96 circuits 442 is implemented using a counter, as discussed above. One of the resulting 100 Hz outputs 443 is provided, through the watchdog alarm counter, as an output, and one is provided, through Hundredths register 444, to updating logic 446. 
     This integrated circuit provides a compact system, including a self contained Real Time Clock, Alarm, Watchdog Timer, and Interval Timer, in a 28 pin JEDEC DIP package. The integrated circuit is preferably packaged together with an embedded lithium energy source 499 and a quartz crystal 102, which eliminates need for any external circuitry. Data contained within 64 eight bit registers 411-414 and 444 (shown in FIG. 4) can be read or written in the same manner as bytewide static RAM. Data is maintained by intelligent control circuitry which detects the status of system power supply V CC  and write-protects memory when V CC  is out of tolerance. The lithium energy source 499 can maintain data and real time for over ten years in the absence of V CC . The clock information includes hundredths of seconds, seconds, minutes, hours, day, date, month, and year information. The date at the end of the month is automatically adjusted for months with less than 31 days, including correction for leap years. The real-time clock operates in either 24 hour or 12 hour format with AM/PM indicator. The timer provides alarm windows and interval timing between 0.01 seconds and 99.99 seconds. The real time alarm provides for preset times of up to one week. 
     The integrated circuit executes a read cycle, under control of address decode/control logic 402, whenever WE* (Write Enable complemented) is inactive (high) and CE* (Chip Enable complemented) and OE* (Output Enable complemented) are active (low). The unique address specified by the six address inputs (A0-A5) defines which of the 64 registers 411-413 is to be accessed. Valid data will be available to the eight data output drivers 430 within t Acc  (Access Time, which is the presently preferred embodiment is specified at 150 nsec) after the last address input signal is stable, providing that CE* and OE* access times are also satisfied. If OE* and CE* access times are not satisfied, then data access must be measured from the latter occurring signal (CE* or OE*), and the limiting parameter is either t CO  (150 nsec, in the presently preferred embodiment) after the CE* transition, or t OE  (75 nsec, in the presently preferred embodiment) after the OE* transition, rather than address access. 
     The integrated circuit is in the write mode whenever the WE* (Write Enable) and CE* (Chip Enable) signals are in the active (Low) state after the address inputs are stable. The latter occurring on a falling edge of CE* or WE* will determine the start of a write cycle. The write cycle is terminated by the earlier rising edge of CE* or WE*. All address inputs must be kept valid throughout the write cycle. WE* must return to the high state for a minimum recovery state (t WR , which in the presently preferred embodiment is specified at 10 nsec) before another cycle can be initiated. Data must be valid on the data bus with sufficient Data Set Up Time (t DS , which in the presently preferred embodiment is 60 nsec) with respect to the earlier rising edge of CE* or WE*. The OE* control signal should be kept inactive (High) during write cycles to avoid bus contention. However, if the output bus has been enabled (CE* and OE* active), then WE* will disable the outputs in t ODW  (which in the presently preferred embodiment is 50 nsec) from its falling edge. 
     This integrated circuit provides full functional capability when V CC  is greater than 4.5 Volts, and write protects the register contents at 4.25 Volts typical. Data is maintained in the absence of V CC  without any additional support circuitry. The supply voltage is constantly monitored, and, if it begins to fall, all inputs to the registers become Don&#39;t Care. However, the two interrupts INTA* and INTB* (INTB) and the internal clock and timers continue to run regardless of the level of V CC . As V CC  falls below approximately 3.0 Volts, a power switching circuit 420 connects the internal lithium energy source 499, to maintain the clock and timer data and functionally. During power up, when V CC  rises above approximately 3.0 Volts, the power switching circuit 420 connects external V CC  and disconnects the internal lithium energy source 499. Normal operation can resume after V CC  exceeds 4.5 Volts for a period of 150 msec. 
     The integrated circuit also has 64 8-bit registers 411, 412, 413, 414, and 444, which contain all of the Timekeeping, Alarm, Watchdog, Control, and Data information. These registers are memory locations which contain external (user accessible) registers 411 and 412, 413, 414, and 444, as well as internal registers 411&#39;, 412&#39;, 414&#39;, and 444&#39; which contain additional copies of the data. The external copies are independent of internal functions, except that they are updated periodically by the simultaneous transfer of the incremental internal copy. The Command Register bits are affected by both internal and external functions. This register will be discussed later. The 50 bytes of user RAM registers 413 can only be accessed from the external address and data bus. 
     The preferred organization of registers 411-414 and 444 will now be discussed in greater detail. Registers 0, 1, 2, 4, 6, 8, 9 and A (within registers 411 and 444) contain time of day and date information. (Specifically, register 444 contains the hundreths-of-second information, and in software this register is referred to as register 0.) Time of Day information is stored in BCD (binary-coded decimal) format. Registers 3, 5, and 7 contain the Time of Day Alarm Information. Time of Day Alarm Information is stored in BCD. Register B provides the Command Register 412, and information in this register is binary. Registers C and D provide the Watchdog Alarm Registers 414, and information in these two registers is in BCD. Registers E through 3F provide user RAM 413, and can be used to contain data at the user&#39;s discretion. 
     Registers 0, 1, 2, 4, 6, 8, 9, and A contain Time of Day data in BCD. Ten bits within these eight registers are not used and will always read zero regardless of how they are written. Bits 6 and 7 in the Months Register (9) are binary bits. When set to logical zero, EOSC (Bit 7) enables the Real Time Clock oscillator. This bit is set to logical one when the integrated circuit is shipped, to prevent drain on lithium energy source 499 during storage and shipment. This bit will normally be turned on by the user during device initialization. However, the oscillator can be turned on and off as necessary by setting this bit to the appropriate level. Bit 6 of this same byte controls the Square Wave Output (pin 24). When set to logical zero, the Square Wave Output Pin will output a 1024 Hz Square Wave Signal. When set to logic one the Square Wave Output Pin is in a high impendance state. Bit 6 of the Hours Register is defined as the 12 or 24 Hour Select Bit. When set to logic one, the 12 Hour Format is selected. In the 12 Hour Format, Bit 5 is the AM/PM Bit with logical one being PM. In the 24 hour Mode, Bit 5 is the Second 10 Hour bit (20-23 hours). The Time of Day Registers are updated every 0.01 seconds from the Real Time Clock, except when the TE bit (Bit 7 of Register B) is set low or the clock oscillator is not running. 
     The preferred method of synchronizing data access to and from the real-time clock is to access the Command Register 412 by doing a write cycle to address location OB and setting the TE bit (Transfer Enable bit) to logic zero. This will freeze the External Time of Day Registers at the present recorded time, allowing access to occur without danger of simultaneous update. When the watch registers have been read or written, a second write cycle is made to location OB, setting the TE bit to a logic one. (This will put the time of Day Registers back to being updated every 0.01 second.) No time is lost in the Real Time Clock, because the internal copy of the Time of Day Registers buffers are continually incremented while the external memory registers are frozen. An alternate method of reading and writing the Time of Day Registers is to ignore synchronization. However, any single read may give erroneous data, since the Real Time Clock may be in the process of updating the external memory registers as data is being read. The internal copies of seconds through years are incremented, and Time of Day Alarm is checked, during any period when hundreds of seconds reads 99, and are transferred to the external register when hundredths of seconds roll from 99 to 00. A way of making sure data is valid is to do multiple reads and compare. Similarly, another way of making sure that the write cycle has caused proper update is to do read verifies and re-execute the write cycle if data is not correct. The probability of an incorrect result is kept to a minimum due to the redundant structure of the Watchdog TimeKeeper. 
     Registers 3, 5, and 7 contain the Time of Day Alarm Registers. Bits 3, 4, 5, and 6 of Register 7 will always read zero regardless of how they are written. Bit 7 of Registers 3, 5, and 7 are mask bits. When all of the mask bits are logical zero, a Time of Day Alarm will only occur when Registers 2, 4, and 6 match the values stored in Registers 3, 5, and 7. An alarm will be generated every day when Bit 7 of Register 7 is set to a logical one. Similarly, an alarm is generated every hour when Bit 7 of Register 5 is set to a logical 1. If Bit 7 of Register 3 is set to logical 1, an alarm will occur every minute when Register 1 (seconds) rolls from 59 to 00. 
     Time of Day Alarm Registers are written and read in the same format as the Time of Day Registers. The Time of Day Alarm Flag and Interrupt is always cleared when Alarm Registers are read or written. 
     Registers C and D contain the time for the Watchdog Alarm. The two registers contain a time count from 00.01 to 99.99 seconds in BCD. The value written into the Watchdog Alarm Registers can be written or read in any order. Any access to Register C or D will cause the Watchdog Alarm to reinitilize and clears the Watchdog Flag Bit and the Watchdog Interrupt Output. When a new value is entered or the Watchdog Registers are read, the Watchdog timer will start counting down from the entered value to zero. When zero is reached, the Watchdog Interrupt Output will go to the inactive state. The Watchdog Timer Countdown is interrupted and reinitialized back to the entered value every time either of the registers are accessed. In this manner, controlled periodic accesses to the Watchdog Time can prevent the Watchdog Alarm from ever going to an active level. If access does not occur, countdown alarm will be repetitive. The Watchdog Alarm Registers always read the entered value. The actual count down register is internal and is not readable. Writing registers C and D to zero will disable the Watchdog Alarm Feature. 
     Address location OB is the Command Register 412 where mask bit, control bits, and flag bits reside. 
     Bit 0 is the Time of Day Alarm Flag (TDF). When this bit is set internally to a logical one, an alarm has occurred. The time of the alarm can be determined by reading the Time of Day Alarm Registers. However, if the transfer enable bit is set to logical zero the Time of Day registers may not reflect the exact time that the alarm occurred. This bit is read only, and writing this register has no effect on the bit. The bit is reset when any of the Time of Day Alarm Registers are read. 
     Bit 1 is the Watchdog Alarm Flag (WAF). When this bit is set internally to a logical one, a Watchdog Alarm has occurred. This bit is read only and writing this register has no effect on the bit. The bit is reset when any of the Watchdog Registers are accessed. 
     Bit 2 of the Command Register 412 contains the Time of Day Alarm Mask Bit (TDM). When this bit is written to a logical one, the Time of Day Alarm Interrupt Output is deactivated regardless of the value of the Time of Day Alarm Flag. When TDM is set to logical zero, the Time of Day Interrupt Output will go to the active state which is determined by bits 0, 4, 5, and 6 of the Command Register 412. 
     Bit 3 of the Command Register 412 contains the Watchdog Alarm Mask Bit (WAM). When this bit is written to a logical one, the Watchdog Interrupt Output is deactivated regardless of the value in the Watchdog Alarm Registers. When WAM is set to logic zero, the Watchdog Interrupt Output will go to the active state which is determined by bits 1, 4, 5, and 6 of the Command Register 412. These four bits define how Pin-Swap Logic 450 will operate the Interrupt Output Pins INTA* and INTB* (INTB). 
     Bit 4 of the Command Register 412 determines whether both interrupts will output a pulse or level when activated. If Bit 4 is set to logic one, the pulse mode is selected. In this case the INTA and INTB will be driven for a minimum of 3 msec when activated. 
     When Bit 5 is set to logic one, the B interrupt will source current. When Bit 5 is set to logical zero, the B interrupt will sink current. 
     Bit 6 of the Command Register 412 directs which type of interrupt will be present on interrupt pins INTA* or INTB* (INTB). When set to logical one, INTA* becomes the Time of Day Alarm Interrupt Pin and INTB* (INTB) becomes the Watchdog Interrupt Pin. When Bit 6 is set to logical zero, the interrupt functions are reversed such that the Time of Day Alarm will be output on INTB* (INTB) and the Watchdog Interrupt will be output on INTA*. Caution should be exercised when dynamically setting this bit as the interrupts will be reversed even if in an active state. 
     Bit 7 of the Command Register 412 is for Transfer Enable (TE). 
     FIG. 1 shows a sample embodiment of a low-power CMOS oscillator for use in the integrated circuit system of FIG. 4. A crystal 102 is shown at the top of the Figure (but of course this crystal would normally be separate from the integrated circuit containing the active elements shown). In the presently preferred embodiment, this crystal is a quartz crystal with a resonant frequency of 32.768 kHz, which is specified to accuracy of 20 parts per million. (Such a crystal will typically have a Q of about 75000.) 
     This crystal is connected across a CMOS amplifier stage 110. This amplifier stage contains a pull-up transistor 112 and a pull-down transistor 114. In the presently preferred embodiment, the pull-up transistor 112 has a channel length of 12 microns, and the pull-down transistor 114 has a channel length of 12 microns also. 
     The pull-up transistor 112 is a PMOS enhancement mode transistor, and the pull-down transistor 114 is an N-channel insulated-gate (NMOS) enhancement mode transistor. The gates of these two devices are commonly connected to a node B at one side of the crystal, and their outputs are connected to a node A, at the other side of the crystal. In device 112, a back-gate connection is made to the supply voltage V DD  (which in this embodiment may vary from 2.5 to 5.5 Volts), and a back gate connection for transistor 114 is made to a virtual ground (local supply voltage) V SSH1 , which will be between 0.5 and 1.5 Volts (when V DD  is 2.5 Volts) under typical operating conditions. 
     The source resistor 120, in the presently preferred embodiment, has a value in the range of 8 to 10 Megohms, but of course other values could be used. (Alternatively, an active element could be substituted for all or part of this resistor, but this is less preferred.) The source resistor minimizes power consumption, by providing a virtual ground level for the oscillator (and for the first stages of the output buffer) which is far above the system ground voltage. When the oscillator is operating, the virtual ground level will be defined by the device threshold voltages (and will be equal to approximately one PMOS threshold voltage (V TP ) plus one NMOS threshold voltage (V TN ) below the on-chip positive supply voltage (V DD )); but the source resistor will regulate the current consumed by the active circuits. 
     The output of the amplifier 110 is also connected to a transmission gate 130. This transmission gate includes an NMOS transistor 134 and a PMOS transistor 132, both with very long channels, connected in parallel. During steady-state operation, the gates of these two transistors are connected to substantially DC voltages (at nodes EN and EN*). (These lines are used differently to start oscillation at power-up, as will be described below.) This transmission gate preferably will have significant body effect, so that the effective threshold voltages of the devices in the transmission gate are increased slightly in magnitude. Therefore, even though the gates of the devices in the transmission gate are tied to V DD  and V SSH1 , the transmission gate will be barely off if the bias at node B (as shown in FIG. 1) is optimal. However, if the bias point needs to be shifted, the transmission gate 130 will pass charge accordingly. The back bias connection of transistor 132 is to the supply voltage V DD , and the back channel connection of transistor 134 is to supply voltage V SSH1 . In the present preferred embodiment, these transistors are each 2600 microns long. 
     The pull-up transistor 133 guarantees a low power state when the oscillator is turned off. In this state (where signal EN is low, and transmission gate 130 is therefore turned off), transistor 133 will pull node B high. This assures that p-channel transistors 112 and 142 will be turned off, and that n-channel transistors 114 and 144 will be turned on. Therefore, no current will flow through resistor 120, and voltage V SSH1  will be equal to ground potential (zero volts). This helps assure low power consumption during standby mode, and also helps to guarantee a predictable turn-on sequence when oscillation is initiated. 
     The output of this transmission gate 130 is connected across to the input side of the amplifier stage 110. AC coupling from node A to node B will occur primarily through the crystal 102. The coupling through transmission gate 130 is quasi-DC, and serves to set the bias point of node B. The AC signal coupled through the crystal from node A to node B will be appropriately biased to drive the first stage 140 of the output buffer. 
     The first stage 140 of the output buffer is a somewhat unusual CMOS buffer stage. In addition to a driver transistor 144 and a load transistor 142, this stage also includes a pass transistor 146. In the presently preferred embodiment, the driver transistor and load transistor are both 6 microns long, but the pass transistor is 30 microns long. 
     Additional logic is included to control the pass transistor 146 in accordance with an external mode-select signal. A first mode-select transistor 147 (which is a PMOS transistor) connects the gate of the pass transistor to node B, if the mode-select signal goes low. The second mode-select transistor 148 (which is NMOS) connects the gate of the pass transistor to system ground (zero Volts, rather than the virtual ground) to turn this transistor hard on in a second mode. 
     During operation of the oscillator, if mode-select transistor 147 is turned on, pass transistor 146, load transistor 142, and pull-up transistor 112 will receive the same signal on their gates. However, since mode-select transistor 147 has a much longer channel than pull-up transistor 112 or load transistor 142, it will have a higher effective impedance when these transistors are just turned on (i.e. if node B is just below V DD  -V TP ). Thus, in this mode, much more current will be passed by amplifier 110 than by first stage 140. This helps to maximize loop gain. 
     In addition, the use of transistor 146 also permits the transistors of the first stage 140 to be made somewhat shorter than they otherwise would. Since transistor 147 provides a higher impedance when needed, transistor 142 and 144 can be made shorter, and transistor 112 and 114 can be much longer than would otherwise be desirable. 
     FIG. 3 shows samples of approximate waveforms appearing at various nodes shown in the circuit of FIG. 1, during the various modes of operation. 
     The first period shown, labelled &#34;OSC DISABLED&#34;, represents periods when the oscillator is not being operated. At this time the enable signal EN is low (and its complement EN* is high), so that transmission gate 130 is turned off. PMOS transistor 133 is turned on (by the low level of signal EN), so that node B is pulled up to the positive supply voltage (5 V, in this example). PMOS transistors 142 and 112 are therefore turned hard off, so that no current will be drawn and no oscillation can occur. NMOS transistor 114 and 144 will be turned on, so that nodes A and D will be pulled down to virtual ground voltage V SSH1 . Since essentially no current is being drawn, no voltage drop will be present across resistor 120, and virtual ground voltage V SSH1  will be at ground voltage (0 V). 
     The second period shown in FIG. 3, which is labelled &#34;OSC ENABLED,&#34; represents the approximate timing relations after signal EN is driven high to start the oscillation. Transistor 133 turns off, and transmission gate 130 turns on, so that nodes A and B can move towards equal long-time-average voltages (which will be roughly equal to V DD  -V TP ). (As noted, transmission gate 130 is very long, so that nodes A and B are coupled with an effective time constant which is relatively long. As this occurs, current will be drawn through source resistor 120, so that voltage V SSH1  also increases. These changes bring the oscillator to a condition where feedback can occur across amplifier 110. After some delay, oscillation therefore begins, at a frequency largely determined by the crystal 102. (The onset of oscillation is shown in the third period, labelled &#34;OSC ENABLED-RUNNING.&#34;) As the amplitude of these oscillations increases, the AC signal on node B will eventually become large enough to begin switching devices 142 and 144. Since transistor 147 is turned hard on, the voltage on node C will be essentially equal to that on node B. Therefore, as the AC signal on node B increases, it will eventually become large enough to begin switching transistor 146 in phase with transistor 142 (which is controlled directly by node B). When all three of the transistors 142, 144, and 146 are being switched by the AC signal, an amplified signal will appear on node D (whose DC level has increased as virtual ground voltage V SSH1  has increased). 
     Thus, the events during the second and third periods have established stable oscillation, at the desired frequency. Thereafter, during the fourth period (labelled &#34;OSC RUNNING-CHANGE MODE), the mode-select signal MS is brought high, to change the mode of operation. This turns off PMOS transistor 147, and turns on NMOS transistor 148, so that node C (at the gate of PMOS pass transistor 146) is tied to ground. This keeps transistor 146 turned hard on, so that first-stage inverter 140 acts as if transistor 146 were shorted out, and a digital signal of the desired frequency continues to appear on node D. 
     In the presently preferred embodiment, the mode select signal MS is taken from a power fail monitoring signal. The system supply voltage is tracked and, when it falls below acceptable limits, the mode select signal is brought low. However, alternatively, of course, other sources could be used for this control signal. 
     The output of the first stage of the output buffer 140 (at node D) is connected to a second stage 150 of the output buffer. This second stage 150 is a more conventional CMOS inverter stage, except that the load transistor 152 and the driver transistor 154 are connected from the supply voltage only to the virtual ground V SSH1 , and not to the system ground. Similarly, in the presently preferred embodiment, a third stage 160 is connected to the output of the second stage 150. Thus, the output of the second 150 and third stage 160 provide complementary outputs from the oscillator, and thus provide complementary timing signals. 
     Some of the widths and lengths of important devices are as follows. These widths and lengths are specified in the presently preferred embodiment, and some of course, could be widely modified and varied. However, they will help to further illustrate, to those skilled in the art, the relation of the devices in the presently preferred embodiment. 
     The PMOS pass transistor 146 (in the first buffer stage 140) has a width of 30 microns and a length of 30 microns. 
     The PMOS mode-select transistor 146 has a width of 6.5 microns and a length of 2 microns. 
     The NMOS mode-select transistor 147 has a width of 6.5 microns and a length of 2 microns. 
     The PMOS load transistor 142 in the first buffer stage 140 has a width of 30 microns and a length of 6 microns. 
     The NMOS driver transistor 144 in the first buffer stage 140 has a width of 10 microns and a length of 6 microns. 
     The PMOS load transistor 152 in the second stage of the buffer has a width of 19.5 microns and a length of 2 microns. 
     The NMOS driver transistor 154 in the second stage of the buffer has a width of 6.5 microns and a length of 2 microns. 
     The PMOS pull-up transistor 112 in the amplifier 110 has a width of 60 microns and a length of 12 microns. 
     The NMOS pull-down transistor 114 in the amplifier 110 has a width of 20 microns and a length of 12 microns. 
     The PMOS transistor 132 in the transmission gate 130 has a width of 2.75 microns and a length of 2600 microns. 
     The NMOS transistor 134 in the transmission gate 130 has a width of 2.75 microns and a length of 2600 microns. 
     As is conventional in the art of timing circuits, flip-flops and counters are used to divide down the oscillator output to provide timing signals at desired intervals. In the presently preferred embodiment, the desired output frequency is 100 Hertz. 
     In the presently preferred embodiment, the output D has a frequency of 2 15  per second (32.768 kHz). Three low-power flip-flop stages 170 (powered by V DD  and V SSH1 ) divide this down to 4096 Hertz. 
     To get the desired 100 Hertz output signal, a level-shifter and counter is used. Since 4096 is not an integer multiple of 100, the counter counts up to 41 for 24 counting cycles, and then counts up to 40 for every 25th counting cycle. This produces an output which includes phase error on 24 of every 25 output pulses, but which does have an average frequency of precisely 100 Hertz. 
     Of course, other subsystem configurations could be used instead. Depending on the relation of available crystal frequency to desired output frequency, some configurations do not require the non-integral division operation just described. 
     FIG. 2 shows an alternative, less preferred circuit configuration. Note that the first buffer stage 240 is asymmetrical, and the pass transistor 146 is omitted. In this embodiment, the NMOS driver transistor 244 is only 4 microns long, but the PMOS load transistor 242 is 8 microns long. The amplifier 210 uses 8 micron long transistors for pull-up 212 and pull-down 214. 
     In this embodiment, the load transistor 242 is made comparably long with pull-up 112, but driver 244 is made shorter than pull-down 114. This asymmetry helps to provide drive to the second stage, while adequately tracking the behavior of node A. 
     While the embodiment of FIG. 2 is believed to be novel, and may be advantageous in some applications, it has been found that the embodiment of FIG. 1 is more advantageous in the system context described. 
     FIG. 5 shows how capacitive trimming is preferably implemented, with trimming capacitor arrays available for connection to both input and output sides of the crystal. As shown in FIG. 5, the presently preferred embodiment uses a layout for trimming capacitors which provides selectable capacitors to be connected to both of the leads X1 and X2 of the crystal. The use of trimming capacitance to present an optimal load to a crystal resonator in a precision frequency-controlled oscillator circuit is well known to those skilled in the art, but in discrete configurations of such circuits it has not been practical to trim on both sides of the crystal. However, in integrated circuit embodiments, such as that of the present invention, this option can be used at little additional cost. The advantage of trimming on both sides of the crystal is that better loop gain can be maintained. 
     In the presently preferred embodiment, trimming is provided between the crystal connections X1 and the high supply voltage V DD . However, alternatively, trimming capacitors to ground (or to a different reference voltage) could be used instead. 
     For each of the two crystal leads X1 and X2, four transmission gates 511A/B, 512A/B, 513A/B, and 514A/B are available to connect the line X1 or X2 to capacitors 501A/B, 502A/B, 503A/B, and/or 504A/B respectively. The transmission gates are paired, so that, for example, a high level on line CAP1 would turn on both transmission gate 511A (connecting line X1 to capacitor 501A) and transmission gate 511B (connecting line X2 to capacitor 501B). Similarly, line CAP2 controls both transmission gates 512A (connecting line X1 to capacitor 502A) and transmission gate 512B (connecting line X2 to capacitor 502B), and lines CAP3 and CAP4 are connected analogously. (Actually the signals CAP1 through CAP4 also have respective complementary signals CAP1* through CAP4*, which are connected to the inverting inputs of transmission gates 511A/B through 514A/B. However, for clarity, these additional lines are not shown.) 
     In the presently preferred embodiment, capacitors 501A through 504B are configured using gate oxides to silicon substrate. Using gate oxides of approximately 225 Angstroms thickness, the resulting specific capacitance is about 1.5 fF (femtoFarads) per square micron. 
     In the presently preferred embodiment, capacitors 501A and 501B have values of approximately 0.75 pF each, capacitors 502A and 502B have values of 1.37 pF each, capacitors 503A and 503B have values of approximately 2.3 pF each, and capacitors 504A and 504B have values of approximately 3.2 pF each. Two fixed load capacitors (of about 3.5 pF in this embodiment) are also connected to each of the crystal leads, in parallel with one of the trimming capacitor sets 501A-504A or 501B-504B. Of course, it will be readily understood by those skilled in the art that a tremendous variety of values could be used, and the foregoing numbers are provided simply for illustration. 
     After the integrated circuit is packaged, the static logic gates which switch these trimming capacitors in or out of the circuit will preferably be activated. Preferably, this is done by making a complete package, including a battery, an integrated circuit in a DIP (or other) package, and a crystal which is connected to the leads of the DIP package, and then checking the frequency of oscillation. (In test mode, two flip-flops are used to divide the frequency of oscillation by 4, and this 8 kHz signal is brought out to a pin.) Thus, the trimming capacitors can be used to jointly compensate any errors in the crystal resonant frequency and any deviations in the load capacitance seen by the crystal. A control signal sequence is then used to write appropriate bits into the static logic gates which select or deselect the trimming capacitors. 
     In the presently preferred embodiment, trimming capacitance is added in equal amounts on the input and output sides of the amplifier. However, alternatively, different trim capacitance values could be connected to the two sides, to provide a larger number of available increments of capacitance. In a further alternative (and less preferred) embodiment, trim capacitances could be added in increments to equalize the total capacitances (not merely the trim capacitances) on the two leads of the crystal. Depending on the circuit configuration and device dimensions chosen, the leads of the crystal may have capacitances which are initially unequal. (For example, one lead will normally be connected to the amplifier input, and will be loaded by the MOS gate capacitances of the amplifier and of the input to the following stage, and may therefore have a larger capacitance to ground.) 
     In the presently preferred embodiment, the trimming capacitance on each lead can be selected to be zero, or to have values ranging from about 0.75 pF to about 8 pF. Thus, the total added load capacitance (from the trimming capacitors plus the fixed load capacitor) on each of the crystal leads can be adjusted from about 3.5 pF to about 11 pF. This is in addition to the parasitic capacitances due to transistor gates, metallization, bonding leads, Miller capacitance, etc. The elements of the integrated circuit will typically provide about 6 pF of parasitic capacitance to each lead, in addition to the parasitic capacitance across the crystal (of about 1.5 pF). However, of course, a wide range of other values could be used. 
     As will be recognized by those skilled in the art, the present invention may be adapted to a wide range of system and subsystem embodiments. 
     Further description of various implementation features of the presently preferred embodiment, together with additional background on timekeeping circuits generally, may be found in the following applications of common assignee, which are hereby incorporated by reference: 
     Ser. No. 208,889, Filed Jun. 17, 1988 (LOW POWER TIMEKEEPING SYSTEM-Attorney&#39;s Docket Number 2846-69), copending; 
     Ser. No. 208,891, Filed Jun. 17, 1988 (DYNAMIC PLA TIME CIRCUIT-Attorney&#39;s Docket Number 2846-70), now U.S. Pat. No. 4,959,646; 
     Ser. No. 208,287, Filed Jun. 17, 1988 (DYNAMIC CMOS BUFFER FOR LOW CURRENT SWITCHING-Attorney&#39;s Docket Number 2846-81), now U.S. Pat. No. 4,876,465; and 
     Ser. No. 208,288, Filed Jun. 17, 1988 (DELAY CIRCUIT PROVIDING SEPARATE POSITIVE AND NEGATIVE GOING EDGE DELAYS-Attorney&#39;s Docket Number 2846-82), now abandoned. 
     As will be recognized by those skilled in the art, the present invention may be adapted to a wide range of system and subsystem embodiments. 
     The foregoing merely provide a few examples of the versatility of the disclosed innovative concepts. The embodiments specifically discussed are therefore to be understood as illustrative of the innovative concepts, and not limiting. The full scope of the innovative concepts is defined only by the claims of the issued patent.