Abstract:
A method and apparatus provide input protection in a system having a controller which monitors a controller terminal for at least one monitor period. The controller terminal is coupled for bi-directional operation. The controller terminal is set to an output configuration for at least a portion of the time that the controller terminal is not being monitored by the controller.

Description:
BACKGROUND OF THE INVENTION 
     The present invention pertains generally to the operation of a controller. More particularly, the present invention pertains to a method and apparatus for operating a controller to provide the controller with input protection. 
     Microcontrollers and microprocessors are presently in wide use. They are used to control many systems, such as heating systems. Part of the function of a controller in controlling a heating system is to monitor input signals which represent system conditions in the heating system. Based upon the signals monitored, the controller commands various output signals which, in turn, alter control of the heating system. For example, in some heating systems pressure switches are monitored, the flame in the heating system is verified, and other safety conditions are also monitored. Based upon these conditions, the controller may shut down the heating system or operate it in various modes as the conditions require. 
     In any case, it is generally necessary to provide input terminals or input ports to the controller with protection against transients and voltage spikes caused by, among other things, static discharge. This protection generally takes the form of a diode and resistor network which is implemented with discrete components externally to the controller integrated circuit (IC) chip. In addition, some microcontroller and microprocessor IC chips also have internal protection which takes the form of a similar diode and resistor network. 
     There are several reasons why these protection techniques are either ineffective or inadequate. First, present applications of microcontrollers and microprocessors require them to be very small in size. This requires chip manufacturers to continually downsize the die of microcontroller and microprocessor IC chips. In downsizing the die, the chip manufacturers are required to reduce the size of the resistors and diodes used for input protection on the die. Similarly, the external diodes and resistors used for protection are also required to be very small. Reducing the size of the input protection resistors and diodes results in a corresponding decrease in effectiveness as input protection. 
     Second, the input ports on the microcontroller or microprocessor are often coupled to a device, such as a thermostat, which is physically set or controlled by an operator. When the operator touches the control, a transient in the range of approximately 25 kilovolts, caused by static discharge, can be applied to the input of the microcontroller or microprocessor. However, typical resistors used in the internal and external protection techniques described above generally break down when 300-400 volts are applied across them. Hence, the internal and external protection techniques are inadequate to handle a transient in the range of 25 kilovolts. 
     For these reasons, there is a continuing need to provide adequate and effective techniques for protecting microcontrollers and microprocessors and other circuitry against transients. 
     SUMMARY OF THE INVENTION 
     A method and apparatus provide input protection in a system having a controller with a controller terminal. The controller terminal is coupled for bi-directional operation. The controller is programmed to configure the controller terminal as an output when the controller is not monitoring the controller terminal. Thus, the configuration of the controller terminal provides input protection when it is not being monitored. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIG. 1 is a schematic diagram of an input protection circuit in the control system of the present invention. 
     FIG. 2 is a schematic diagram of an internal protection circuit control system of the present invention. 
     FIG. 3 is a graph of the input voltage applied to an input terminal, and the actual voltage appearing at an input node of the control system of the present invention plotted against time. 
    
    
     DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS 
     FIG. 1 is a diagram of control system 10 showing controller 12 in block form and external input protection circuit 14 in schematic form. Control system 10 comprises controller 12, input protection circuit 14 and operator select switch 16 (switch 16). Input protection circuit 14 is comprised of resistors R1, R2 and R3 and diodes D1 and D2 and is coupled to input/output (I/O) terminal 18 of controller 12. Although the present invention can be implemented on multiple controller terminals for multiple system inputs, only one terminal (I/O terminal 18) is illustrated for convenience. 
     In this preferred embodiment, control system 10 is a heating control system, controller 12 is a heating system controller for controlling a heating system, and switch 16 is an operator select switch which is set by an operator in the field to indicate a certain operating parameter to controller 12. Controller 12 monitors and verifies various heating system parameters at its input terminals and I/O terminals and commands various outputs based on those parameters. For example, select switch 16 indicates to controller 12 a portion of the model number of the heating mechanism being controlled so that controller 12 adjusts its operation accordingly. Hence, on power up, controller 12 reads the state of switch 16 by monitoring I/O terminal 18. Based on the state of switch 16, controller 12 adjusts its operation to command certain outputs during its operation. 
     Input protection circuit 14 is used, in this preferred embodiment, to protect I/O terminal 18 against high voltage transients applied at switch 16 which may result, for example, from static discharge Resistor R2 acts as a current limiting resistor impeding any transient applied at switch 16. Diode D1 clamps the voltage transient as it reaches a diode threshold voltage above supply voltage VDD. Similarly, diode D2 is provided to clamp the voltage transient as it reaches a diode threshold voltage below ground. Resistor R3 further current limits and impedes the transient. 
     Although input protection circuit 14 provides some protection against transients, the breakdown voltage for resistor R2 is typically in the range of 300 to 400 volts. Thus, if a 25 kilovolt transient is applied at switch 16, resistor R2 breaks down and becomes ineffective as a current limiter. Similarly, conduction of diodes D1 and D2 is not instantaneous. Therefore, if a sharp transient voltage spike is applied at switch 16, diodes D1 and D2 do not completely prevent the voltage spike from reaching controller 12 and input protection circuit 14 is ineffective and provides inadequate protection for controller 12. 
     In addition, resistors R1, R2 and R3 and diodes D1 and D2 of input protection circuit 14 are often comprised of discrete components. These discrete components are expensive and inefficient because they take time to assemble and occupy costly space on a circuit board. Thus, the elimination of input protection circuit 14 is desirable. 
     Some embodiments of the present invention render input protection circuit 14 optional. Other embodiments provide enhanced input protection to controller 12 in addition to that provided by input protection circuit 14. FIG. 2 is a diagram of control system 10 showing input protection circuit 14 in block form and controller 12 partially in schematic form. Controller 12 includes an internal protection circuit which is similar to input protection circuit 14. The internal protection circuit includes resistor R4 and diodes D3 and D4. Also, since I/O terminal 18 is capable of operating as both an input and an output, controller 12 has an input stage which includes transistors Q1 and Q2 and an output stage which includes transistors Q3 and Q4. Controller 12 also includes processing logic 20. 
     To monitor the signal at I/O terminal 18 (in this preferred embodiment, the state of switch 16) processing logic 20 controls the input and output stages in a familiar manner. For example, to monitor the signal at I/O terminal 18, processing logic 20 turns off transistors Q3 and Q4. The signal appearing at I/O terminal 18 is provided to the internal protection circuit and to input stage transistors Q1 and Q2. Based upon the state of switch 16, either transistor Q1 or Q2 is turned on and the other is turned off. Processing logic 20 then monitors the signal appearing at input node 22 and commands certain outputs based on that signal. 
     Although the internal protection circuit provides controller 12 with some protection against high voltage transients, as with input protection circuit 14, the internal protection circuit can be ineffective and inadequate. Resistor R4 breaks down at voltages which are far lower than a typical voltage transient applied at switch 16. Similarly, the size of resistor R4 and the speed and size of diodes D3 and D4 is reduced due to the continuing pressure on IC chip manufacturers to decrease the die size of controller 12. This makes the input protection circuit in controller 12 less effective. 
     In order to provide additional input protection for controller 12, the present invention utilizes the output stage of controller 12. In this embodiment, the state of switch 16 is only read once, upon power up. Therefore, after the state of switch 16 is read, controller 12 no longer monitors the signal appearing at I/O terminal 18. To provide additional input protection, processing logic 20 is programmed to turn on output transistor Q3 after the state of switch 16 has been read. When Q3 is turned on, it drives the signal appearing at I/O terminal 18 to a logic low level. In essence, transistor Q3 acts as an additional resistor between I/O terminal 18 and ground. The effective resistor provided by transistor Q3 is an additional mechanism for sinking current from transients to ground. 
     In this preferred embodiment, where switch 16 is only read once during the operation of controller 12, processing logic 20 turns on transistor Q3 immediately after switch 16 is initially read. Thus, transistor Q3 provides additional transient protection for controller 12 against transients appearing on I/O terminal 18 throughout the remainder of the operation of controller 12. 
     The technique of turning I/O terminal 18 into an output and driving a logic low level can also be used where the signal appearing at I/O terminal 18 is periodically monitored by controller 12. For example, the present invention can be implemented where switch 16 is replaced with a signal representing a different heating system parameter such as a heat demand signal, a recycle limit signal, or an interlock signal. In that case, the signal appearing at I/O terminal 18 is typically a sine or square wave and controller 12 monitors the signal once every half cycle to ensure that the sine or square wave is present. 
     FIG. 3 is a graph showing a signal VIO (representing one of the system parameters mentioned above) applied to I/O terminal 18 as well as input signal VIN appearing at logic input node 22 plotted against time, where the technique of the present invention is implemented. In this preferred embodiment, controller 12 monitors I/O terminal 18 each half cycle to determine whether VIO is present (i.e. whether VIO is going positive and negative during successive half cycles). Controller 12 waits for a time t1 until VIO should have reached a certain voltage threshold. Then, controller 12 monitors I/O terminal 18 for a period equal to t2-t1 to determine whether VIO is above the voltage threshold. Next, controller 12 waits until time t3 when it again monitors I/O terminal 18 for a period t4-t3 to determine whether VIO has gone below a voltage threshold. Controller 12 continually monitors I/O terminal 18 once each half cycle to ensure the presence of VIO. 
     When the technique of the present invention is used, processing logic 20 is programmed to turn on transistor Q3 at all times except during the monitoring windows (t2-t1 and t4-t3 ) for each cycle. This results in the effective resistance of Q3 to ground being enabled for a large percentage of each operating cycle. For example, where VIO is a 60 Hertz sine wave and where the monitoring windows t2-t1 and t4-t3 are 50 microseconds each, transistor Q3 is turned on for over 99% of the cycle. Hence, by simply programming processing logic 20 to turn on transistor Q3 in the output stage of controller 12 when I/O terminal 18 is not being monitored, additional input protection is provided to controller 12 without using additional space and without any additional assembly time. 
     CONCLUSION 
     The present invention provides input protection to microcontrollers and microprocessors against transient signals which appear at the input terminals. By simply programming processing logic 20 to turn on transistor Q3 (thus driving I/O terminal 18 to a logic low level) while I/O terminal 18 is not being monitored, an additional resistor for sinking current is effectively provided. This additional input protection technique can be used in place of input protection circuit 14 or merely as additional input protection to controller 12. 
     In addition, the present input protection technique is flexible and can be used where I/O terminal 18 is not monitored by controller 12, where it is monitored only once during the operation of controller 12 or where it is periodically monitored. 
     Further, the technique of the present invention can be used without increasing the size of controller 12 where the terminal being monitored is configured for operation as an input and an output. Also, however, the technique can be used where the terminal is configured only as an input if one transistor (Q3) is added to the internal circuitry of controller 12 or externally. 
     Although the present invention has been described with reference to preferred embodiments, workers skilled in the art will recognize that changes may be made in form and detail without departing from the spirit and scope of the invention.