# Patent

## Title
Magnetic field sensors with self test

## Abstract

A system includes a magnetic target and a magnetic field sensor. The magnetic field sensor comprises an output node; a circuit to detect a magnetic field produced by the magnetic target; and a processor. The processor may be configured to transmit a signal onto the output node representing the detected magnetic field; detect whether the transmitted signal is interrupted by an external source; and, if the signal is interrupted, initiate a self-test of the apparatus. Corresponding methods and apparatuses are also disclosed.

## Background
FIELD
This disclosure relates to magnetic field sensors and, more particularly, to magnetic field sensors having self-test capabilities.
BACKGROUND
Magnetic field sensors including a magnetic field sensing element, or transducer, such as a Hall Effect element or a magnetoresistive element, are used in a variety of applications to detect aspects of movement of a ferromagnetic article, or target, such as proximity, speed, and direction. Applications using these sensors include, but are not limited to, a magnetic switch or “proximity detector” that senses the proximity of a ferromagnetic article, a proximity detector that senses passing ferromagnetic articles (for example, magnetic domains of a ring magnet or gear teeth), a magnetic field sensor that senses a magnetic field density of a magnetic field, and a current sensor that senses a magnetic field generated by a current flowing in a current conductor. Magnetic field sensors are widely used in automobile control systems, for example, to detect ignition timing from a position of an engine crankshaft and/or camshaft, and to detect a position and/or rotation of an automobile wheel for anti-lock braking systems.
Magnets, in the form of a permanent magnet, or magnetically permeable structures, sometimes referred to as concentrators or flux guides, are often used in connection with magnetic field sensors. In applications in which the ferromagnetic target is magnetic, a magnetically permeable concentrator or magnetic flux guide can be used to focus the magnetic field generated by the target on the magnetic field transducer in order to increase the sensitivity of the sensor and, allow use of a smaller magnetic target, or allow the magnetic target to be sensed from a greater distance (i.e., a larger airgap). In other applications in which the ferromagnetic target is not magnetic, a permanent magnet, sometimes referred to as a back bias magnet, may be used to generate the magnetic field that is then altered by movement of the target.
During manufacturing or during use in application, magnetic field sensors (and other parts) sometimes present failures. These failures may be due to manufacturing defects, design defects, latent failures, or a combination of both. To reduce the occurrence of defective parts entering the field, parts are often tested during or after the manufacturing process. Some parts have been designed to include self-test capabilities, i.e. internal circuitry included in the part that can be used by the part to test itself during manufacturing. These self-tests may include built-in self-tests (i.e. “BIST” tests). During a so-called logical-BIST (i.e. an “LBIST” test), for example, the internal registers within the part are connected together in a scan chain so that the output of one leads to the input of the next. Data is fed through the scan chain and the result is compared to an expected value. If the result does not match the expected value, it may indicate there is a defect in the part. Certain parts may also include other types of BIST or self-test circuitry including tests that check the integrity of analog circuits.
SUMMARY
In an embodiment, a method includes detecting, by a magnetic field sensor, a magnetic field. A signal representing the magnetic field is driven onto an output node of the magnetic field sensor. The magnetic field sensor receives the signal on the output node and determines if the driven signal is interrupted by an external source. When the driven signal is interrupted, a self-test is initiated.
In another embodiment, an apparatus comprises an output node; a circuit to detect a magnetic field; and a processor circuit. The processor circuit is configured to transmit a signal representing the detected magnetic field onto the output node; detect whether the transmitted signal is interrupted by an external source; and, if the signal is interrupted, initiate a self-test of the apparatus.
In another embodiment, a system includes a magnetic target and a magnetic field sensor. The magnetic field sensor comprises an output node; a circuit to detect a magnetic field produced by the magnetic target; and a processor. The processor is configured to transmit a signal onto the output node representing the detected magnetic field; detect whether the transmitted signal is interrupted by an external source; and, if the signal is interrupted, initiate a self-test of the apparatus.



BRIEF DESCRIPTION OF THE DRAWINGS
The foregoing features may be more fully understood from the following description of the drawings. The drawings aid in explaining and understanding the disclosed technology. Since it is often impractical or impossible to illustrate and describe every possible embodiment, the provided figures depict one or more exemplary embodiments. Accordingly, the figures are not intended to limit the scope of the invention. Like numbers in the figures denote like elements.
FIG. 1 is a block diagram of a system for detecting a magnetic target.
FIG. 2 is a block diagram of a system for detecting a magnetic target.
FIG. 3 is a timing diagram of serial communications.
FIG. 4 is a timing diagram of serial communications.
FIG. 5 is a timing diagram of serial communications.
FIG. 6 is a block diagram of a computational circuit.



DETAILED DESCRIPTION
As used herein, the term “magnetic field sensing element” is used to describe a variety of electronic elements that can sense a magnetic field. The magnetic field sensing element can be, but is not limited to, a Hall Effect element, a magnetoresistance element, or a magnetotransistor. 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, an anisotropic magnetoresistance element (AMR), a tunneling magnetoresistance (TMR) element, a magnetic tunnel junction (MTJ), a spin-valve, etc. 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).
As is known, some of the above-described magnetic field sensing elements tend to have an axis of maximum sensitivity parallel to a substrate that supports the magnetic field sensing element, and others of the above-described magnetic field sensing elements tend to have an axis of maximum sensitivity perpendicular to a substrate that supports the magnetic field sensing element. In particular, planar Hall elements tend to have axes of sensitivity perpendicular to a substrate, while metal based or metallic magnetoresistance elements (e.g., GMR, TMR, AMR, spin-valve) and vertical Hall elements tend to have axes of sensitivity parallel to a substrate.
It will be appreciated by those of ordinary skill in the art that while a substrate (e.g. a semiconductor substrate) is described as “supporting” the magnetic field sensing element, the element may be disposed “over” or “on” the active semiconductor surface, or may be formed “in” or “as part of” the semiconductor substrate, depending upon the type of magnetic field sensing element. For simplicity of explanation, while the embodiments described herein may utilize any suitable type of magnetic field sensing elements, such elements will be described here as being supported by the substrate.
As used herein, the term “magnetic field sensor” is used to describe a circuit that uses a magnetic field sensing element, generally in combination with other circuits. Magnetic field sensors are 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 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-biased or other magnet, and a magnetic field sensor that senses a magnetic field density of a magnetic field.
As used herein, the term “target” is used to describe an object to be sensed or detected by a magnetic field sensor or magnetic field sensing element. A target may be ferromagnetic or magnetic.
FIG. 1 is a block diagram of a system 100 for detecting a target 102. System 100 includes a magnetic field sensor 104 placed adjacent to target 102 so that a magnetic field 106 can be sensed by magnetic field sensor 104. In an embodiment, target 102 is a magnetic target and produces magnetic field 106. In another embodiment, magnetic field 106 is generated by a magnetic source (e.g. a back-bias magnet or electromagnet) that is not coupled to target 102. In this instance, target 102 may be either a magnetic or a non-magnetic target. In the case where the target is a non-magnetic target, as target 102 moves through or within magnetic field 106, it causes perturbations to magnetic field 106 that can be detected by magnetic field sensor 104.
Magnetic field sensor 104 may detect and process changes in magnetic field 106. For example, magnetic field sensor 104 may detect changes in magnetic field 106 as target 102 rotates and features 105 move closer to and away from magnetic field sensor 104, thus increasing and decreasing the strength of the magnetic field 106 sensed by magnetic field sensor 104. Magnetic field sensor 104 may include circuitry to determine the speed, direction, location, etc. of target 102 based on these changes to magnetic field 106.
In an embodiment, magnetic sensor 104 is coupled to a computer 108, which may be a general purpose processor executing software or firmware, a custom processor, or an electronic circuit for processing output signal 104a from magnetic sensor 104. Output signal 104a may provide information about the speed and/or direction of target 102 to computer 108, which may then perform operations based on the received speed and direction. In an embodiment, computer 108 is an automotive computer installed in a vehicle and target 102 is a moving part within the vehicle, such as a transmission shaft, a brake rotor, etc. Magnetic sensor 104 detects the speed and direction of target 102 and computer 108 controls automotive functions (like all-wheel drive, ABS, speedometer display control, etc.) in response to the detected speed and direction.
In an embodiment, computer 108 may be located relatively distant from magnetic field sensor 104. For example, computer 108 may be located under the hood of a vehicle while magnetic field sensor 104 is located at a wheel or transmission element near the bottom of the vehicle. In such an embodiment, having a serial communication interface with a minimal number of electrical connections (e.g. wires) between computer 108 and magnetic field sensor 104 may be beneficial, and may reduce cost and maintenance requirements.
Referring now to FIG. 2, a system 200 for detecting a magnetic field may be the same as or similar to system 100 of FIG. 1. System 200 includes magnetic field sensor 104 coupled to computer 108. Magnetic field sensor 104 may be a so-called three wire sensor, indicating that the sensor has three electrical pins with which to make electrical connections with external circuits. These pins may include a power pin 202, a ground pin 204, and a communication or I/O pin 206. In other embodiments, magnetic field sensor may include additional input and/or output pins for performing other functions related to detecting magnetic field 106. In another example, pin 206 (and/or pin 202 and pin 204) may be nodes that are accessible outside of a chip package, such as an externally-accessible node of an integrated circuit packaged in a chip-scale package. As another example, pin 206 (and/or pin 202 and pin 204) may be internal nodes that are not accessible from outside of the chip and its package.
Magnetic field sensor 104 may also include a magnetic field sensing circuit 208, which may comprise Hall elements, magnetoresistive elements, and/or other circuitry and components for detecting a magnetic field. Magnetic field sensing circuit 208 produces a signal 208a that represents the magnetic field detected by magnetic field sensing circuit 208. Signal 208a may be a digital or analog signal.
A processor 210 is coupled to receive signal 208a. Processor 210 may comprise a custom circuit for processing signal 208. In another embodiment, processor 210 may comprise a generic processor such as a microprocessor and a memory. The memory may contain software instructions which, when executed by the processor, cause processor 210 to perform functions and provide features for processing signal 208a. In another embodiment, processor 210 may comprise a combination of custom circuitry, a generic processor, and software for processing signal 208a. 
Magnetic field sensor 104 may be an integrated circuit and may include other circuits not shown or described in this document.
In an embodiment, processor 210 and/or the other circuits included in magnetic field sensor 202 are capable of performing a self-test such as an analog and/or digital BIST test. A BIST test may be used during manufacturing to ensure that the magnetic field sensor 104 has been manufactured properly and operates without defects. In an embodiment, a BIST test may be any type of self-test that magnetic field sensor 202 is capable of performing, and may be triggered by communications received from an external source such as computer 108, from an internal source, or by an event such as start-up or power-on of magnetic field sensor 202. The BIST test may be performed while the magnetic field sensor is installed and operating in a vehicle or in another type of system.
Processor 210 includes (or is coupled to) an output driver circuit 212. Output driver circuit 212 may be capable of driving communication signal 104a on pin 206 and communication line 218 so that communication signal 104a can be received by computer 108. In an embodiment, communication line 218 may be an internal node, i.e. a node that may or may not be connected to an external pin, of magnetic field sensor 104. In an embodiment, processor 210 also includes (or is coupled to) an input driver circuit 214 capable of reading communication signal 104a on pin 206. Communication signal 104a may be a two-way communication signal that can be driven by magnetic field sensor 104, by computer 108, or by both. In an embodiment, communication signal 104a is a SENT protocol signal, an I2C protocol signal, an SMBUS protocol signal, a pulse-width modulated based signal, or another type of one-wire, two-way, serial communication signal.
Although the example shown in FIG. 2 describes one-wire communication, other configurations are possible. For example, communication line 218 may include a plurality of conductors that carry serial or parallel communications, or may comprise wireless communications.
As shown, a pull-up resistor 216 is coupled between communication line 218 and a voltage reference. Pull up resistor 216 is shown external to magnetic field sensor 104 and computer 108, but could be included within magnetic field sensor 104, computer 108, or both. Pull-up resistor 216 acts to maintain the voltage on communication line 218 at a logic-high voltage level during communication idle state. When magnetic field sensor 104 drives a communication signal 104a on communication line 218, magnetic field sensor 104 overdrives the pull-up resistor 216 to cause the voltage on communication line 218 to go to a logic-low level. In an embodiment, magnetic field sensor 104 may couple communication line 218 to a ground reference in order to drive a logic-low voltage level on communication line 218. Magnetic field sensor 104 may then release (e.g. tri-state) output driver circuit 212 to allow the voltage on communication line 218 to return to a high voltage level via pull-up resistor 216. Alternatively, output driver circuit 212 may actively drive the voltage on communication line 218 to a high level to produce a logic-high voltage. Computer 108 may drive communication line 218 in similar fashion, i.e. by driving the line low to produce a logic-low signal and releasing or driving the line to produce a logic-high.
If output driver circuit 212 is configured to actively drive a logic-high level on communication 218, computer 108 may be configured with a relatively lower-resistance output driver circuit so that computer 108 can overdrive the logic-high generated by output driver circuit 212, as discussed below. One skilled in the art will recognize that other communication signal driving circuits can be used. For example, a pull-down resistor could be used where magnetic field sensor 104 and/or computer 108 drive communication line 218 to a logic-high voltage, and release communication line 218 to allow it to return to a logic-low voltage. For example, a differential signal may be used where one conductor of communication line 218 is normally held at a logic-high level and another conductor of communication line 218 is normally held at a logic-low level. In such an embodiment, magnetic field sensor 104 may drive the normally high conductor to a low level and release it to return to a high level, and may drive the normally low conductor to a high level and release it to allow it to return to a low level.
Magnetic field sensor 104 may drive output communications on communication line 218 according to various protocols. In one embodiment, magnetic field sensor 104 constantly or periodically drives an output signal on communication line 218 representing the detected magnetic field. In another embodiment, magnetic field sensor 104 operates in a so-called triggered mode where it waits for a request from computer 108 and, in response to the request, sends data representing the detected magnetic field onto communication line 218. In some embodiments, magnetic field sensor 104 may communicate by sending digital data. In other embodiments magnetic field sensor 104 may communication by encoding data in a pulse-width modulated signal.
Referring to FIG. 3, communication timing diagram 300 includes three waveforms: waveform 302 is an example of a communication signal driven by output communication circuit 212 of magnetic field sensor 104, waveform 304 is an example of a communication signal driven by computer 108, and waveform 306 is an example of the resulting signal 104a on communication line 218. The waveforms in communication timing diagram 300 correspond to a one-wire communication protocol such as the SENT protocol, I2C, SMBus, etc.
Time period T1 represents normal operation of the magnetic field sensor 104 as it is installed in a system and detecting magnetic field 106. During T1, magnetic field sensor 104 constantly or periodically sends data 308 onto communication line 218. As described above, magnetic field sensor 104 may drive communication line 218 low to produce a logic-low value and release it to allow it to return to a logic-high value.
Data 308 may be digital data in the form of bytes or words driven serially onto communication line 218. During normal operation, computer 108 may receive data 308 and use it for various functions. For example, if magnetic field sensor is installed in an automotive braking system, computer 108 may use data 308 to determine whether to engage an anti-lock brake. As another example, if magnetic field sensor 104 is installed in an automatic transmission system, computer 108 may use data 308 to determine how and when to switch gears.
During time period T1, computer 108 typically does not drive an output signal onto communication line 218 and allows communication line 218 to be controlled and driven by output driver circuit 212 of magnetic field sensor 104. Accordingly, waveform 304, the communication driven by computer 108, is shown in a tri-state or high-impedance state during T1. Accordingly, waveform 306 (the signal on communication line 218) follows waveform 302 (the signal driven by magnetic field sensor 104) during time period T1. During operation, magnetic field sensor 104 may also read the data 308 on communication line 218, via receiver 214 for example, to determine whether the data driven by magnetic field sensor 104 appears on communication line 218.
During time period T2 computer 108 sends a request for magnetic field sensor 104 to perform a self-test. In an embodiment, the request is sent by computer 108 driving a logic-low signal onto communication line 218, as shown by the low-voltage value of waveform 304. By driving communication line 218 to a low-voltage, computer 108 prevents communication line from returning to a high-voltage (i.e. logic-high) level during time period T2. Accordingly, even though magnetic field sensor 104 is attempting to drive data 310 onto communication line 212, computer 108 effectively interrupts magnetic field sensor 104's data signal by pulling the communication line low so that data 310 does not appear on communication line 218. Accordingly, waveform 306 follows waveform 304 during time period T2.
In an embodiment, internal circuitry and/or software in magnetic field sensor 104 can initiate the self-test. For example, magnetic field sensor 104 may include an internal timer and/or interrupt (not shown) that initiates the self-test. The internal circuitry may also include sensors, logic circuits, or other circuits to initiate the self-test. The internal circuitry may initiate the self-test by generating a trigger signal, which may be the same as or similar to trigger signals described below.
In another embodiment, magnetic field sensor 104 may trigger the self-test based on an event-based trigger, such as start-up or power-on of magnetic field sensor 104.
Magnetic field sensor 104 may also include functions so that the self-test can be triggered by any one of: an external trigger, an internal trigger, an event-based trigger, or a combination thereof.
As noted above, magnetic field sensor 104 may read the data on communication line 218. During time period T2, magnetic field sensor 104 may typically expect to read the same data that it is driving onto the communication line. However, because computer 108 is driving the line low, communication line 218 cannot return to a logic-high voltage level when magnetic field sensor 104 releases the line. Thus, when computer 108 is driving communication line low, computer 108 will effectively hold the line low and interrupt the data 310 that magnetic field sensor 104 is driving—waveform 306 will follow waveform 304 during time period T2 and magnetic field sensor 104 can detect the request by sensing the logic-low level on the communication line instead of the expected data.
In an embodiment, magnetic field sensor 108 detects the request when communication line 218 has been held low for a predetermined number of data transmissions or for a predetermined time. For example, when using the SENT, I2C, or SMBus protocol, magnetic field sensor will send data packets comprising a start bit 312 followed by a nibble, byte, or word of data 314. If magnetic field sensor 104 detects that communication line 218 has been held low for the duration the attempted transmission of at least two of these packets, for example, magnetic field sensor 104 may determine that it has received a request to perform a self-test. In other embodiments, magnetic field sensor 104 may determine that it has received a request to perform a self-test if it detects that the communication line 218 has been interrupted by computer 108 for the duration of one packet, for the duration of two packets, for the duration of more than two packets, or for a specific time period such as 1 millisecond, 10 milliseconds, 100 milliseconds, etc. Any number of packets or any time period can be chosen for detection of the request to perform a self-test.
In an embodiment, magnetic field sensor 104 may receive the request to perform a self-test while magnetic field sensor 104 is installed in a system and operating under normal conditions. For example, computer 108 may send the request to perform a self-test while magnetic field sensor 104 is installed, in situ, in an automotive brake or transmission system. In such situations, computer 108 may send the request during a time period where the data produced by magnetic field sensor 104 is not critical for operation. In an automotive system, computer 108 may send the request immediately after vehicle ignition and before the vehicle is put in motion. As another example, computer 108 may send the request while the engine is off but the vehicle battery is enabled. If magnetic field sensor 104 is installed in other types of systems, such as in a manufacturing environment, computer 108 may send the request during a time when the manufacturing line is not operating, for example.
Once magnetic field sensor 104 receives the request, it may perform a self-test during time period T3. The self-test may comprise a BIST test that tests the internal circuitry of magnetic field sensor 104. The self-test may include tests that verify the integrity of digital circuitry, analog circuitry, or both within magnetic field sensor 104.
During time period T4, magnetic field sensor may complete the self-test. In some BIST tests, the inputs and outputs of digital circuitry to be tested are reconnected to form scan chains through which test patterns of data are sent. In this instance, magnetic field sensor 104 may remove the scan chains and reconnect the inputs and outputs of the circuitry to resume a normal operating mode during time period T4, in order to resume subsequent operations.
In an embodiment, neither computer 108 nor magnetic field sensor 104 drives communication line 218 during time periods T3 and T4. Thus, during T3 and T4, the pull-up resistor 216 pulls the voltage on communication line 218 to a logic-high level, as shown in FIG. 3.
During time period T5 and T6, magnetic field sensor 104 may transmit the results of the self-test onto communication line 218, in the form of one or more data packets 316 and 318, for example. In some embodiments, magnetic field sensor 104 transmits the results of the self-test onto an internal node of magnetic field sensor 104. In such embodiments, the test results may not appear on communication line 218. In other embodiments, magnetic field sensor 104 transmits the self-test results onto an output pin (e.g. output pin 206), where they can be received externally by computer 108.
In certain embodiments, magnetic field sensor 104 will transmit the results of the self-test onto communication line 218 only if the results indicate a failure. If the results indicate a passing result, magnetic field sensor 104 may resume normal operations and send data representing the magnetic field instead of transmitting test results onto communication line 218. In other embodiments, magnetic field sensor 104 will transmit the results only if the test results indicate a passing results. In yet other embodiments, magnetic field sensor 104 will transmit the test results onto communication line 218 regardless of whether the test results indicate pass or fail.
Data packets 316 and 318 may include information about whether the self-test passed or failed, as well as other qualitative test results such as a value of a test measurement, etc. In embodiments, the test results may comprise fewer or more than the two data packets shown in FIG. 3. The test results may take the form of any communication or signal that can be received by computer 108.
In time period T7, magnetic field sensor 104 may resume normal operations and transmit data representing the detected magnetic field.
Referring to FIG. 4, the waveforms in communication timing diagram 400 correspond to a triggered communication protocol based on, for example, a one-wire communication protocol such as the SENT protocol, I2C, SMBus, etc. Communication timing diagram 400 includes three waveforms: waveform 402 is an example of a communication signal driven by output communication circuit 212 of magnetic field sensor 104, waveform 404 is an example of a communication signal driven by computer 108, and waveform 406 is an example of the resulting signal 104a on communication line 218.
Time period T8 represents normal operation of the magnetic field sensor 104 as it is installed in a system and detecting magnetic field 106. During T8, magnetic field sensor 104 waits to receive a trigger from computer 108. Upon receiving the trigger, magnetic field sensor 104 will transmit data (e.g. data such as data 408 shown in time period T9) representing the detected magnetic field to computer 108. As described above, magnetic field sensor 104 may drive communication line 218 low to produce a logic-low value and release it to allow it to return to a logic-high value.
Data 408 may be digital data in the form of bytes or words driven serially onto communication line 218. During normal operation, computer 108 may receive data 408 and use it for various functions. For example, if magnetic field sensor is installed in an automotive braking system, computer 108 may use data 408 to determine whether to engage an anti-lock brake. As another example, if magnetic field sensor 104 is installed in an automatic transmission system, computer 108 may use data 408 to determine how and when to switch gears.
Because neither magnetic field sensor 104 nor computer 108 are driving communication line 218 low in time period T8, waveform 406 (the signal on communication line 218) remains high.
During time period T9 computer 108 sends a request for magnetic field sensor 104 to perform a self-test. In an embodiment, computer 108 sends a trigger 410 instructing magnetic field sensor 104 to transmit data. In an embodiment computer 108 sends the trigger signal by driving communication line 218 low for a predetermined period of time, or for a predetermined number of pulses. However, the trigger signal may take the form of any signal that can be received and identified by magnetic field sensor 108. For example, the trigger may be received when computer 108 drives communication line 218 for a combination of a number of pulses and a duration of time. As an example, computer 108 may drive communication line 218 for the duration of two pulses or more that are separated by a period of time. In another embodiment, computer 108 may drive a signal that is received by magnetic field sensor 108 in order to trigger the self-test.
Once the trigger is received, magnetic field sensor 104 may transmit an acknowledgement 412 to computer 108. In an embodiment magnetic field sensor 104 sends the acknowledgement by driving communication line 218 low for a predetermined period of time. However, the acknowledgement may take the form of any signal that can be received and identified by computer 108. In some embodiments, magnetic field sensor 104 may optionally omit sending an acknowledgement.
After the acknowledgement 412, magnetic field sensor 104 may transmit data 408 representing the detected magnetic field. Under normal operation, computer 108 may receive data 408 for processing. In other circumstances, computer 108 may request that magnetic field sensor 104 perform a self-test. The request may be sent by computer 108 driving a logic-low signal onto communication line 218 while magnetic field sensor 104 is attempting to transmit data 408, as shown by the low-voltage value of waveform 404 during time period T9. By driving communication line 218 to a low-voltage, computer 108 prevents communication line from returning to a high-voltage (i.e. logic-high) level during time period T9. Accordingly, even though magnetic field sensor 104 is attempting to drive data 408 onto communication line 212, computer 108 effectively interrupts magnetic field sensor 104's data signal by pulling the communication line low so that data 408 does not appear on communication line 218. Accordingly, waveform 406 follows waveform 404 during time where waveform 404 is held low.
As noted above, magnetic field sensor 104 may read the data on communication line 218. During time period T9, magnetic field sensor 104 may typically expect to read the same data 408 that it is driving onto the communication line. However, because computer 108 is driving the line low, communication line 218 cannot return to a logic-high voltage level when magnetic field sensor 104 releases the line. Thus, when computer 108 is driving communication line low, magnetic field sensor 104 can detect the request by sensing the logic-low level on the communication line instead of the expected data.
In an embodiment, magnetic field sensor 108 detects the request when communication line 218 has been held low for a predetermined number of data transmissions or for a predetermined time. For example, when using a triggered protocol based on the SENT, I2C, or SMBus protocol, if magnetic field sensor 104 detects that communication line 218 has been held low for the duration of the attempted transmission of one data packet transmission, a portion of one data packet transmission, two data packet transmissions, or for any other duration, magnetic field sensor 104 may determine that it has received a request to perform a self-test. In other embodiments, magnetic field sensor 104 may determine that it has received a request to perform a self-test if it detects that the communication line 218 has been interrupted by computer 108 for a specific time period such as 1 microsecond, 10 microseconds, 100 microseconds, 1 millisecond, 10 milliseconds, 100 milliseconds, etc. Any number of packets or any time period can be chosen for detection of the request to perform a self-test. For example, the trigger may be received when computer 108 drives communication line 218 for a combination pulses and time. As an example, computer 108 may drive communication line 218 for the duration of two pulses (or more) that are separated by a period of time. The pulses and duration may be of any length of time. In another embodiment, computer 108 may drive a signal that is received by magnetic field sensor 108 in order to trigger the self-test.
Once magnetic field sensor 104 receives the request, it may perform a self-test during time period T10. The self-test may comprise a BIST test that tests the internal circuitry of magnetic field sensor 104. The self-test may also include tests that verify the integrity of digital circuitry, analog circuitry, or both within magnetic field sensor 104.
During time period T11, magnetic field sensor may complete the self-test. In some BIST tests, scan chains to test the digital circuitry and registers in the device. In this instance, magnetic field sensor 104 may revert to a normal operating mode by, for example, removing the scan chains during time period T11 to resume subsequent operations.
In an embodiment, neither computer 108 nor magnetic field sensor 104 drives communication line 218 during time periods T10 and T11. Thus, during T10 and T11, the pull-up resistor 216 pulls the voltage on communication line 218 (i.e. waveform 406) to a logic-high level.
During time period T12 and T13, magnetic field sensor may transmit the results of the self-test onto communication line 218, which may be in the form of one or more data packets 416 and 418, for example. In some embodiments, magnetic field sensor 104 transmits the results of the self-test onto an internal node of magnetic field sensor 104. In such embodiments, the test results may not appear on communication line 218. In other embodiments, magnetic field sensor 104 transmits the self-test results onto an output pin (e.g. output pin 206), where they can be received externally by computer 108.
In certain embodiments, magnetic field sensor 104 will transmit the results of the self-test onto communication line 218 only if the results indicate a failure. If the results indicate a passing result, magnetic field sensor 104 may resume normal operations and send data representing the magnetic field instead of transmitting test results onto communication line 218. In other embodiments, magnetic field sensor 104 will transmit the results only if the test results indicate a passing results. In yet other embodiments, magnetic field sensor 104 will transmit the test results onto communication line 218 regardless of whether the test results indicate pass or fail.
Data packets 414 and 416 may include information about whether the self-test passed or failed, as well as other qualitative test results such as a value of a test measurement, etc. In embodiments, the test results may comprise fewer or more than the two data packets shown in FIG. 4. The test results may take the form of any communication or signal that can be received by computer 108.
In time period T14, magnetic field sensor 104 may resume normal operations and wait to receive subsequent triggers 418, and in response transmit an acknowledgement 420 and data 422. During normal operations, when no self-test is requested, data 422 will appear on communication line 218 (i.e. waveform 406) as shown in FIG. 4.
Turning to FIG. 5, the waveforms in communication timing diagram 500 correspond to a pulse-width modulated (“PWM”) communication protocol. Communication timing diagram 500 includes three waveforms: waveform 502 is an example of a communication signal driven by output communication circuit 212 of magnetic field sensor 104, waveform 504 is an example of a communication signal driven by computer 108, and waveform 506 is an example of the resulting signal 104a on communication line 218.
Time period T15 represents normal operation of the magnetic field sensor 104 as it is installed in a system and detecting magnetic field 106. During T15, magnetic field sensor 104 constantly or periodically drives PWM data 508 onto communication line 218. In an embodiment, data representing the magnetic field may be encoded as a duty-cycle and/or frequency of the PWM waveform. For example, a larger duty cycle may correspond to a stronger detected magnetic field.
As described above, magnetic field sensor 104 may drive communication line 218 low to produce low periods of the PWM signal and release it to allow it to return to a logic-high value during high-voltage periods of the PWM signal.
During normal operation, computer 108 may receive PWM data 508 and use it for various functions. For example, if magnetic field sensor is installed in an automotive braking system, computer 108 may use PWM data 508 to determine whether to engage an anti-lock brake. As another example, if magnetic field sensor 104 is installed in an automatic transmission system, computer 108 may use PWM data 508 to determine how and when to switch gears.
During time period T15, computer 108 typically does not drive an output signal onto communication line 218 and allows communication line 218 to be controlled and driven by output driver circuit 212 of magnetic field sensor 104. Accordingly, waveform 504, the communication driven by computer 108, is shown in a tri-state or high-impedance state during T1, and waveform 506 (the signal on communication line 218) follows waveform 502 (the signal driven by magnetic field sensor 104) during time period T15. During operation, magnetic field sensor 104 may also read the PWM data 508 on communication line 218 to determine whether the data driven by magnetic field sensor 104 appears on communication line 218.
During time period T16 computer 108 sends a request for magnetic field sensor 104 to perform a self-test. In an embodiment, the request is sent by computer 108 driving a logic-low signal onto communication line 218, as shown by the low-voltage value of waveform 504 during time period T16. By driving communication line 218 to a low-voltage, computer 108 prevents communication line from returning to a high-voltage (i.e. logic-high) level during time period T16. Accordingly, even though magnetic field sensor 104 is attempting to drive PWM data 510 onto communication line 212, computer 108 effectively interrupts magnetic field sensor 104's data signal by pulling the communication line low so that PWM data 510 does not appear on communication line 218. Accordingly, waveform 506 follows waveform 504 during time period T16.
As noted above, magnetic field sensor 104 may read the data on communication line 218. During time period T16, magnetic field sensor 104 may typically expect to read the same PWM data 510 that it is driving onto the communication line. However, because computer 108 is driving the line low, communication line 218 cannot return to a logic-high voltage level when magnetic field sensor 104 releases the line. Thus, when computer 108 is driving communication line low, computer 108 will effectively hold the line low and interrupt the PWM data 510 that magnetic field sensor 104 is driving-waveform 506 will follow waveform 504 during time period T16 and magnetic field sensor 104 can detect the request by sensing the logic-low level on the communication line instead of the expected data.
In an embodiment, magnetic field sensor 108 detects the request when communication line 218 has been held low for a predetermined number PWM cycles (i.e. periods). For example, if magnetic field sensor 104 detects that communication line 218 has been held low for a time equal to or greater than one or more PWM cycles, magnetic field sensor 104 may determine that it has received a request to perform a self-test. In other embodiments, magnetic field sensor 104 may determine that it has received a request to perform a self-test if it detects that the communication line 218 has been interrupted by computer 108 for the duration of a specific time period such as 1 microsecond, 10 microseconds, 100 microseconds, 1 millisecond, 10 milliseconds, 100 milliseconds, etc. Any number of PWM cycles or any time period can be chosen for detection of the request to perform a self-test.
In an embodiment, magnetic field sensor 104 may receive the request to perform a self-test while magnetic field sensor 104 is installed in a system and operating under normal conditions. For example, computer 108 may send the request to perform a self-test while magnetic field sensor 104 is installed, in situ, in an automotive brake or transmission system, for example. In such situations, computer 108 may send the request during a time period where the data produced by magnetic field sensor 104 is not critical for operation. For example, in an automotive system, computer 108 may send the request immediately after vehicle ignition and before the vehicle is put in motion. As another example, computer 108 may send the request while the engine is off but the vehicle battery is enabled. If magnetic field sensor 104 is installed in other types of systems, such as in a manufacturing environment, computer 108 may send the request during a time when the manufacturing line is not operating, for example.
Once magnetic field sensor 104 receives the request, it may perform a self-test during time period T17. The self-test may comprise a BIST test that tests the internal circuitry of magnetic field sensor 104. The self-test may include tests that verify the integrity of digital circuitry, analog circuitry, or both within magnetic field sensor 104.
During time period T18, magnetic field sensor may complete the self-test. In some BIST tests, the inputs and outputs of digital circuitry to be tested are reconnected to form scan chains through which test patterns of data are sent. In this instance, magnetic field sensor 104 may remove the scan chains and reconnect the inputs and outputs of the circuitry to resume a normal operating mode during time period T18, in order to resume subsequent operations.
In an embodiment, neither computer 108 nor magnetic field sensor 104 drives communication line 218 during time periods T17 and T18. Thus, during T17 and T18, the pull-up resistor 216 pulls the voltage on communication line 218 to a logic-high level, as shown in FIG. 5.
In an embodiment, magnetic field sensor 104 may signal that it has recovered and is ready to send self-test results by driving a ready signal, such as pulse 512, on communication line 218. During time period T19 and T20, magnetic field sensor may transmit the results of the self-test onto communication line 218. In some embodiments, magnetic field sensor 104 transmits the results of the self-test onto an internal node of magnetic field sensor 104. In such embodiments, the test results may not appear on communication line 218. In other embodiments, magnetic field sensor 104 transmits the self-test results onto an output pin (e.g. output pin 206), where they can be received externally by computer 108.
In an embodiment, the self-test results are transmitted in the form of a PWM signal with a frequency that differs from that of the PWM signal used for normal data operations. For example, the PWM signal used for test results may have a frequency that is half of the normal frequency, as shown in FIG. 5. The test results may take the form of any communication or signal that can be received by computer 108.
In certain embodiments, magnetic field sensor 104 will transmit the results of the self-test onto communication line 218 only if the results indicate a failure. If the results indicate a passing result, magnetic field sensor 104 may resume normal operations and send data representing the magnetic field instead of transmitting test results onto communication line 218. In other embodiments, magnetic field sensor 104 will transmit the results only if the test results indicate a passing results. In yet other embodiments, magnetic field sensor 104 will transmit the test results onto communication line 218 regardless of whether the test results indicate pass or fail.
In time period T21, magnetic field sensor 104 may resume normal operations and transmit data representing the detected magnetic field.
FIG. 6 is a block diagram of a computational circuit 600, can perform at least some of the processing described above. Computational circuit 600 may be the same as or similar to processor 210 in FIG. 2, for example.
Computational circuit 600 may include a central processing unit (CPU) 602 coupled to a storage device 604 and a memory 606. CPU 602 can be a general purpose processor, a custom-designed processor, a microprocessor, or any other type of processor or circuit that can execute software instructions.
Storage device 604 comprises a non-volatile memory such as a ROM, flash memory, F-RAM, solid-state drive, EPROM, EEPROM, and the like. Storage device 604 may be either read-only or read/write. In other embodiments, storage device 604 is a hard-drive, DVD, CD, or other type of disc device.
Memory 606 comprises a volatile memory, such as a RAM. In certain embodiments, RAM 606 may be omitted from computational circuit 600.
In operation, CPU 602 may read and execute software instructions from storage device 604 and/or memory 606. When executed, the instructions may cause CPU 602 to perform functions and operations as described above with respect to processor 210. In certain embodiments, CPU 602 may copy the instructions from storage device 604 to memory 606 prior to executing the instructions. CPU 602 may also read and write data to and from storage device 604 and memory 606. In other embodiments, computational circuit may comprise programmable hardware logic (e.g. a PLA), an FPGA, an ASIC, or any other type of hardware circuit or device capable of performing at least some of the functions described above and/or executing software instructions that cause the computational circuit to perform at least some of the functions described above.
Having described various embodiments, which serve to illustrate various concepts, structures and techniques, which are the subject of this patent, it will now become apparent to those of ordinary skill in the art that other embodiments incorporating these concepts, structures and techniques may be used. Elements of different embodiments described in this patent may be combined to form other embodiments not specifically set forth above. Various elements, which are described in the context of a single embodiment, may also be provided separately or in any suitable subcombination, Other embodiments not specifically described herein are also within the scope of the following claims. Accordingly, the scope of the patent should not be limited to the described embodiments but rather should be limited only by the spirit and scope of the following claims. All references cited within this patent are incorporated by reference in their entirety.

## Claims

1. A method comprising:
detecting, by a magnetic field sensor, a magnetic field;
driving a signal representing the magnetic field onto an output node of the magnetic field sensor;
receiving, by the magnetic field sensor, the signal on the output node;
determining if the driven signal is interrupted by an external source by comparing the received signal to the driven signal by determining if a voltage of the output node was driven to a predetermined voltage state during transmission of the signal representing the magnetic field;
interrupting the signal representing the magnetic field and
when the driven signal is interrupted, initiating a self-test.

2. The method of claim 1 further comprising driving a signal representing results of the self-test onto an output pin.

3. The method of claim 2 wherein driving the signal representing the results includes driving the signal only if the results of the self-test indicate a failure.

4. The method of claim 1 wherein detecting the magnetic field comprises sensing the presence of a magnetic target.

5. The method of claim 1 wherein detecting the magnetic field comprises detecting the magnetic field while the magnetic field sensor is installed in a working system.

6. The method of claim 1 wherein detecting the magnetic field comprises detecting the magnetic field while the magnetic field sensor is installed in a transmission or braking system.

7. The method of claim 1 wherein interrupting the output signal comprises interrupting the output signal during a predetermined time period.

8. The method of claim 7 wherein the predetermined time period is a time where output from the magnetic field sensor is not necessary for system operation.

9. The method of claim 1 wherein initiating the self-test comprises performing, by the magnetic field sensor, a BIST or LBIST test; and driving the signal representing the results comprises sending test results from the BIST or LBIST test.

10. The method of claim 1 further comprising, subsequent to driving the signal representing the results of the self-test, resuming to detect the magnetic field.

11. The method of claim 1 further comprising receiving a request to send the signal representing the magnetic field.

12. The method of claim 1 further comprising operating, by the magnetic field sensor, in a continuous communications mode, a PWM communications mode, or a triggered communications mode.

13. The method of claim 1 wherein driving the signal representing the magnetic field includes transmitting a digital signal onto the output pin.

14. The method of claim 1 wherein driving the signal representing the magnetic field includes transmitting an analog signal onto the output pin.

15. The method of claim 1 wherein driving the signal comprises sending communications onto the output node according to a SENT protocol.

16. The method of claim 1 wherein the output node is coupled to an output pin of the magnetic field sensor.

17. An apparatus comprising:
an output node;
a circuit to detect a magnetic field;
a processor circuit configured to:
transmit a signal representing the detected magnetic field onto the output node;
detect whether the transmitted signal is interrupted by an external source by sensing whether the output node is held at a low voltage by the external source; and
if the signal is interrupted, initiate a self-test of the apparatus.

18. The apparatus of claim 17 wherein the processor circuit is further configured to transmit a signal representing results of the self-test onto the output node.

19. The apparatus of claim 17 wherein the processor is further configured to resume normal operation of the apparatus after transmitting the signal.

20. The apparatus of claim 17 wherein initiating the self-test comprises performing, by the apparatus, a BIST or LBIST test; and the signal representing results from self-test includes results from BIST or LBIST test.

21. The apparatus of claim 17 wherein the processor is further configured to receive a request prior to transmitting the signal representing the magnetic field.

22. The apparatus of claim 17 wherein the processor is further configured to transmit the signal representing the magnetic field in a continuous communications mode, a PWM communications mode, or a triggered communications mode.

23. The apparatus of claim 17 wherein the processor is configured to transmit digital signals on the output pin.

24. The apparatus of claim 17 wherein the processor is configured to transmit analog signals on the output pin.

25. The apparatus of claim 17 further comprising an output pin coupled to the output node.

26. The apparatus of claim 17 wherein the processor is configured to communicate via a SENT protocol.

27. A system comprising
a magnetic target;
a magnetic field sensor comprising:
an output node;
a circuit to detect a magnetic field produced by the magnetic target; and
a processor circuit configured to:
transmit a signal representing the magnetic field onto the output node;
detect whether the transmitted signal is interrupted by an external source by sensing whether the output node is held at a low voltage by the external source; and
if the signal is interrupted, initiate a self-test of the apparatus.

28. The system of claim 27 wherein the processor is further configured to transmit a signal representing results of the self-test onto the output node.

29. The system of claim 27 wherein the processor is configured to communicate via a SENT protocol.

30. An apparatus comprising:
an output node;
a circuit to detect a magnetic field;
a processor circuit configured to:
transmit a signal representing the detected magnetic field onto the output node;
detect whether the transmitted signal is interrupted by an external source by sensing whether the output node is held at a low voltage by an external source;
if the signal is interrupted, initiate a self-test of the apparatus; and
transmit data representing test results onto the output node if results of the self-test indicate a failure.

31. An apparatus comprising:
an output node;
a circuit to detect a magnetic field;
a processor circuit configured to:
transmit a signal representing the detected magnetic field onto the output node;
detect whether the transmitted signal is interrupted by an external trigger signal;
if the signal is interrupted, initiate a self-test of the apparatus; and
transmit data representing test results onto the output node if results of the self-test indicate a failure.