Patent Description:
The present disclosure relates generally to diagnostic methods for magnetic field sensors.

As is known, sensors are used to perform various functions in a variety of applications. Some sensors include one or magnetic field sensing elements, such as a Hall effect element or a magnetoresistive element, to sense a magnetic field associated with proximity or motion of a target object, such as a ferromagnetic object in the form of a gear or ring magnet, or to sense a current, as examples.

Sensor integrated circuits are widely used in automobile control systems and other safety critical applications. There are a variety of specifications that set forth requirements related to permissible sensor quality levels, failure rates, and overall functional safety.

Documents <CIT> and <CIT> disclose magnetic field sensor circuits implementing self-test features comprising a comparator.

According to a first aspect of the invention, there is provided a magnetic field sensor according to claim <NUM>.

According to a second aspect of the invention, there is provided a method for performing testing of a magnetic field sensor according to claim <NUM>.

Referring to <FIG>, a magnetic field sensor <NUM> is shown, including a magnetic field sensing element <NUM> and a signal path <NUM>, according to the present disclosure. The signal path <NUM> includes a filter circuit <NUM> and a Schmitt trigger circuit <NUM>, with a diagnostic circuit <NUM> coupled to the filter circuit <NUM>. In compliance with ASIL (Automotive Safety Integrity Level) requirements, diagnostic signals are used to determine if the sensor <NUM> incurs failures or is not operating properly. In accordance with the present disclosure, diagnostic test samples are interleaved with the incoming signal at the input of the filter <NUM> by the diagnostic circuit <NUM> to verify correct operation of the filter <NUM> and Schmitt trigger <NUM>. By interleaving the diagnostic signals at the input of the filter, the front-end amplifier (e.g., amplifier <NUM>) is not interrupted by the diagnostics, and the latency added can be as small as a single chopping period. If the front-end amplifier were to be interrupted, this could cause a delay of up to <NUM>µsecs (microseconds) or more in processing the magnetic field signal. It will be appreciated that, although shown and described with reference to a sinc filter, the filter <NUM> can be any appropriate averaging filter or other filtering circuit. It will also be appreciated that although sensor <NUM> used to describe the diagnostic apparatus and methods of the disclosure is a magnetic field sensor, the diagnostics are suitable and beneficial for use with any type of sensor utilizing a filter and Schmitt trigger/comparator arrangement, including but not limited to temperature sensors and pressure sensors.

The magnetic field sensor <NUM> includes a magnetic field sensing element <NUM> that generates a magnetic field signal responsive to a magnetic field proximate to the magnetic field sensing element <NUM>. The term "magnetic field sensor" <NUM> or simply "sensor" is used to describe a circuit that includes one or more magnetic field sensing elements, generally in combination with other circuits. The magnetic field sensor can be, for example, a rotation detector, a movement detector, a current sensor, or a proximity detector.

Magnetic field sensor <NUM> can be used in a variety of applications, including, but not limited to, an angle sensor that senses an angle of a direction of a magnetic field, a current sensor that senses a magnetic field generated by a current carried by a current-carrying conductor, a magnetic switch that senses the proximity of a ferromagnetic object, a rotation detector (or movement detector) that senses passing ferromagnetic articles, for example, magnetic domains of a ring magnet or a ferromagnetic target (e.g., gear teeth) where the magnetic field sensor is used in combination with a back-bias or other magnet, and a magnetic field sensor that senses a magnetic field density of a magnetic field.

The magnetic field sensing element <NUM> can be, but is not limited to, a Hall effect element, a magnetoresistance element, or a magnetotransistor and can include one or more such elements of the same or different types. As is known, there are different types of Hall effect elements, for example, a planar Hall element, a vertical Hall element, and a Circular Vertical Hall (CVH) element. As is also known, there are different types of magnetoresistance elements, for example, a semiconductor magnetoresistance element such as Indium Antimonide (InSb), a giant magnetoresistance (GMR) element, for example, a spin valve, an anisotropic magnetoresistance element (AMR), a tunneling magnetoresistance (TMR) element, and a magnetic tunnel junction (MTJ). The magnetic field sensing element may be a single element or, alternatively, may include two or more magnetic field sensing elements arranged in various configurations, e.g., a half bridge or full (Wheatstone) bridge. Depending on the device type and other application requirements, the magnetic field sensing element may be a device made of a type IV semiconductor material such as Silicon (Si) or Germanium (Ge), or a type III-V semiconductor material like Gallium-Arsenide (GaAs) or an Indium compound, e.g., Indium-Antimonide (InSb).

The magnetic field signal generated by the magnetic field sensing element <NUM> is input to a dynamic offset cancellation circuit <NUM>, which is output to an amplifier <NUM>. The amplifier <NUM> is coupled to receive the magnetic field signal from the magnetic field sensing element <NUM> and generate an amplified signal for coupling to the filter circuit <NUM> (sinc filter). The output of the amplifier <NUM> is provided to a demodulation block <NUM>, and a low-pass filter <NUM>, and then the filter circuit <NUM>. Dynamic offset cancellation circuit <NUM> may take various forms including chopping circuitry and may function in conjunction with demodulation block <NUM> to remove offset that can be associated with the magnetic field sensing element <NUM> and/or the amplifier <NUM>. For example, offset cancellation circuit <NUM> can include switches configurable to drive the magnetic field sensing element (e.g., Hall plate) in two or more different directions such that selected drive and signal contact pairs are interchanged during each phase of the chopping clock signal and offset voltages of the different driving arrangements tend to cancel. The low-pass filter circuit <NUM> can be designed to remove undesirable spectral components in the resulting signal to generate a filtered signal for coupling to signal path <NUM>.

The diagnostic circuit <NUM> is coupled to the sinc filter <NUM>, which is also coupled to Schmitt trigger <NUM>. The diagnostic circuit <NUM>, filter circuit <NUM>, and Schmitt trigger circuit <NUM> are shown in greater detail in <FIG>. Suffice it to say here that the filter <NUM> functions to average two or more samples of the magnetic field signal in order to remove any of the filtered Hall Plate offset and front-end amplifier offset, which are at the chopping frequency and the output of the sinc filter <NUM> is compared to a reference voltage by the Schmitt trigger circuit <NUM>.

More particularly, during "signal cycles" of the sensor operation, the Schmitt trigger <NUM> compares the filtered signal (from the sinc filter <NUM>) to a Schmitt reference or threshold (internal to the Schmitt trigger circuit <NUM>). During interleaved "diagnostic cycles" of the sensor operation, the Schmitt trigger <NUM> compares a diagnostic signal (from diagnostic circuit <NUM>) to the Schmitt threshold.

The diagnostic circuit <NUM> is coupled to the sinc filter <NUM> and is configured to interleave a diagnostic signal with the magnetic field signal, as will be appreciated in light of the present disclosure. The diagnostic circuit <NUM> can generate the diagnostic signal using a current DAC source passing through a resistor, as shown in greater detail in <FIG>, for example. Thus, by changing either the amount of current or the resistor value, the diagnostic signal can be set to be a predetermined percentage or an absolute value greater than or less than the Schmitt threshold. The diagnostic signal is used to ensure that the sinc filter <NUM> and Schmitt trigger <NUM> are operating properly.

The output of the Schmitt trigger <NUM> is coupled to system diagnostics controller, or processor <NUM> that is configured to generate through output control <NUM>, an output signal of the sensor <NUM> at output pin OUT. The sensor output signal can take various forms, such as a voltage signal in the case of a so-called three-wire output configuration as shown or a current signal in the case of a so-called two-wire output in which the output signal information is provided in the form of current pulses on the power and ground connections to the sensor. Also, it will be appreciated that various sensor output signal formats are possible.

Functionality of the controller <NUM> will be described further below. As used herein, the term "processor" or "controller" is used to describe an electronic circuit that performs a function, an operation, or a sequence of operations. The function, operation, or sequence of operations can be hard coded into the electronic circuit or soft coded by way of instructions held in a memory device. A "processor" can perform the function, operation, or sequence of operations using digital values or using analog signals. In some embodiments, the "processor" can be embodied in an application specific integrated circuit (ASIC), which can be an analog ASIC or a digital ASIC. In some embodiments, the "processor" can be embodied in a microprocessor with associated program memory. In some embodiments, the "processor" can be embodied in a discrete electronic circuit, which can be an analog or digital. A processor can contain internal processors or internal modules that perform portions of the function, operation, or sequence of operations of the processor. Similarly, a module can contain internal processors or internal modules that perform portions of the function, operation, or sequence of operations of the module. A regulator <NUM> is coupled between a supply voltage VCC and ground and to the various components and sub-circuits of the sensor <NUM> to regulate the voltage supplied thereto.

Referring also to <FIG>, the sinc filter circuit <NUM>, the Schmitt trigger circuit <NUM>, and the diagnostic circuit <NUM> are shown in greater detail. Signal <NUM>, that may be the same as or similar to the signal at the output of low pass filter <NUM>, is coupled to the filter circuit <NUM>. It will be appreciated that the "front end" components and configuration of the sensor <NUM> can vary, for example by eliminating chopping. Thus, in general, the sinc filter circuit <NUM> receives a signal representative of the magnetic field signal generated by the sensing element <NUM>.

The sinc filter <NUM> includes a first sampling capacitor C1, a first filter switch Sw_s1, a second sampling capacitor C2, a second filter switch Sw_s2, and an averaging circuit <NUM>. The sinc filter circuit <NUM> averages two samples using two switches Sw_s1 and Sw_s2 that take the samples at the chopping frequency, which samples are then averaged at the averaging circuit <NUM>. The averaging circuit <NUM> is coupled to the first and second sampling capacitors C1 and C2 to average a voltage across the first and second sampling capacitors C1 and C2 and generate a filtered signal. The filter circuit <NUM> may be a sinc filter or other appropriate filtering circuit capable of performing the functions described herein including but not limited to a finite impulse response (FIR) filter. The first filter switch Sw_s1 is configured to be in a closed position to couple the amplified signal (e.g., <NUM>) to the first sampling capacitor C1, or in an open position to decouple the amplified signal from the first sampling capacitor C1. The second filter switch Sw_s2 is configured to be in a closed position to couple the amplified signal (e.g., <NUM>) to the second sampling capacitor C2, or in an open position to decouple the amplified signal from the second sampling capacitor C2.

It will be appreciated in light of the present disclosure that two switches Sw_s1 and Sw_s2 are shown to capture two samples per signal cycle, however more than two switches can be implemented to capture more than two samples at the chopping frequency. For example, four switches can be provided to generate four samples per signal cycle. Further, the samples can be weighted by the same weight or by a different weight. Additionally, although the system illustrates a single-ended signal for simplicity in explanation, it will be appreciated that the same concepts can be applied to differential signals.

The output of the sinc filter <NUM> is compared to a reference voltage at the Schmitt trigger circuit <NUM> that includes a comparator <NUM> and latch <NUM>. The comparator <NUM> is configured to compare a Schmitt trigger reference voltage or threshold <NUM> to the output of the sinc filter <NUM>. It should be understood that a so-called "comparator" can be comprised of an analog comparator having a two state output signal indicative of an input signal being above or below a threshold level (or indicative of one input signal being above or below another input signal). However, the comparator can also be comprised of a digital circuit having an output signal with at least two states indicative of an input signal being above or below a threshold level (or indicative of one input signal being above or below another input signal), respectively, or a digital value above or below a digital threshold value (or another digital value), respectively.

The reference voltage <NUM> is generated by a current (e.g., from a current DAC <NUM>) passing through a resistor RDAC. The reference voltage <NUM> is changed between an operate point (BOP, the level of a strengthening magnetic field at which the sensor switches on) and a release point (BRP, the level of a weakening magnetic field at which the sensor switches off) by a controller (e.g., controller <NUM> in <FIG>) according to the state of the comparator output. The difference between the BOP and BRP reference voltage levels corresponds to the hysteresis of the sensor and permits clean output switching even in the presence of mechanical vibration and electrical noise.

The output of the comparator <NUM> is coupled to an input of a latch <NUM>. The output of the comparator <NUM> is sampled at each rising edge of the signal SCH_LATCH (shown in <FIG>) and the state of the switch (i.e., the output of latch <NUM>) is updated.

In order to verify correct operation of the sinc filter circuit <NUM> and the Schmitt trigger circuit <NUM>, diagnostic test samples are interleaved at the input of the sinc filter circuit <NUM> with samples of signal <NUM>. According to the present disclosure, a diagnostic test sample is inserted after each pair of signal samples.

The diagnostic circuit <NUM> includes a diagnostic signal generator configured to generate the diagnostic signal <NUM>. In this example, the diagnostic signal generator comprises a current source <NUM> and a variable resistor <NUM> RDIAG. The diagnostic circuit <NUM> further includes first and second diagnostic switches Sw_d. Both switches Sw_d are closed at the same time to sample the diagnostic reference <NUM> during the diagnostic signal cycles.

The diagnostic reference <NUM> is a replica of the Schmitt trigger reference <NUM>, however it can be set to be a percentage (or an absolute value) higher or lower than the Schmitt trigger reference, by either changing the value of RDIAG <NUM> or current DAC <NUM>. The diagnostic signal <NUM> can be a predetermined percentage (or an absolute value) higher or lower than the Schmitt trigger threshold. Thus, changing RDIAG <NUM> to be a percentage (or an absolute value) higher or lower than the Schmitt resistor RDAC, or increasing current from DAC <NUM> to be a percentage (or an absolute value) higher or lower than the current from DAC <NUM>, causes diagnostic reference <NUM> to be offset accordingly from the Schmitt trigger reference <NUM>. Accordingly, the system diagnostics controller <NUM> (<FIG>) can evaluate if the Schmitt trigger <NUM> responds correctly for a given diagnostic reference value, by determining if the comparator output goes high or low as expected for the given diagnostic reference. If a failure is detected, the sensor <NUM> can go into a safe mode or the failure can remain as a latent fault, as will be described in greater detail herein.

Referring also to <FIG>, example signals associated with the sensor <NUM> of <FIG> and <FIG> are shown, including the sensor output <NUM>, Schmitt output latch <NUM>, Schmitt output <NUM>, and cycle indicator <NUM> indicated as either a "signal cycle" (e.g., 316a, 316c, 316e) or a "diagnostic cycle" (e.g., 316b, 316d). Signal cycles 316a, 316c, 316e occur during first time periods (e.g., T1) when the sensor <NUM> evaluates the magnetic field signal and diagnostic cycles 316b, 316d occur during second time periods (e.g., T2) when the sensor evaluates signals from the diagnostic circuit <NUM>. More particularly, during diagnostic cycles 316b, 316d, diagnostic samples are interleaved into the sinc filter <NUM> and are used to test the functionality of the sinc filter <NUM> and Schmitt trigger <NUM>. In the example waveforms of <FIG>, one diagnostic sample is interleaved after each pair of signal samples and there are no system failures present in the sinc filter <NUM> or the Schmitt trigger <NUM>. It will be appreciated however, that other numbers of diagnostic samples can be interleaved and that such diagnostic samples can be interleaved less frequently than after each pair of signal samples. The sensor output <NUM> can be the same as or similar to the signal provided at the OUT pin (<FIG>), the Schmitt output latch <NUM> can be provided at the output of the Schmitt trigger latch <NUM>, and the Schmitt output <NUM> can be provided at the output of the comparator <NUM>.

Control signals <NUM>, as may be generated by clock logic <NUM> under the control of controller <NUM>, control various sensor functionality and include the SCH_LATCH signal <NUM> for coupling to the latch <NUM>. The latch <NUM> can be updated on the rising edge of the SCH_LATCH pulses 354a - 354e and the sensor output <NUM> can be latched on the falling edge of the SCH_LATCH pulses 354a - 354e. The chopping period <NUM> for the control signals <NUM> is shown.

Switch control signal <NUM> including pulses 350a 350b, 350c controls sampling switch Sw_s1 and switch control signal <NUM> including pulses 352a, 352b, 352c controls sampling switch Sw_s2. Switches Sw_s1 and Sw_s2 are closed at non-overlapping times during each signal cycle 316a, 316c, 316e to sample the signal <NUM> representative of the magnetic field signal. Switch control signal <NUM> including pulses 356a, 356b controls diagnostic switches Sw_d. Switches Sw_d are simultaneously closed during each diagnostic cycle 316b, 316d to sample the diagnostic reference signal <NUM>.

An example input signal <NUM> to the sinc filter is shown by waveform <NUM>. The sampled voltage across capacitor C2 is labelled <NUM> and the sampled voltage across capacitor C1 is labelled <NUM>. The average of the voltages across capacitors C1 and C2 is shown by waveform <NUM>. During the signal cycles 316a, 316c, 316e, the average <NUM> is the average of the samples of the signal <NUM> taken when Sw_s1 and switch Sw_s2 are closed and thus, it is the average of the samples of signal <NUM> that is compared to the Schmitt trigger reference <NUM> by the comparator <NUM>. And, during diagnostic cycles 316b, 316d, the average <NUM> is equal to the sampled diagnostic reference <NUM> and thus, it is the average of the diagnostic reference samples that is compared to the Schmitt trigger reference <NUM> by the comparator <NUM>.

The Schmitt trigger reference <NUM> is shown by waveform <NUM>, as may be generated by a current passing through a resistor (as shown in <FIG>, for example with DAC <NUM> and RDAC). If the average <NUM> is less than the Schmitt trigger reference <NUM>, then the Schmitt output <NUM> is at a logic low level; whereas, if the average <NUM> is greater than the Schmitt trigger reference <NUM>, then the Schmitt output <NUM> is at a logic high level.

During signal cycles 316a, 316c, 316e, the Schmitt reference <NUM> changes, depending on the state of the sensor output <NUM> in order to implement the desired hysteresis. If the output <NUM> is high (as shown), then the Schmitt reference <NUM> is at the BRP level (as shown during all three signal cycles 316a, 316c, 316e). Whereas, if the output <NUM> is low, then the Schmitt reference <NUM> is at the BOP level.

During diagnostic cycles 316b, 316d, the Schmitt trigger reference <NUM> is forced to the level of whichever of the Schmitt trigger reference levels (i.e., BOP or BRP) is desired to be tested. In the example of <FIG>, the Schmitt trigger reference <NUM> is at the operate point BOP to test the BOP reference level (as shown during the diagnostic cycles 316b, 316d).

The diagnostic reference <NUM> is shown by waveform <NUM>, as may be generated by a current passing through a resistor (as shown in <FIG>, for example with DAC <NUM> and RDIAG <NUM>). The interleaved diagnostic signal <NUM> allows the Schmitt trigger reference level <NUM> to be verified to ensure that it is within a desired range of operation and also to detect failures in the sinc filter <NUM> and/or the Schmitt trigger comparator <NUM>. The diagnostic reference waveform <NUM> is sampled during diagnostic cycle 316b at 340a at the rising edge of Sw_d control pulse 356a, and during the diagnostic cycle 316d at 340b at the rising edge of Sw_d control pulse 356b. In the example of <FIG>, the diagnostic reference <NUM> is set to <NUM>% above the Schmitt BOP reference level during the first diagnostic cycle 316b and is set to <NUM>% below the Schmitt BOP reference level during the second diagnostic cycle 316d. As shown, there is no fault detected in either diagnostic cycle 316b or in diagnostic cycle 316d, as the diagnostic threshold is within <NUM>% of the Schmitt reference. In the diagnostic cycle 316b, at <NUM> the average <NUM> is <NUM>% above the Schmitt reference <NUM>, and in the diagnostic cycle 316d at <NUM> the average <NUM> is <NUM>% below the Schmitt reference <NUM>. Thus, there is no fault and the reference is operating correctly.

Referring also to <FIG>, a flow chart illustrates the sensor operation during the diagnostic cycles 316b, 316d during which is can be determined if the BOP reference level is within ±<NUM>% of its intended value. It will be appreciated that the same or similar procedure can be performed to check that BRP reference level is within ±<NUM>% (or another percentage, or an absolute value) of its intended value.

The first diagnostic cycle 316b (during which it is determined whether the BOP reference level is more than <NUM>% greater than the intended level) corresponds to blocks <NUM>, <NUM>, and <NUM> and the second diagnostic cycle 316d (during which it is determined whether the BOP reference level is more than <NUM>% less than the intended level) corresponds to blocks <NUM>, <NUM>, and <NUM>. It will be appreciated that the order of the blocks can be varied, for example to first test the whether the BOP level is within <NUM>% below the Schmitt reference <NUM> and thereafter to test whether the BOP level is within <NUM>% above the Schmitt reference <NUM>.

At block <NUM>, the diagnostic reference <NUM> is set to <NUM>% above the BOP Schmitt reference <NUM>. At block <NUM>, the controller (e.g., controller <NUM> of <FIG>) checks to determine if the output of comparator <NUM> is at the expected level. In the example of <FIG>, if the comparator output <NUM> transitions to a high level (as occurs during diagnostic cycle 316b) as expected, then no fault is detected. If the comparator output <NUM> does not transition to a high level during diagnostic cycle 316b, then a fault or failure is determined to have occurred, and the sensor enters safe mode at <NUM>, as will be explained in greater detail below.

If proper operation is determined to have occurred at block <NUM>, then the second diagnostic cycle 316d is initiated at block <NUM>. More particularly, at block <NUM>, the diagnostic reference <NUM> is set to <NUM>% below the BOP Schmitt reference <NUM>. At block <NUM>, the controller (e.g., controller <NUM> of <FIG>) checks to determine if the output of comparator <NUM> is at the expected level. In the example of <FIG>, if the comparator output <NUM> remains at a low level (as occurs during diagnostic cycle 316d) as expected, then no fault is detected, and the process proceeds to block <NUM>. If the comparator output <NUM> transitions to a high level during diagnostic cycle 316d, then a fault or failure is determined to have occurred, and the sensor enters safe mode at <NUM>, as will be explained in greater detail below.

Referring to <FIG>, example signals associated with the sensor <NUM> of <FIG> and <FIG> are shown, which are similar to the signals shown in <FIG>, except that a failure is detected during the second diagnostic cycle in the waveforms shown in <FIG>. The signals shown include the sensor output <NUM>, Schmitt output latch <NUM>, Schmitt output <NUM>, and cycle indicator <NUM> indicated as either a "signal cycle" (e.g., 416a, 416c, 416e) or a "diagnostic cycle" (e.g., 416b, 416d). Signal cycles 416a, 416c, 416e occur during first time periods when the sensor <NUM> evaluates the magnetic field signal and diagnostic cycles 416b, 416d occur during second time periods when the sensor evaluates signals from the diagnostic circuit <NUM>. More particularly, during diagnostic cycles 416b, 416d, diagnostic samples are interleaved into the sinc filter <NUM> and are used to test the functionality of the sinc filter <NUM> and Schmitt trigger <NUM>. In the example waveforms of <FIG>, one diagnostic sample is interleaved after each pair of signal samples. It will be appreciated however, that other numbers of diagnostic samples can be interleaved and that such diagnostic samples can be interleaved less frequently than after each pair of signal samples. The sensor output <NUM> can be the same as or similar to the signal provided at the OUT pin (<FIG>), the Schmitt output latch <NUM> can be provided at the output of the Schmitt trigger latch <NUM>, and the Schmitt output <NUM> can be provided at the output of the comparator <NUM>.

Control signals <NUM>, as may be generated by clock logic <NUM> under the control of controller <NUM>, control various sensor functionality and include the SCH_LATCH signal <NUM> for coupling to the latch <NUM>. The latch <NUM> can be updated on the rising edge of the SCH_LATCH pulses 454a - 454e and the sensor output <NUM> can be latched on the falling edge of the SCH_LATCH pulses 454a - 454e. The chopping period <NUM> for the control signals <NUM> is shown.

Switch control signal <NUM> including pulses 450a 450b, 450c controls sampling switch Sw_s1 and switch control signal <NUM> including pulses 452a, 452b, 452c controls sampling switch Sw_s2. Switches Sw_s1 and Sw_s2 are closed at non-overlapping times during each signal cycle 416a, 416c, 416e to sample the signal <NUM> representative of the magnetic field signal. Switch control signal <NUM> including pulses 456a, 456b controls diagnostic switches Sw_d. Switches Sw_d are simultaneously closed during each diagnostic cycle 416b, 416d to sample the diagnostic reference signal <NUM>.

An example input signal <NUM> to the sinc filter is shown by waveform <NUM>. The sampled voltage across capacitor C2 is labelled <NUM> and the sampled voltage across capacitor C1 is labelled <NUM>. The average of the voltages across capacitors C1 and C2 is shown by waveform <NUM>. During the signal cycles 416a, 416c, 416e, the average <NUM> is the average of the samples of the signal <NUM> taken when Sw_s1 and switch Sw_s2 are closed and thus, it is the average of the samples of signal <NUM> that is compared to the Schmitt trigger reference <NUM> by the comparator <NUM>. And, during diagnostic cycles 416b, 416d, the average <NUM> is equal to the sampled diagnostic reference <NUM> and thus, it is the average of the diagnostic reference samples that is compared to the Schmitt trigger reference <NUM> by the comparator <NUM>.

During signal cycles 416a, 416c, 416e, the Schmitt reference <NUM> changes, depending on the state of the sensor output <NUM> in order to implement the desired hysteresis. If the output <NUM> is high (as shown), then the Schmitt reference <NUM> is at the BRP level (as shown during all three signal cycles 416a, 416c, 416e). Whereas, if the output <NUM> is low, then the Schmitt reference <NUM> is at the BOP level (as shown during the diagnostic cycles 416b, 416d). If a failure is detected, the state of the sensor output <NUM> is a safe state, which can for example be a level higher than the high value indicative of BOP. Thus, the sensor output has at least three states, including the BOP state, the BRP state, and the safe state.

During diagnostic cycles 416b, 416d, the Schmitt trigger reference <NUM> is forced to the level of whichever of the Schmitt trigger reference levels (i.e., BOP or BRP) is desired to be tested. In the example of <FIG>, the Schmitt trigger reference <NUM> is at the operate point BOP to test the BOP reference level (as shown during diagnostic cycles 416b, 416d).

The diagnostic reference <NUM> is shown by waveform <NUM>, as may be generated by a current passing through a resistor (as shown in <FIG>, for example with DAC <NUM> and RDIAG <NUM>). The interleaved diagnostic signal <NUM> allows the Schmitt trigger reference level <NUM> to be verified to ensure that it is within a desired range of operation and also to detect failures in the sinc filter <NUM> and/or the Schmitt trigger comparator <NUM>. The diagnostic reference waveform <NUM> is sampled during the diagnostic cycle 416b at 440a at the rising edge of Sw_d control pulse 456a, and during the diagnostic cycle 416d at 440b at the rising edge of Sw_d control pulse 456b. In the example of <FIG>, the diagnostic reference <NUM> is set to <NUM>% above the Schmitt BOP reference level during the first diagnostic cycle 416b and is set to <NUM>% below the Schmitt BOP reference level during the second diagnostic cycle 416d. As shown, there is no fault detected in the first diagnostic cycle 416b because the Schmitt output <NUM> transitions to a high level as expected. However, in the second diagnostic cycle 416d, the Schmitt output <NUM> does not transition to a low level as expected, thereby indicating a fault. In the diagnostic cycle 416b, at <NUM> the average <NUM> is <NUM>% above the Schmitt reference, indicating no fault. However, in the diagnostic cycle 416d, at <NUM> the average <NUM> is more than <NUM>% above the Schmitt reference, indicative of BOP reference failure. The sensor output <NUM> is then transitioned into safe mode <NUM>.

<FIG> is a flow chart illustrating an example process <NUM> for performing diagnostic testing of a sinc filter circuit and a Schmitt trigger of a sensor, in accordance with the present disclosure. At block <NUM>, the process <NUM> starts by generating a signal in response to a magnetic field signal. The signal generated in response to the magnetic field signal can, for example, be generated by the magnetic field sensing element <NUM> of <FIG>.

At block <NUM>, the process <NUM> continues by filtering the signal indicative of the magnetic field signal to generate a filtered signal during a first time period. The filtering can be performed, for example, by the filtering circuit <NUM> of <FIG>. The signal filtered by the filtering circuit <NUM> can be received directly from the magnetic field sensing element <NUM>, or from other intermediate component(s) between the magnetic field sensing element <NUM> and the filtering circuit <NUM>. For example, there may be an amplifier (e.g., amplifier <NUM> in <FIG>) that amplifies the signal prior to filtering, or a modulation and demodulation process (e.g., chopping elements <NUM>, <NUM> in <FIG>) prior to filtering the signal.

At block <NUM>, the process <NUM> continues by comparing the filtered signal to the Schmitt trigger reference during a first time period. This can be performed, for example, by the Schmitt trigger circuit <NUM> shown in <FIG>. The first time period during which the filtered signal is generated and compared to a Schmitt trigger threshold is, for example, period T1 shown in <FIG>, which occurs during the signal cycle 316a.

At block <NUM>, the process <NUM> continues by generating a diagnostic threshold signal. The diagnostic signal can be generated, for example, by a diagnostic circuit <NUM> shown in <FIG>, which is coupled to the filter circuit <NUM>.

At block <NUM>, the process <NUM> continues by coupling the diagnostic threshold signal to the filter circuit (e.g., filter circuit <NUM>) during the second time period. At block <NUM>, the process <NUM> continues by comparing the diagnostic threshold signal to the Schmitt trigger reference during the second time period. The comparison can be performed, for example, by the Schmitt trigger circuit <NUM>. A signal indicative of failure is output when the diagnostic signal is more than a predetermined percentage greater than or less than the Schmitt trigger reference. The second time period during which the diagnostic threshold is compared to the Schmitt trigger threshold is, for example, period T2 shown in <FIG>, which occurs during the diagnostic cycle 316b.

<FIG> is a flow chart illustrating an example process for timing the interleaving of the diagnostic signal so as to not worsen jitter due to the interleaving, in accordance with an embodiment of the present disclosure. Given that a diagnostic signal is being interleaved with a magnetic field signal, this can result in increased (worsened) jitter. One way to reduce (or prevent worsening) jitter due to the interleaving is to decide when to interleave the diagnostic signal. By interleaving the diagnostic signal when the part switches, the jitter can be reduced or at least not worsened.

<FIG> shows an example process <NUM> for timing the interleaving of the diagnostic signals in accordance with the present disclosure to reduce, or at least not worsen, jitter due to the interleaved diagnostic signal. At block <NUM>, the process <NUM> starts a timer as may be part of the controller <NUM> (<FIG>). The timer can be set to a minimum amount of time between switching of the output (e.g., <NUM> microsecond). By knowing this set minimum amount of time, the diagnostic signal can be interleaved at a time that does not affect operation of the part. At block <NUM>, the process <NUM> checks to determine if the sensor switched. If the sensor switches at <NUM>, then at block <NUM> the diagnostic sample is interleaved and the timer is reset.

If the sensor has not switched at <NUM>, the process <NUM> checks at block <NUM> to determine if there has been a timeout of the timer. If there has not been a timeout of the timer at block <NUM>, the process <NUM> returns to block <NUM>. If yes there has been a timeout at block <NUM>, then the process <NUM> proceeds to block <NUM> to interleave the diagnostic sample and reset the timer and then to block <NUM> to start the timer and repeat the process <NUM> as needed.

While electronic circuits shown in figures herein may be shown in the form of analog blocks or digital blocks, it will be understood that the analog blocks can be replaced by digital blocks that perform the same or similar functions and the digital blocks can be replaced by analog blocks that perform the same or similar functions. Analog-to-digital or digital-to-analog conversions may not be explicitly shown in the figures but should be understood.

As used herein, the term "predetermined," when referring to a value or signal, is used to refer to a value or signal that is set, or fixed, in the factory at the time of manufacture, or by external means, e.g., programming, thereafter. As used herein, the term "determined," when referring to a value or signal, is used to refer to a value or signal that is identified by a circuit during operation, after manufacture.

Claim 1:
A magnetic field sensor (<NUM>) comprising:
one or more magnetic field sensing elements (<NUM>) configured to generate a magnetic field signal responsive of a magnetic field;
a filter circuit (<NUM>) coupled to receive a signal representative of the magnetic field signal and configured to generate a filtered signal;
a Schmitt trigger circuit (<NUM>) coupled to receive the filtered signal and configured to compare the filtered signal to a Schmitt trigger threshold during a first time period;
characterized in further comprising
a diagnostic circuit (<NUM>) configured to directly input a diagnostic signal to an input of the filter circuit (<NUM>) and configured to interleave the diagnostic signal with the signal representative of the magnetic field signal;
wherein the Schmitt trigger circuit (<NUM>) is configured to compare the Schmitt trigger threshold to the diagnostic signal during a second time period and configured to determine, using the comparison, whether a fault or failure has occurred in the Schmitt trigger circuit (<NUM>).