Input signal conditioning for microcomputer

Abstract: A circuit with hysteresis for converting an analog signal into a logic signal. In response to the state of the feedback signal from a microcomputer, a signal proportional to the analog signal is either intensified for providing a lower threshold value or diminished for providing an upper threshold value. By recognising the intensified and diminished signals with respect to a predetermined value, the analog signal is converted to a two-state signal.

Description: The invention relates to an apparatus for translating a signal into a two-state input signal for a microcomputer. Conversion of an analog signal into a two-state signal is necessary before digital processing. For example, in automobile applications, a sensor coupled to an automobile's drivetrain provides an analog signal having a frequency related to vehicular speed. After conversion to a digital signal, a microcomputer detects the time interval of each cycle and computes vehicular speed by conventional algorithms. A problem encountered is that the sensor signal has a high degree of noise due to the physical environment of the sensor and appropriate connecting cables. This noise may be erroneously detected as a signal transition thereby adversely affecting any resulting computations. It is known to use a low pass filter between the sensor signal and microcomputer to improve signal to noise ratio as disclosed in U.S. patent 4,668,875 issued to Miyazaki et al on 26 May 1987. However, dependent upon the particular application, a low pass filter may not provide sufficient signal to noise ratio over a wide range of signal frequencies. An approach to improve signal to noise ratio is to use multiple transistors configured as a differential amplifier for providing a comparator with hysteresis about an external reference signal. When the input signal exceeds the reference signal by the hysteresis value, a logic "1" output is provided. Conversely, when the input signal falls below the reference signal by the hysteresis value, a logic "0" output is provided. One disadvantage of this approach is that noise components may cause false triggering at either the upper or lower threshold values. False triggering at the threshold values may be reduced by connecting a latching circuit to the differential amplifier as disclosed in U.S. patent 4,642,484 issued to Skovmand et al on 10 February 1987. Patent Abstracts of Japan JP-A-62 049 717 discloses an integration circuit comprising a capacitive circuit connected to an operational amplifier. The operational amplifier constitutes a comparator having hysteresis characteristics such that the threshold when the output inverts from low to high becomes larger than when the output inverts from high to low. The integration circuit enables the detection of a relatively long pulse even when an input voltage momentarily drops and then returns to the original voltage and malfunctions caused by noise can be suppressed. A disadvantage of the above approaches is the circuit complexity of using comparators or differential amplifiers and latching circuitry. In applications such as automotive applications, where the size and resulting interconnections of electrical circuitry are constrained by a host module, these disadvantages may be prohibitive. It is an object of the present invention to provide a circuit for conditioning an input signal to a microcomputer utilizing hysteresis comparison with minimal components. The above problems and disadvantages are overcome, and object achieved, by providing a circuit for translating a signal into a two-state input signal for use by a microcomputer, as defined in the independent Claims. By subtracting electrical energy from the signal to generate a diminished signal, a relatively large positive excursion in the signal is required before a logic "1" is recognised. Similarly, by adding electrical power to generate an intensified signal after a logic "1" is recognised, a relatively large negative excursion in the signal is required before a logic "0" is recognised. The converse is true after a logic "0" is recognised. An advantage is thereby obtained of having a hysteresis comparator without the need for differential amplifiers or multiple comparators by utilizing simple feedback from a controller or microcomputer as described herein. Preferably, after recognising an interrupt transition, the microcomputer disregards further changes in the interrupt signals until after generating the feedback output. An additional advantage is thereby obtained of providing noise immunity at the threshold levels without the need for additional circuitry such as latching circuitry and the like. The invention will now be described further, by way of example, with reference to the accompanying drawings, in which : Figure 1 is a somewhat simplified electrical schematic of an embodiment of the invention; Figures 2A-2D represent various electrical waveforms associated with the embodiment shown in Figure 1; Figure 3 is an electrical schematic of aspects of the invention; Figures 4A-4D represent various electrical waveforms associated with the embodiment shown in Figure 3; Figure 5 is an electrical schematic of an embodiment of the invention; and Figure 6 represents various process steps associated with the embodiment shown in Figure 5. Referring first to Figure 1, a controller such as microcomputer 12, an off-the-self device sold by Motorola as Part No. MC68HC05 in this example, is shown coupled to signal Vs through circuitry described in greater detail hereinafter. For this particular example, a speed sensor (not shown) coupled to the engine drive train (not shown) generates analog signal Vs having a frequency related to vehicular speed. After the signal conditioning described below, microcomputer 12 calculates vehicular speed in a conventional manner by first computing elapsed time between two corresponding edge transitions of signal Vs. Microcomputer 12 is shown connected to a conventional power source (V p ) and a signal return (shown as ground). Feedback output 14 provides a two-state output responsive to input 16. For the example shown herein, microcomputer 12 recognises a logic "1" state when the voltage at input 16 is above one-half V p and recognises a logic "0" state when the input voltage is below one-half V p . Feedback output 14 is set near ground potential when input 16 is at a logic "1" and set at a high impedance, essentially open, when input 16 is at a logic "0". Switching transistor 20, a bipolar NPN transistor in this example, is shown having a control or base electrode connected to node 22, an output or collector electrode connected to node 24, and another output or emitter electrode connected to signal ground. Node 22 is also shown connected to signal Vs via series resistor 28. Resistors 30 and 32 are shown connected in series through node 34. The series interconnection of resistors 30 and 32 is connected between node 22 and V p . Resistor 38 is shown connected between node 24 and V p . The operation of the circuitry shown in Figure 1, including microcomputer 12, is now described with reference to the associated waveforms shown in Figures 2A-2D. Initial conditions are shown before time t 0 when input 16 is recognised as a logic "1" and feedback output 14 of microcomputer 12 is at a logic "0". During this time, node 34 is essentially at ground potential such that a portion of the electrical energy or current applied to node 22 from signal Vs flows through resistor 30 to ground via feedback output 14. Thus, the electrical signal at node 22, as shown in Figure 2B, is both proportional to signal Vs and diminished by the current flowing through resistor 30. Referring to Figures 2A and 2B, the diminished signal at node 22 increases in response to an increasing signal Vs thereby turning on transistor 20 at time t 0 . As transistor 20 turns on in response to base current flowing from node 22, the voltage at node 24 is pulled down through the dynamic impedance of transistor 20 towards ground. As the voltage at input 16 falls below 1/2 V p , microcomputer 12 recognises it as a logic "0" (Figure 2C). In response, microcomputer 12 switches feedback output 14 to a high impedance. Resistors 30 and 34 are thereby connected directly in series between V p and node 22. Accordingly, the electrical signal present at node 22 is now intensified by current flowing through resistors 30 and 34. This intensified signal is shown in Figure 2B between times t 0 and t 1 . Stated another way, the signal at node 22, which is proportional to signal Vs, is abruptly offset in the positive direction in response to feedback output 14 switching to a high impedance state after time t 0 . As signal Vs decreases, the intensified signal at node 22 also decreases until transistor 20 turns off at time t 1 . The voltage at node 24 then rises towards V p resulting in recognition by microcomputer 12 of a logic "1" at input 14. In response, microcomputer 12 switches feedback output 14 to the logic "0" state as shown in Figure 2D. When feedback output 14 is switched to the logic "0" state, resistor 34 is again coupled between node 22 and ground potential thereby diminishing the electrical signal at node 22. Stated another way, the signal at node 22 is abruptly offset in the negative direction as shown at time t 1 in Figure 2B. Operation then continues until time t 2 in a manner similar to that described previously with particular reference to the time interval preceding t 0 . It is noted that the operation of diminishing and enhancing the signal at node 22 essentially provides an upper and lower threshold, respectively, to signal Vs. While the signal at node 22 is intensified, a decrease in Vs to the lower threshold value shown in Figure 2A is required before transistor 20 turns off and a logic "1" is recognised by microcomputer 12. Similarly, while the signal at node 22 is diminished, an increase in Vs to the upper threshold value shown in Figure 2A is required before transistor 20 turns on and microcomputer 12 recognises a logic "0". It is also noted that considerable noise immunity is provided to the switching operation by both enhancing and diminishing the signal at node 22. More specifically, when the signal at node 22 is offset in the positive direction, any noise variation in signal Vs coupled to node 22 must at least overcome the positive offset before triggering transistor 20. The same is true with respect to a negative offset of the signal at node 22. An arrangement is now described with reference to Figure 3 wherein like numerals refer to like parts shown in Figure 1, and also with reference to the associated electrical waveforms shown in Figures 4A-4D. In this particular example, microcomputer 12′ provides a logic "1" or positive voltage of approximately V p when input 16′ is recognised as a logic "1", and provides a logic "0", essentially ground potential, when a logic "0" is recognised at input 16′. As in the embodiment illustrated in Figure 1, a logic "1" is recognised when input 16′ exceeds one-half V p , and a logic "0" is recognised below one-half V p . Input 16′ of microcomputer 12′ is shown connected to node 42. Resistor 48 is shown connected between node 42 and signal Vs; resistor 52 is shown connected between node 42 and ground potential; and resistor 50 is shown connected between node 42 and feedback output 14′. Referring to the time interval before t 0 in Figures 4A-4D, feedback output 14′ is at a logic "0" thereby connecting resistors 50 and 52 in parallel to ground. Accordingly, the electrical signal at node 42 is diminished. When signal Vs increases sufficiently for the diminished signal to be recognised as a logic "1" at input 16′ (time t 0 in Figure 4A through 4D), microcomputer 12′ switches feedback output 14′ to a logic "1" state. Resistor 50 is thereby coupled between node 42 and approximately V p while only resistor 52 remains coupled between node 42 and ground. Thus, as compared to the time interval before t 0 , additional current flows into node 42 (through resistor 50) while less current flows out of node 42 (through resistor 52 towards ground). The signal at node 42 is accordingly intensified, or offset in a positive direction after time t 0 . With the signal being intensified, Vs decreases to the lower threshold value (Figure 4A) before the signal at node 42 falls sufficiently to be recognised as a logic "0" by microcomputer 12′ (at time t 1 ). Thereafter, the operation proceeds in a similar manner as that described before time t 0 . It is noted that the amount of positive and negative offset of the signal at node 42 is related to the respective lower and upper threshold limits of signal Vs. Those skilled in the art will recognise that these limits are selectable by appropriate selection of resistors 48, 50, and 52. For example, when these resistive values are equal, the upper threshold value is equal to three-halves V p , and the lower threshold value is equal to one-half V p . An embodiment is presented herein with reference to Figure 5 wherein like numerals refer to like parts shown in the embodiment of Figure 1. Microcomputer 12" is shown having conventional positive edge interrupt line 16a" and negative edge interrupt line 16b" whereas the embodiment illustrating microcomputer 12 in Figure 1 showed a single input line 16. The operation of microcomputer 12" is similar to that described previously herein with reference Figures 1 and 2 except that microcomputer 12" is now responsive to edge transitions on the interrupt lines rather than the recognition of a logic state. In operation, when Vs crosses the upper threshold value shown in Figure 2A, transistor 20" turns on providing a negative edge on interrupt line 16b". Microcomputer 12" then sequentially performs the following steps described with reference to Figure 6. Interrupts, whether positive or negative, are detected and stored in step 82. A determination is then made that a negative edge interrupt occurred in step 86 and feedback output 14" is subsequently set at a high impedance in step 88. Any subsequent interrupts which may have occurred between execution of steps 86 and 88 are cleared in step 90. These subsequent interrupts may have been due to noise before feedback output 14" was switched. Thus, additional noise immunity is provided in response to the interrupt inputs. Microcomputer 12" then performs the desired processing by computing the cycle period of signal Vs. In a similar manner, when Vs crosses the lower threshold shown in Figure 2A, transistor 20" turns off resulting in a positive edge at interrupt line 16a". Microcomputer 12" then determines that a positive edge interrupt occurred in steps 86 and 90. In response, feedback output 14" is set to a logic "0" state. Any subsequent interrupts which may have occurred before feedback output 14" was set to a logic "0" state are cleared in step 102. The desired processing of conditioned signal Vs is then performed as shown in step 102.

Claims: A signal processing apparatus for receiving an analog signal from a signal sensor and for processing the received signal, the apparatus comprising, a controller (12) having an input (16) to receive the analog signal and effective to generate a feedback control signal at a feedback output (14) in response to the analog signal, the controller (12) being able to recognise a first input level of the analog signal exceeding a first predetermined threshold value to switch the feedback signal to a first state and being able to recognise a second input level below a second predetermined threshold level to switch the feedback signal to a second state, the controller (12) being connected to receive the analog signal, at the input (16) thereof, by way of summing means (20, 28, 30, 32, 38), the feedback output (14) being connected to supply the feedback signal to the summing means, the summing means being effective, when the feedback signal is in the first state, to respond thereto by adding electrical energy to said analog signal to generate an intensified analog signal, and the summing means being effective, when the feedback signal is in the second state, to respond thereto by subtracting electrical energy therefrom to generate a diminished analog signal, whereby the analog signal is intensified or diminished in value relative to the first and second predetermined threshold values in accordance with the state of the feedback signal, characterised in that, the summing means further comprises a switching transistor (20) having a control electrode coupled to receive the intensified or diminished analog signal, a first output electrode connected to a source of electrical power, and a second output electrode coupled to a ground potential, and the controller is in the form of a microcomputer (12), the microcomputer comprising a positive edge interrupt input and a negative edge interrupt input both connected to said first output electrode. Apparatus as claimed in claim 1, wherein the analog signal is coupled to a first node (22) and said summing means further comprise, a first resistor (30) and a second resistor (32) coupled in series between said first node (22) and the source of electrical power, a second node (34) connected between said first resistor (30) and said second resistor (32), and said feedback control signal from said microcomputer is connected to said second node (34). Apparatus as claimed in claim 1 or 2, wherein said microcomputer (12) recognises said analog signal on a positive transition or negative transition and disregards further changes in said analog signal until after generating said feedback control signal. Apparatus as claimed in claim 1, 2 or 3, wherein said switching transistor comprises an NPN transistor, said control electrode comprises a gate electrode, said first output electrode comprises a collector electrode, and said second output electrode comprises an emitter electrode. Apparatus as claimed in any one of the preceding claims, wherein said microcomputer (12) provides said first feedback signal state at a high impedance and provides said second feedback signal state at substantially zero potential. A method of processing an analog signal received from a signal sensor, the method comprising, applying the analog signal to an input (16) of a controller (12) effective to generate a feedback control signal at a feedback output (14) in response to the analog signal, the controller (12) being able to recognise a first input level of the analog signal exceeding a first predetermined threshold to switch the feedback signal to a first state and being able to recognise a second input level below a second predetermined threshold level to switch the feedback signal to a second state, the analog signal being applied to the input (16) of the controller by way of summing means (20, 28, 30, 32, 38), the feedback control signal being supplied to the summing means, the summing means being used to add electrical energy to the analog signal, when the feedback signal is in the first state, to generate an intensified analog signal, and the summing means being used to subtract electrical energy from the analog signal, when the feedback signal is in the second state, to generate a diminished analog signal, whereby the analog signal is intensified or diminished in value relative to the first and second predetermined threshold values in accordance with the state of the feedback signal, characterised in that, the intensified or diminished analog signal is applied to a control electrode of a switching transistor (20) included in the summing means, the switching transistor having a first output electrode connected to a source of electrical power and a second control electrode coupled to a ground potential, and the controller is in the form of a microcomputer having a positive edge interrupt input and a negative edge interrupt input both connected to said first output electrode.

Inventors: WEBER CHARLES FRANCIS, WEBER, CHARLES FRANCIS
Applicants: FORD FRANCE, FORD MOTOR CO, FORD WERKE AG, FORD FRANCE S. A., FORD MOTOR COMPANY LIMITED, FORD-WERKE AKTIENGESELLSCHAFT
Application year: 1989
Main classification: H03K3
IPC codes: H03K3, G06F3