# Patent

## Title
Circuits and methods for generating a self-test of a magnetic field sensor

## Abstract

A magnetic field sensor includes built in self-test circuits that allow a self-test of most of, or all of, the circuitry of the magnetic field sensor, including self-test of a magnetic field sensing element used within the magnetic field sensor, while the magnetic field sensor is functioning in normal operation.

## Background
CROSS REFERENCE TO RELATED APPLICATIONS
This application claims the benefit under 35 U.S.C. §119(e) of U.S. Provisional Application No. 61/153,059 filed Feb. 17, 2009, which application is incorporated herein by reference in its entirety.


STATEMENT REGARDING FEDERALLY SPONSORED RESEARCH
Not Applicable.
FIELD OF THE INVENTION
This invention relates generally to magnetic field sensors and, more particularly, to a magnetic field sensors having a self-test capability.
BACKGROUND OF THE INVENTION
As is known, there are a variety of types of magnetic field sensing elements, including, but not limited to, Hall effect elements, magnetoresistance elements, and magnetotransistors. As is also known, there are different types of Hall effect elements, for example, a planar Hall element, a vertical Hall element, and a circular Hall element. As is also known, there are different types of magnetoresistance elements, for example, a giant magnetoresistance (GMR) element, an anisotropic magnetoresistance element (AMR), a tunneling magnetoresistance (TMR) element, and a magnetic tunnel junction (MTJ).
Hall effect elements generate an output voltage proportional to a magnetic field. In contrast, magnetoresistance elements change resistance in proportion to a magnetic field. In a circuit, an electrical current can be directed through the magnetoresistance element, thereby generating a voltage output signal proportional to the magnetic field.
Magnetic field sensors, i.e., circuits that use magnetic field sensing elements, are used in a variety of applications, including, but not limited to, 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, and a magnetic field sensor that senses a magnetic field density of a magnetic field.
As is known, some integrated circuits have internal built-in self-test (BIST) capabilities. A built-in self-test is a function that can verify all or a portion of the internal functionality of an integrated circuit. Some types of integrated circuits have built-in self-test circuits built directly onto the integrated circuit die. Typically, the built-in self-test is activated by external means, for example, a signal communicated from outside the integrated circuit to dedicated pins or ports on the integrated circuit. For example, an integrated circuit that has a memory portion can include a built-in self-test circuit, which can be activated by a self-test signal communicated from outside the integrated circuit. The built-in self-test circuit can test the memory portion of the integrated circuit in response to the self-test signal.
Conventional built-in self-test circuits tend not to allow the integrated circuit to perform its intended function while the built-in self-test is being performed. Instead, during the built-in self-test, the built-in self-test circuit exercises all of, or parts of, circuits on the integrated circuit in particular ways that do not necessarily allow concurrent operation of functions that the integrated circuit is intended to perform. Therefore, the built-in self-test is typically only activated one time, for example, upon power up of the integrated circuit, or from time to time. At other times, the built-in self-test circuit and function are dormant and the integrated circuit can perform its intended function.
Furthermore, when used in magnetic field sensors, conventional built-in self-test circuits tend not to test the magnetic field sensing element used in the magnetic field sensor.
It would be desirable to provide built in self-test circuits and techniques in a magnetic field sensor that allow the self-test to be run from time to time or upon command while the magnetic field sensor concurrently performs its intended function. It would also be desirable to provide such a concurrent self-test that tests a magnetic field sensing element used within the magnetic field sensor.
SUMMARY OF THE INVENTION
The present invention provides self-test circuits and techniques in a magnetic field sensor that allow the self-test to be run from time to time or upon command while the magnetic field sensor concurrently performs its intended function. The present invention also provides such a concurrent self-test that tests a magnetic field sensing element used within the magnetic field sensor.
In accordance with one aspect of the present invention, a magnetic field sensor includes a magnetic field sensing element supported by a substrate. The magnetic field sensing element is for generating a composite magnetic field signal having a measured-magnetic-field-responsive signal portion and a self-test-responsive signal portion. The measured-magnetic-field-responsive signal portion is responsive to a measured magnetic field. The self-test-responsive signal portion is responsive to a self-test magnetic field. The magnetic field sensor also includes a self-test circuit having a self-test current conductor proximate to the magnetic field sensing element. The self-test current conductor is for carrying a self-test current to generate the self-test magnetic field. The magnetic field sensor also includes a processing circuit coupled to receive a signal representative of the composite magnetic field signal. The processing circuit is configured to generate a sensor signal representative of the measured-magnetic-field-responsive signal portion. The processing circuit is also configured to generate at least one of a diagnostic signal representative of the self-test-responsive signal portion or a composite signal representative of both the measured-magnetic-field-responsive signal portion and the self-test-responsive signal portion.
In accordance with another aspect of the present invention, a method of generating a self-test of a magnetic field sensor includes generating, with a magnetic field sensing element, a composite magnetic field signal comprising a measured-magnetic-field-responsive signal portion and a self-test-responsive signal portion. The measured-magnetic-field-responsive signal portion is responsive to a measured magnetic field. The self-test-responsive signal portion is responsive to a self-test magnetic field. The method also includes generating a self-test current in a self-test current conductor proximate to the magnetic field sensing element. The self-test current conductor is for carrying the self-test current to generate the self-test magnetic field. The method also includes generating a sensor output signal representative of the measured-magnetic-field-responsive signal portion. The method also includes generating at least one of a diagnostic signal representative of the self-test-responsive signal portion or a composite signal representative of both the measured-magnetic-field-responsive signal portion and the self-test-responsive signal portion.



BRIEF DESCRIPTION OF THE DRAWINGS
The foregoing features of the invention, as well as the invention itself may be more fully understood from the following detailed description of the drawings, in which:
FIG. 1 is block diagram showing a magnetic field sensor in accordance with the present invention, having a magnetic field sensing element, a self-test conductor, a diagnostic request processor, a signal processor, and output circuits;
FIG. 2 is a block diagram showing one exemplary arrangement of the magnetic field sensing element and the self-test conductor of FIG. 1;
FIG. 2A is a block diagram showing another exemplary arrangement of the magnetic field sensing element and the self-test conductor of FIG. 1;
FIG. 2B is a block diagram showing yet another exemplary arrangement of the magnetic field sensing element and the self-test conductor of FIG. 1;
FIG. 2C is a block diagram showing yet another exemplary arrangement of the magnetic field sensing element and the self-test conductor of FIG. 1;
FIG. 2D is a block diagram showing yet another exemplary arrangement of the magnetic field sensing element, here shown as four magnetic field sensing elements, and the self-test conductor of FIG. 1;
FIG. 3 is block diagram showing a cross section representative of one exemplary arrangement of the magnetic field sensing element and the self-test conductor of FIG. 1, namely, the magnetic field sensing element and the self-test conductor of FIG. 2B, wherein the arrangement includes an electromagnetic shield;
FIG. 3A is block diagram showing a cross section representative of another exemplary arrangement of the magnetic field sensing element and the self-test conductor of FIG. 1, wherein the arrangement includes an electromagnetic shield;
FIG. 3B is block diagram showing a cross section representative of yet another exemplary arrangement of the magnetic field sensing element and the self-test conductor of FIG. 1;
FIG. 3C is block diagram showing a cross section representative of yet another exemplary arrangement of the magnetic field sensing element and the self-test conductor of FIG. 1, namely, the magnetic field sensing element and the self-test conductor of FIG. 2C, wherein the arrangement includes an electromagnetic shield;
FIG. 3D is block diagram showing a cross section representative of yet another exemplary arrangement of the magnetic field sensing element and the self-test conductor of FIG. 1, wherein the arrangement includes an electromagnetic shield;
FIGS. 3E-3G are block diagrams showing three arrangements for magnetic field sensors;
FIG. 4 is a block diagram showing further details of the diagnostic request processor of FIG. 1;
FIG. 5 is a block diagram of an exemplary magnetic field sensor showing further details of the magnetic field sensing element, the self-test conductor, and the signal processor of FIG. 1;
FIG. 5A is a block diagram of another exemplary magnetic field sensor showing further details of the magnetic field sensing element, the self-test conductor, and the signal processor of FIG. 1;
FIG. 5B is a block diagram showing common drain output circuits that can be used as part of the magnetic field sensors of FIGS. 5 and 5A;
FIG. 6 is a block diagram of another exemplary magnetic field sensor showing further details of the magnetic field sensing element, the self-test conductor, and the signal processor of FIG. 1;
FIG. 7 is a graph showing exemplary output signals from the magnetic field sensors of FIGS. 1, 5, 5A, and 6;
FIG. 7A is a graph showing another exemplary output signal from the magnetic field sensors of FIGS. 1, 5, 5A, and 6;
FIGS. 7B-7F are graphs showing different exemplary diagnostic input signals received by the diagnostic request processor of the magnetic field sensors of FIGS. 1, 5, 5A, and 6;
FIG. 8 is a graph showing a diagnostic input signal, the same as or similar to the diagnostic input signal of FIG. 7B, received by the diagnostic request processor of the magnetic field sensors of FIGS. 1, 5, 5A, and 6;
FIGS. 8A-8D are graphs showing different exemplary diagnostic output signals generated by the magnetic field sensors of FIGS. 1, 5, 5A, and 6;
FIG. 9 is a graph showing exemplary output signals, the same as or similar to the output signals shown in FIG. 7, from the magnetic field sensors of FIGS. 1, 5, 5A, and 6;
FIG. 9A is a graph showing a diagnostic input signal, the same as or similar to the diagnostic input signal of FIGS. 7B and 8, received by the diagnostic request processor of the magnetic field sensors of FIGS. 1, 5, 5A, and 6;
FIGS. 9B-9E are graphs showing different exemplary combined output signals generated by the magnetic field sensors of FIGS. 1, 5, 5A, and 6;
FIGS. 10-10B are a series of graph showing a diagnostic control signal, a diagnostic output signal generated by the magnetic field sensors of FIGS. 5 and 6, and a diagnostic output signal generated by the magnetic field sensor of FIG. 5A;
FIG. 11 is a top view of an exemplary electromagnetic shield that can form part of the magnetic field sensor of FIG. 1, and which can be used as the electromagnetic shield of FIGS. 3, 3A, 3C, and 3D;
FIG. 12 is a top view of another exemplary electromagnetic shield that can form part of the magnetic field sensor of FIG. 1, and which can be used as the electromagnetic shield of FIGS. 3, 3A, 3C, and 3D;
FIG. 13 is a top view of yet another exemplary electromagnetic shield that can form part of the magnetic field sensor of FIG. 1, and which can be used as the electromagnetic shield of FIGS. 3, 3A, 3C, and 3D;
FIG. 14 is a top view of yet another exemplary electromagnetic shield that can form part of the magnetic field sensor of FIG. 1, and which can be used as the electromagnetic shield of FIGS. 3, 3A, 3C, and 3D;
FIG. 15 is a block diagram showing a plurality of magnetic field sensors used to sense a position of a gear shift lever as may be provided in an automobile; and
FIG. 16 is a block diagram of a circuit having a self-test conductor, through which a direction of a drive current can be changed.



DETAILED DESCRIPTION OF THE INVENTION
Before describing the present invention, some introductory concepts and terminology are explained. 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 elements can be, but are not limited to, Hall effect elements, magnetoresistance elements, or magnetotransistors. As is known, there are different types of Hall effect elements, for example, a planar Hall element, a vertical Hall element, and a circular Hall element. As is also known, there are different types of magnetoresistance elements, for example, a giant magnetoresistance (GMR) element, an anisotropic magnetoresistance element (AMR), a tunneling magnetoresistance (TMR) element, an Indium antimonide (InSb) sensor, and a magnetic tunnel junction (MTJ).
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, most types of magnetoresistance elements tend to have axes of maximum sensitivity parallel to the substrate and most types of Hall elements tend to have axes of sensitivity perpendicular to a substrate.
As used herein, the term “magnetic field sensor” is used to describe a circuit that includes a magnetic field sensing element. Magnetic field sensors are used in a variety of applications, including, but not limited to, 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, and a magnetic field sensor that senses a magnetic field density of a magnetic field.
Referring to FIG. 1, a magnetic field sensor 10 includes a magnetic field sensing element 32 supported by a substrate (not shown). The magnetic field sensing element 32 is for generating a composite magnetic field signal 32a having a measured-magnetic-field-responsive signal portion and a self-test-responsive signal portion. The measured-magnetic-field-responsive signal portion is responsive to a measured magnetic field. The self-test-responsive signal portion is responsive to a self-test magnetic field. The magnetic field sensor 10 also includes a self-test circuit having a self-test current conductor 30 proximate to the magnetic field sensing element 32. The self-test current conductor 30 is for carrying a self-test current 24a to generate the self-test magnetic field. The magnetic field sensor 10 also includes a processing circuit 34 coupled to receive a signal, e.g., the signal 32a, representative of the composite magnetic field signal 32a. The processing circuit 34 is configured to generate a sensor signal 36a representative of the magnetic field-signal portion. The processing circuit 34 is also configured to generate at least one of a diagnostic signal 36c representative of the self-test-responsive signal portion or a composite signal 36b representative of both the measured-magnetic-field-responsive signal portion and the self-test-responsive signal portion.
In some embodiments, the self-test magnetic field is within a range of about twenty to forty Gauss. However in other embodiments, the self-test magnetic field can be smaller than twenty Gauss or greater than forty Gauss.
The magnetic field sensor 10 can include power and bias and driver circuits 22. The power and bias and driver circuits 22 can include a circuit power and bias module 28 configured to provide various voltages and currents to the rest of the circuitry within the magnetic field sensor 10. The power and bias and driver circuits 22 can also include a sensor element driver module 26 (e.g., a current source) configured, for example, to generate a current signal 26a coupled to the magnetic field sensing element 32. The power and bias and driver circuits 22 can also include a coil driver module 24 (e.g., a current source) configured to generate a current signal 24a coupled to the self-test current conductor 30. However, in other embodiments, an external coil driver module, apart from the integrated circuit 10 can be used.
The magnetic field sensor 10 can also include a diagnostic request processor 58 coupled to receive a diagnostic input signal (Diag_In) 23. The diagnostic request processor 58 is described more fully below in conjunction with FIG. 4 and the diagnostic input signal 23 is described more fully below in conjunction with FIGS. 4 and 7B-7F. However, let is suffice here to say that, in some embodiments, the diagnostic input signal 23 can be decoded by the diagnostic request processor 58, and, in response to the diagnostic input signal 23, the diagnostic request processor 58 can initiate a self-test of the magnetic field sensor 10. The diagnostic request processor 58 can generate a diagnostic control signal 58a, and the coil driver module 24 can be coupled to receive the diagnostic control signal 58a. In response to the diagnostic control signal 58a, the coil driver circuit 24 can generate the current signal 24a. 
The processing circuit 34 (also referred to herein as a signal processor 34) can include a processing module 36 having either an analog signal processor 38, a digital signal processor 40, or any combination of analog and digital processors 38, 40 that perform any combination of analog and digital processing of the composite magnetic field signal 32a. The arrow shown between the analog signal processor 38 and the digital signal processor 40 is used merely to indicate the combination of analog and digital signal processing and various couplings therebetween.
The signal processor 34 can also include a gain adjustment module 42, an offset adjustment module 44, and a temperature adjustment module 46, each coupled to the processing module 36. The gain adjustment module 42 is configured to contribute to a signal 48 received by the processing module 36, which signal 48 is configured to adjust or calibrate a gain of the processing module 36. The offset adjustment module 44 is also configured to contribute to the signal 48 received by the processing module 36, which signal 48 is also configured to adjust or calibrate a DC offset of the processing module 36. The temperature adjustment module 46 is also configured to contribute to the signal 48 received by the processing module 36, which signal 48 is configured to adjust or calibrate a gain and/or a DC offset of the processing module 36 over temperature excursions. It will be understood that that gain, offset, and temperature are but some common parameters that are compensated/adjusted, but that compensation/adjustment is not limited to those parameters only.
The processing module 36 is configured to generate the sensor signal 36a representative of the above-described measured-magnetic-field-responsive signal portion. The processing module 36 is also configured to generate at least one of the diagnostic signal 36c representative of the above-described self-test-responsive signal portion or the composite signal 36b representative of both the measured-magnetic-field-responsive signal portion and the self-test-responsive signal portion.
In some embodiments, the magnetic field sensor 10 can also include output circuits 50, for example, a sensor output formatting circuit 52, a diagnostic output formatting circuit 56, and a combining circuit 54. Operation of the sensor output formatting circuit 52, the diagnostic output formatting circuit 56, and the combining circuit 54 will be further understood from discussion below in conjunction with FIGS. 8-8D and 9-9E. Let it suffice here to say that the sensor output formatting circuit 52 can reformat the signal 36a representative of the measured-magnetic-field-responsive signal portion to generate a sensor output signal 52a (Sensor_Out). The diagnostic signal formatting circuit 56 can reformat the signal 36c representative of the self-test-responsive signal portion to generate a diagnostic output signal 56a (Diag_Out). The combining circuit 54 can either reformat the signal 36b representative of both the measured-magnetic-field-responsive signal portion and the self-test-responsive signal portion to generate a combined output signal 54a (Combined_Out), or it can use the signals 52a, 56a to accomplish a similar result.
The magnetic field sensor 10 can also provide an external coil drive signal 16 and an external ground 20, which can be coupled to an external conductor or coil 18. The coil 18 can be used in place of the self-test current conductor 30 to generate the above-described self-test magnetic field.
In operation, the current signal 24a can be a pulse signal, and therefore, the self-test magnetic field can be a pulsed magnetic field generated by the self-test current conductor 30 or by the external coil 18. The self-test magnetic field can physically combine with the above-described measured magnetic field, which is a field associated with that which the magnetic field sensor 10 is intended to measure. For example, the magnetic field sensor 10 can be intended to measure a magnetic field associated with a ferromagnetic or magnetic object, which generates the measured magnetic field. For another example, the magnetic field sensor 10 can be intended to measure a current flowing in a conductor (not shown), which generates the measured magnetic field.
In operation, the combination of the measured magnetic field and the self-test magnetic field is received by the magnetic field sensing element 32. The self-test magnetic field can be initiated by way of the diagnostic input signal 23, described more fully below in conjunction with FIGS. 7-7F. The self-test magnetic field can also be initiated in other ways described more fully below in conjunction with FIG. 4. The magnetic field sensing element thus generates the above described composite magnetic field signal 32a having a measured-magnetic-field-responsive signal portion, which is responsive to the measured magnetic field, and a self-test-responsive signal portion, which is responsive to the self-test magnetic field.
In some embodiments, the processing circuit 36 can operate to separate the measured-magnetic-field-responsive signal portion from the self-test-responsive signal portion to generate the sensor signal 36a representative of the magnetic field-signal portion and the diagnostic signal 36c representative of the self-test-responsive signal portion. However, in some embodiments, the processing circuit can generate the composite signal 36b representative of both the measured-magnetic-field-responsive signal portion and the self-test-responsive signal portion in addition to or in place of the signal 36c. 
In operation the output circuits 50 can reformat the signals 36a-36c into at least the formats described below in conjunction with FIGS. 8A-8D, 9, 9B-9E, 10A, and 10B.
Referring now to FIG. 2, in which like elements of FIG. 1 are shown having like reference designations, a self-test current conductor 30′ (where the prime symbol is indicative of one particular variation of the self-test current conductor 30 of FIG. 1) is proximate to the magnetic field sensing element 32. When a current in the direction of the arrow on the conductor 30′ passes through the self-test current conductor 30′, a self-test magnetic field 60a is generated and is received by the magnetic field sensing element 32 as a magnetic field generally perpendicular to a major surface of the magnetic field sensing element 32. Thus, this arrangement is generally suitable for most types of Hall effect elements.
The self-test magnetic field 60a can be a pulsed magnetic field generated by a pulsed current carried by the self-test current conductor 30′. The self-test magnetic field 60a physically adds to any other magnetic field (not shown), e.g., the measured magnetic field, experienced by the magnetic field sensing element 32.
Referring now to FIG. 2A, in which like elements of FIGS. 1 and 2 are shown having like reference designations, a self-test current conductor 30′′ is proximate to the magnetic field sensing element 32. The self-test current conductor 30′′ forms a single-turn loop around the magnetic field sensing element 32. When a current in the direction of the arrows on the conductor 30′′ passes through the self-test current conductor 30′′, a self-test magnetic field 60b is generated and is received by the magnetic field sensing element 32 as a magnetic field generally perpendicular to a major surface of the magnetic field sensing element 32. Thus, this arrangement is also generally suitable for most types of Hall effect elements.
It will be understood that the self-test magnetic field 60b is larger than the self-test magnetic field 60a of FIG. 2 when the self-test current is the same.
The self-test magnetic field 60b can be a pulsed magnetic field generated by a pulsed current carried by the self-test current conductor 30′′. The self-test magnetic field 60b physically adds to any other magnetic field (not shown), e.g., the measured magnetic field, experienced by the magnetic field sensing element 32.
Referring now to FIG. 2B, in which like elements of FIGS. 1, 2 and 2A are shown having like reference designations, a self-test current conductor 30′′′ is proximate to the magnetic field sensing element 32. The self-test current conductor 30′′′ forms a multi-turn loop or coil around the magnetic field sensing element 32. When a current in the direction of the arrows on the conductor 30′′′ passes through the self-test current conductor 30′′′, a self-test magnetic field 60c is generated and is received by the magnetic field sensing element 32 as a magnetic field generally perpendicular to a major surface of the magnetic field sensing element 32. Thus, this arrangement is also generally suitable for most types of Hall effect elements.
It will be understood that the self-test magnetic field 60c is larger than the self-test magnetic field 60a of FIG. 2 and the self-test magnetic field 60b of FIG. 2A when the self-test current is the same.
The self-test magnetic field 60c can be a pulsed magnetic field generated by a pulsed current carried by the self-test current conductor 30′′′. The self-test magnetic field 60c physically adds to any other magnetic field (not shown), e.g., the measured magnetic field, experienced by the magnetic field sensing element 32.
Referring now to FIG. 2C, in which like elements of FIGS. 1, 2, 2A, and 2B are shown having like reference designations, a self-test current conductor 30′′′′ is proximate to the magnetic field sensing element 32. When a current in the direction of the arrow on the conductor 30′′′′ passes through the self-test current conductor 30′′′′, a self-test magnetic field 60d is generated and is received by the magnetic field sensing element 32 as a magnetic field generally parallel to a major surface of the magnetic field sensing element 32. Thus, this arrangement is generally suitable for most types of magnetoresistance elements.
The self-test magnetic field 60d can be a pulsed magnetic field generated by a pulsed current carried by the self-test current conductor 30′′′′. The self-test magnetic field 60d physically adds to any other magnetic field (not shown), e.g., the measured magnetic field, experienced by the magnetic field sensing element 32.
Referring now to FIG. 2D, in which like elements of FIGS. 1, 2, 2A, 2B, and 2C are shown having like reference designations, a self-test current conductor 30′′′′ is proximate to the magnetic field sensing element 32. The magnetic field sensing element 32 is comprised of four magnetic field sensing elements 32a-32d. When a current in the direction of the arrow on the conductor 30′′′′′ passes through the self-test current conductor 30′′′′′, a self-test magnetic field 60e is generated and is received by the magnetic field sensing elements 32a-32d as a magnetic field generally parallel to major surfaces of the magnetic field sensing elements 32a-32d. Thus, this arrangement is generally suitable for most types of magnetoresistance elements.
The self-test magnetic field 60e can be a pulsed magnetic field generated by a pulsed current carried by the self-test current conductor 30′′′′′. The self-test magnetic field 60e physically adds to any other magnetic field (not shown), e.g., the measured magnetic field, experienced by the magnetic field sensing elements 32a-32d. In some arrangements, node 62a can be coupled to a power supply voltage, for example, Vcc, node 62d can be coupled to a voltage reference, for example, ground, and nodes 62b, 62c can provide a differential output signal.
Referring now to FIG. 3, a cross section of a portion of a magnetic field sensor 70 is representative of the magnetic field sensing element 32 and self-test current conductor 30′′′ of FIG. 2B. The magnetic field sensor 70 includes a magnetic field sensing element 92 supported by a substrate 82 having a surface 82a. The magnetic field sensing element 92 may be impregnated into or diffused into and below the surface 82a of the substrate 82, such as is known for manufacturing of Hall effect elements. The magnetic field sensing element 92 can have a maximum response axis 96 generally perpendicular to the surface 82a of the substrate 82.
The magnetic field sensor 70 can include metal layers 84, 86, 88 separated by insulating layers 76, 78, 80. Other metal and insulating layers (not shown) can be disposed between the conductive layer 76 and the metal layer 84. An electromagnetic shield 72 can be disposed over another insulating layer 74.
Sections 94a-94c are representative of a coil self-test conductor, such as the self-test conductor 30′′′ of FIG. 2B and representative of the self-test conductor 30 of FIG. 1. The sections 94a-94c can form one continuous self-test conductor, here disposed on different ones of the metal layers 84, 86, 88 and coupled by way of vias 90a, 90b. A self-test current carried by the self-test conductor 94a-94c tends to form a self-test magnetic field along the maximum response axis 96.
Referring now to FIG. 3A, in which like elements of FIG. 3 are shown having like reference designations, a magnetic field sensor 100 can include all of the layers of the magnetic field sensor 70 of FIG. 3 and also the magnetic field sensing element 92 of FIG. 3, but the self-test conductor 94a-94c of FIG. 3 can be replaced by a continuous external coil self-test conductor 102, which, in some embodiments, can be disposed upon a circuit board 104. The external self-test conductor 102 is representative of the external self-test conductor 18 of FIG. 1. The self-test conductor 102, shown on one metal layer of the circuit board 104, can instead be formed from a plurality of metal layers upon the circuit board 104. A self-test current carried by the self-test conductor 102 tends to form a self-test magnetic field along the maximum response axis 96.
Referring now to FIG. 3B, in which like elements of FIGS. 3 and 3A are shown having like reference designations, a magnetic field sensor 110 can include all of the layers of the magnetic field sensors 70 of FIG. 3 and 100 of FIG. 3A, but the external self-test conductor 102 of FIG. 3A can be replaced by a continuous external coil self-test conductor 114. Furthermore, the magnetic field sensing element 92 of FIGS. 3 and 3A can be replaced by a magnetic field sensing element 112 having a maximum response axis 116 generally parallel to the surface 82a of the substrate 82. The external self-test conductor 114 is representative of the external self-test conductor 18 of FIG. 1.
The magnetic field sensing element 112 may be disposed on or near the surface 82a of the substrate 82, such as is known for manufacturing of magnetoresistance elements. The magnetic field sensing element 92 can have a maximum response axis 116 generally parallel to the surface 82a of the substrate 82. A self-test current carried by the self-test conductor 114 tends to form a self-test magnetic field along the maximum response axis 116.
Referring now to FIG. 3C, in which like elements of FIGS. 3-3B are shown having like reference designations, a magnetic field sensor 120 can include all of the layers of the magnetic field sensors 70, 100 and 110 of FIGS. 3, 3A, and 3B, respectively, and also the magnetic field sensing element 112 of FIG. 3B, but the external self-test conductor 114 of FIG. 3B can be replaced by an internal single conductor self-test conductor 122. The self-test conductor 122 is representative of the self-test conductor 30 of FIG. 1 and the self-test conductor 30′′′′ of FIG. 2C.
A self-test current carried by the self-test conductor 122 tends to form a self-test magnetic field along the maximum response axis 116.
Referring now to FIG. 3D, in which like elements of FIGS. 3-3C are shown having like reference designations, a magnetic field sensor 130 can include all of the layers of the magnetic field sensors 70, 100, 110, and 120 of FIGS. 3, 3A, 3B, and 3C, respectively, but the internal self-test conductor 122 of FIG. 3C can be replaced by an external single conductor self-test conductor 132, which, in some embodiments, can be disposed upon a circuit board 134. The self-test conductor 132 is representative of the external self-test conductor 18 of FIG. 1.
A self-test current carried by the self-test conductor 132 tends to form a self-test magnetic field along the maximum response axis 116.
While FIGS. 3-3D show various alternative embodiments associated with the magnetic field sensing element 32 and self-test current conductors 30, 18 or FIG. 1, it will be recognized that there are many other possible configurations, including, but not limited to, combinations of the configurations shown.
While FIGS. 3-3D are representative of portions of magnetic field sensors 70, 100, 110, 120, 130, it should be understood that the magnetic field sensing element 32 and self-test current conductor 30 of FIG. 1 can be disposed on the same substrate as other portions of the magnetic field sensor 10 of FIG. 1, or, in other embodiments on a second different substrate from the other portions of the magnetic field sensor 10 of FIG. 1.
Referring now to FIG. 3E, a magnetic field sensor 144, here encased in a package 142, can be the same as or similar to the magnetic field sensor 10 of FIG. 1. The magnetic field sensor 144 can be coupled to a lead frame having leads 146. The leads 146 can be electrically coupled to a circuit board 150. The magnetic field sensor 144 can be responsive to a magnetic field 148 perpendicular to a major surface of the magnetic field sensor 144, such as may be generated by proximity of a magnetic field source 140, for example, a hard ferromagnetic object.
Referring now to FIG. 3F, a magnetic field sensor 156, here encased in a package 154, can be the same as or similar to the magnetic field sensor 10 of FIG. 1. The magnetic field sensor 156 can be coupled to a lead frame having leads, of which leads 160a, 160b are representative. The leads, e.g., 160a, 160b, can be electrically coupled to a circuit board 150. The magnetic field sensor 156 can be responsive to a magnetic field 164 parallel to a major surface of the magnetic field sensor 156, such as may be generated by proximity of a magnetic field source 152, for example, a hard ferromagnetic object.
Also shown, in some alternate embodiments, the leads can be coupled with a measured conductor 158, which can be formed as a part of the lead frame of which the leads 160a, 160b are another part. A measured current carried by the measured conductor 158 tends to form a magnetic field 162 going into or out of the page, depending upon a direction of the current carried by the measured conductor 158. For these arrangements, the magnetic field sensor 156 can be a current sensor and the magnetic field sensor 156 can instead be responsive to the magnetic field 162 perpendicular to the major surface of the magnetic field sensor 156 (i.e., to the current) rather than to the magnetic field 164.
Referring now to FIG. 3G, a magnetic field sensor 170, here encased in a package 168, can be the same as or similar to the magnetic field sensor 10 of FIG. 1. The magnetic field sensor 170 can be coupled to a lead frame having leads, of which a lead 174 is representative. The leads, e.g., 174, can be electrically coupled to a circuit board 176. The magnetic field sensor 170 can be responsive to a magnetic field generated by proximity of a magnetic field source 172 within the package 168. For example, the magnetic field source 172 can be a measured current conductor similar to the measured current conductor 158 of FIG. 3F.
Referring now to FIG. 4, a diagnostic request processor 190 can be the same as or similar to the diagnostic request processor 58 of FIG. 1. The diagnostic request processor 190 can be coupled to receive a diagnostic input signal 192, which can be the same as or similar to the diagnostic input signal 23 of FIG. 1. The diagnostic request processor 190 can include a diagnostic input decoder 204 to receive and to decode the diagnostic input signal 192. The diagnostic input decoder 204 can generate a decoded diagnostic signal 204a. 
The diagnostic request processor 190 can also include a pulse generator 198 coupled to receive the decoded diagnostic signal 204a and configured to generate a diagnostic control signal 198a having pulses in response to the decoded diagnostic signal 204a. The diagnostic control signal 198a can be the same as or similar to the diagnostic control signal 58a of FIG. 1.
The diagnostic request processor 190 can also include a clock generator 194 configured to generate a periodic clock signal 194a. The diagnostic request processor 190 can also include an internal diagnostic clock generator 196 coupled to receive the clock signal 194a and configured to generate a periodic diagnostic clock signal 196a. 
The pulse generator 198 can be coupled to receive the diagnostic clock signal 196a and can be configured to generate the diagnostic control signal 198a having pulses synchronized with the diagnostic clock signal 196a. 
Thus, there can be at least two ways to control the pulse generator 198 and associated diagnostics events, i.e., pulses within the diagnostic input signal 198a. As described above, the pulse generator 198 can be responsive to the diagnostic input signal 192. Alternatively, the pulse generator 198 can be responsive to the control signal 196a instead of, or in addition to, the diagnostic input signal 192. When responsive to the control signal 196a, the pulse generator 198 can generate pulses at periodic time intervals, or groups of pulses at periodic time intervals.
The diagnostic request processor 190 can also include a power on circuit 202 coupled to generate power on signal 202a having a first state for a predetermined period of time after the magnetic field sensor, e.g., the magnetic field sensor 10 of FIG. 1, is first powered on, followed by a second different state. The pulse generator 196 can be coupled to receive the power on signal 202a and can be further responsive to the power on signal 202a such that the pulse generator 198 also generates pulses in the diagnostic control signal 198a in response to the power on signal 202a. 
In some embodiments, the diagnostic clock signal 196a has a frequency in the range of about ten Hz to one hundred Hz. However, the diagnostic clock signal 196a can also have a frequency higher than one hundred Hz (e.g., one thousand Hz) or lower than ten Hz (e.g., one Hz) or anywhere in between ten Hz and one hundred Hz.
In some embodiments, the pulse generator 198 generates pulses having a period between about one μs and ten μs in the diagnostic control signal 198a. However, the pulse generator 198 can also generate pulses having a period greater than ten μs (e.g., one hundred μs) or less than one μs (e.g., 0.1 μs) or anywhere in between one μs and ten μs.
The diagnostic control signal 198a can be received by a coil driver circuit 200, for example, a current source, which can be the same as or similar to the coil driver circuit 24 of FIG. 1. The coil driver circuit 200 can generate a self-test current signal 200a, which is received by a self-test current conductor the same as or similar to the self-test current conductor 30 of FIG. 1 or the external coil 18 of FIG. 1.
Referring now to FIG. 5, a magnetic field sensor 210 can be the same as or similar to the magnetic field sensor 10 of FIG. 1. The magnetic field sensor 210 can include a current source 216 coupled to receive a supply voltage signal 212 and configured to generate a self-test current signal 218. The current source 216 can be the same as or similar to the coil driver 24 of FIG. 1.
The magnetic field sensor 210 can also include a self-test current conductor 224 coupled To receive and carry the self-test current signal 218. While the self-test current conductor 224 is shown to be a coil, from FIGS. 2-2D, it will be understood that the self-test current conductor 224 can have one of a variety of arrangements.
The magnetic field sensor 210 can also include a magnetic field sensing element 226 proximate to the self-test current conductor 224 such that the magnetic field sensing element 226 can receive a self-test magnetic field generated by the current 218 carried by the self-test current conductor 224. The magnetic field sensing element 226 can also receive a measured magnetic field associated with a magnetic field generator (not shown) that the magnetic field sensor 210 is intended to measure. Thus, the magnetic field sensor is configured to generate a differential composite magnetic field signal 226a, 226b comprising a measured-magnetic-field-responsive signal portion and a self-test-responsive signal portion.
The magnetic field sensor 210 can also include an amplifier 228 coupled to receive the composite magnetic field signal 226a, 226b and configured to generate an amplified signal 228a representative of the composite magnetic field signal 226a, 226b. 
The magnetic field sensor 210 can also include a low pass filter 230 and a high pass filter 248, each coupled to receive the amplified signal 228a. The low pass filter 230 is configured to generate a filtered signal 230a and the high pass filter 248 is configured to generate a filtered signal 248a. 
A comparator 240 can be coupled to receive the filtered signal 230a. The comparator 240 can have hysteresis or other circuit techniques to result in two thresholds 242, a magnetic field operate point (BOP) and a magnetic field release point (BRP). The BOP and BRP thresholds 242, in some embodiments, can be separated by a voltage equivalent to about five Gauss received by the magnetic field sensing element 226. In other embodiments, the BOP and BRP thresholds 242 can be separated by a voltage equivalent to about fifty Gauss received by the magnetic field sensing element 226. However, the BOP and BRP thresholds 242 can be separated by a voltage equivalent to a magnetic field anywhere between about five and fifty Gauss. The BOP and BRP thresholds 242 can also be separated by a voltage equivalent to a magnetic field smaller than five Gauss or larger than fifty Gauss. The comparator 240 is configured to generate a two state comparison signal 240a. 
A comparator 250 can be coupled to receive the filtered signal 248a. The comparator 250 can have hysteresis or other circuit techniques to result in two thresholds, which can be relatively closely spaced about a diagnostic threshold voltage (TH_Diag) 252. In some embodiments, the hysteresis associated with the diagnostic threshold voltage 252 is about fifty millivolts. The comparator 250 is configured to generate a two state comparison signal 250a. 
The magnetic field sensor 210 can also include a sensor output formatting circuit (SOFC) 244 coupled to receive the comparison signal 240a and configured to generate a sensor non-linear output signal 244a. The SOFC 244 can be the same as or similar to the sensor output formatting circuit 52 of FIG. 1.
The magnetic field sensor 210 can also include a diagnostic output formatting circuit (DOFC) 254 coupled to receive the comparison signal 250a and configured to generate a diagnostic output signal 254a. The DOFC 254 can be the same as or similar to the diagnostic output formatting circuit 56 of FIG. 1.
The magnetic field sensor 210 can also include a combining circuit 256 coupled to receive the sensor non-linear output signal 244a, coupled to receive the diagnostic output signal 254a, and configured to generate a combined output signal 256a. The combining circuit 256 can be the same as or similar to the combining circuit 54 of FIG. 1.
The magnetic field sensor 210 can also include another SOFC 246 coupled to receive the filtered signal 230a and configured to generate a sensor linear output signal 246a. The SOFC 246 can be the same as or similar to the sensor output formatting circuit 52 of FIG. 1.
The magnetic field sensor 210 can also include a diagnostic request processor 260 coupled to receive a diagnostic input signal 258 and configured to generate a diagnostic control signal 260a. The diagnostic request processor 260 can be the same as or similar to the diagnostic request processor 58 or FIG. 1 or the diagnostic request processor 190 of FIG. 4. Operation of the diagnostic request processor 260 can be as is described above in conjunction with FIG. 4 and is further described below in conjunction with FIGS. 7-7F.
In operation, upon activation of the diagnostic control signal 260a, the current source 216 can generate one or more current pulses 218, which are carried by the self-test conductor 224 resulting in a self-test magnetic field received by the magnetic field sensing element 226. It will be understood that the self-test magnetic field, and therefore, the self-test-responsive signal portion of the composite magnetic field signal 226a, 226b, can have a frequency content that is generally above a frequency content of a measured magnetic field that the magnetic field sensor 210 is intended to measure. Therefore, the filtered signal 248a can be comprised predominantly of the self-test-responsive signal portion, i.e., pulses, and the filtered signal 230a can be comprised predominantly of the measured-magnetic-field-responsive signal portion. Therefore, by way of the filters 230, 248, the composite magnetic field signal 226a, 226b is split into its two components, the self-test-responsive signal portion and the measured-magnetic-field-responsive signal portion.
In one particular embodiment, the low pass filter 230 has a break frequency of about two hundred kHz and the high pass filter 248 has a break frequency above about two hundred kHz, such that the signal 248a tends to represent the self-test-responsive signal portion of the composite magnetic field signal 226a, 226b. Accordingly, in some embodiments, the measured magnetic field can have a frequency below about two hundred kHz.
It will be understood that the comparator 250 and the diagnostic threshold 252 can assure that the pulses in the filtered signal 248a are of proper and sufficient magnitude to be indicative of proper operation of the magnetic field sensing element 226, amplifier 228, and filter 248. In operation, the comparator 250 generates the two-state comparison signal 250a, i.e., pulses, only when the pulses in the filtered signal 248a are proper. Pulses of the comparison signal 250a can be reformatted into any format by the DOFC 254 to generate the diagnostic output signal 254a. Exemplary formats of the diagnostic output signal 254a are described below in conjunction with FIGS. 8A-8D.
As described above, the filtered signal 230a is predominantly comprised of the measured-magnetic-field-responsive signal portion. The SOFC 246 can reformat the filtered signal 230a into any format to generate the sensor linear output signal 246a. In one particular embodiment, the SOFC 246 merely passes the filtered signal 230a through the SOFC 246, in which case no reformatting occurs.
The comparison signal 240a can be indicative of the magnetic field sensor 210 that operates as a magnetic switch. For example, when the magnetic field sensing element 226 is close to a measured magnetic object, resulting in a magnetic field at the magnetic field sensing element 226 greater than an operating point, the comparison signal 240a has a first state, and when the magnetic field sensing element 226 is not close to the measured magnetic object, resulting in a magnetic field at the magnetic field sensing element 226 less than a release point, the comparison signal 240a has a second different state. The SOFC 244 can reformat the comparison signal 240a into any format to generate the sensor non-linear output 244a. In one particular embodiment, the SOFC 244 merely passes the comparison signal 240a through the SOFC 244, in which case no reformatting occurs.
While many of the blocks of the magnetic field sensor 210 are shown to be analog blocks, it should be appreciated that similar functions can be performed digitally.
Referring now to FIG. 5A, in which like elements of FIG. 5 are shown having like reference designations, a magnetic field sensor 300 includes all of the components of the magnetic field sensor 210 of FIG. 5. In addition, the magnetic field sensor 300 includes an inverter 302 configured to generate an inverted diagnostic control signal 302a. The magnetic field sensor 300 also includes an AND gate 304 coupled to receive the comparison signal 250a, coupled to receive the diagnostic control signal 260a, and configured to generate a diagnostic comparison signal 304a. The magnetic field sensor 300 also includes a switch 222, which can be a FET, coupled across the self-test current conductor 224 and controlled by the inverted diagnostic control signal 302a. The magnetic field sensor 300 also includes a logic circuit 306 configured to generate a sensor non-linear threshold (TH_SONL) 314 received by the amplifier 240 in place of the BOP/BRP threshold 242 of FIG. 5. Each of these added elements improves operation of the magnetic field sensor 210 of FIG. 5 in ways further described below.
The logic circuit 306 can include an AND gate 308 coupled to receive the diagnostic comparison signal 304a, coupled to receive the non-linear sensor comparison signal 240a, and configured to generate a logic signal 308a. The logic signal 308a can be received at a set node of a set/reset flip-flop 310. The set/reset flip-flop 310 can also be coupled to receive the inverted diagnostic control signal 302a at a reset node. The set/reset flip-flop 310 can be configured to generate a control signal 310a received by a p-channel FET 312 acting as a switch to a power supply, Vcc.
The logic circuit 306 can include an inverter 316 coupled to receive the non-linear sensor comparison signal 240a′ and configured to generate an inverted signal 316a. The logic circuit 306 can also include another AND gate 318 coupled to receive the diagnostic comparison signal 304a, coupled to receive the inverted signal 316a, and configured to generate a logic signal 318a. The logic signal 318a can be received at a set node of another set/reset flip-flop 320. The set/reset flip-flop 320 can also be coupled to receive the inverted diagnostic control signal 302a at a reset node. The set/reset flip-flop 320 can be configured to generate a control signal 320a received by an n-channel FET 322 acting as a switch to ground. A source of the FET 312 can be coupled to a drain of the FET 322, forming a junction node. The BOP/BRP thresholds can also be received at the junction node. At the junction node, the sensor output non-linear threshold signal 314 is generated.
With this arrangement, it should be understood that at some times, the sensor output non-linear threshold 314 is equal to BOP, at other times it is equal to BRP, at other times it is equal to Vcc, and at other times it is equal to ground.
Referring briefly to FIG. 5, it should be understood that the self-test current 218 and resulting self-test-responsive signal portion of the composite magnetic field signal 226a, 226b does not pass through the comparator 240 or the SOFC 244. Thus, the comparator 240 and SOFC 244 are essentially excluded from the self-test.
Referring again to FIG. 5A, the logic circuit 306 provides that the comparator 240 and SOFC are included in the self-test in the following way. Whenever a diagnostic pulse occurs in the self-test current signal 218, the non-linear sensor output threshold 314 is pulled either to Vcc or to ground. At other times, the non-linear sensor output threshold 314 behaves as in FIG. 5, wherein the non-linear sensor output threshold 314 is either at a BOP or BRP voltage value. Thus, the sensor non-linear output signal 244a′ (where the prime symbol is representative of a difference from the signal 244a of FIG. 5) makes state transitions not only responsive to a measured magnetic object near to or far from the magnetic field sensing element 226, but also makes transitions when self-test pulses occur. It should be recognized that the same result may not be achieved by merely removing the filter 230, for example, in the case where the measured magnetic field is much greater than the self-test magnetic field, wherein the comparator 240 would not switch in the presence of the self-test-responsive signal portion. This function is further described in conjunction with FIGS. 10-10B.
The addition of the AND gate 304 having an input node coupled to receive the diagnostic control signal 260a results in removal of a possibility that any extraneous spikes or noise pulses in the comparison signal 250a could pass though to the diagnostic output signal 254a when no self-test current pulse 218 is ongoing. Such spikes could result from external magnetic field noise or pulses experienced by the magnetic field sensor 300.
The switch 222 also provides improved function. The switch 222 is only opened when a self-test current pulse 218 is ongoing. The switch is closed at other times. Thus, any external noise or magnetic fields experienced by the magnetic field sensor 300 will not be picked up by the self-test conductor at times when no self-test current pulses 218 are occurring.
Basic operation of the current sensor 300 is described above in conjunction with FIG. 5. The sensor non-linear output signal 244a′ is described below in conjunction with FIG. 10B.
Referring now to FIG. 5B, in which like elements of FIGS. 1, 5, and 5A are shown having like reference designations, output circuits 350 can be included as part of the magnetic field sensors 210, 300 of FIGS. 5 and 5A or any other magnetic field sensors shown or described herein. Output circuits 350 can include resistors 352a-352c coupled to a power supply, Vdd, and coupled to a respective drain of respective FETs 354a-354c. FET 354a can be coupled to receive the sensor non-linear output signal 244a at a gate node and configured to generate an inverted sensor non-linear output signal 356. FET 354b can be coupled to receive the diagnostic output signal 254a at a gate node and configured to generate an inverted diagnostic output signal 358. FET 354c can be coupled to receive the combined output signal 256a at a gate node and configured to generate an inverted combined output signal 360.
In some embodiments, the FETs 354a-354c are within an integrated magnetic field sensor, and the resistors 352a-352c and the power supply, Vdd, are outside of the integrated magnetic field sensor. However, in other embodiments, both the FETs 354a-354c and the resistors 352a-352c are within the integrated current sensor. In still other embodiments, other output circuit arrangements can be used, for example, using bipolar transistors or using a push pull configuration.
Referring now to FIG. 6, in which like elements of FIGS. 1, 5, and 5A are shown having like reference designations, a magnetic field sensor 370 is similar to the magnetic field sensor 210 of FIG. 5, however, the magnetic field sensor 370 includes a transparent latch 372 coupled between the comparator 240 and the SOFC 244, coupled to receive the comparison signal 240a at an input port and configured to generate a latched signal 372a at an output port, which is received by the SOFC 244. The transparent latch 372 is also coupled to receive the inverted diagnostic control signal 302a at an enable port.
The magnetic field sensor 370 also includes a track-and-hold circuit 374 coupled to receive the amplified signal 228a and configured to generate a tracking signal 374a. The track-and-hold circuit 374 is also coupled to receive the diagnostic control signal 260a at a control node such that the track-and-hold circuit holds whenever a current pulse appears in the self-test current signal 218 and tracks otherwise. The magnetic field sensor 370 also includes a differencing circuit 376 coupled to receive the amplified signal 228a, coupled to receive the tracking signal 374a, and configured to generate a difference signal 376a received by the comparator 250 in place of the filtered signal 248a of FIG. 5. The magnetic field sensor 370 also includes the AND gate 304 of FIG. 5A coupled to receive a comparison signal 250a′, similar to the comparison signal 250a of FIGS. 5 and 5A, where the prime symbol is representative of a similar signal. The magnetic field sensor 370 can also include an optional low pass filter 378 coupled to receive the amplified signal 228a and configured to generate a filtered signal 378a, which can be the same as or similar to the filtered signal 230a of FIG. 5.
In operation, the transparent latch 372 is transparent only when the self-test current signal 218 does not contain a current pulse. Therefore, the latched signal 372a, which is intended to be representative of only the measured-magnetic-field-responsive signal portion of the composite magnetic field signal 226a, 226b is less likely to contain spurious transitions due to the current pulses.
In operation, the tracking signal 374a contains predominantly the measured-magnetic-field-responsive signal portion of the amplified signal 228a, since the track-and-hold circuit holds during the self-test-responsive signal portion of the amplified signal 228a. Thus, the tracking signal 374a is similar to the filtered signal 378a, which is the same as or similar to the filtered signal 230a of FIGS. 5 and 5A. The SOFC 246′ can thus receive either the tracking signal 374a or the filtered signal 378a to generate the sensor linear output signal 246a′. 
General operation of the magnetic field sensor 370 is similar to that described above in conjunction with FIGS. 5 and 5A, and thus, is not described further.
Referring to FIGS. 7-7F, graphs 400, 420, 430, 440, 450, 460, and 470 have vertical axes with scales in arbitrary units of volts and horizontal axes with scales in arbitrary units of time.
The graph 400 includes a sensor non-linear output signal 402 and a sensor linear output signal 408, which can be the same as or similar to the sensor non-linear output signal 244a and the sensor linear output signal 246a of FIG. 5, respectively. The sensor non-linear output signal 402 includes high states, for example, high states 404a, 404b and low states, for example, a low state 406.
The sensor linear output signal 408 is shown here as a triangle signal, but can be any linear signal. The sensor linear output signal 408 includes sections with positive slopes, for example, sections 410a, 410b, and sections with negative slopes, for example, a section 412.
The graph 420 includes an exemplary diagnostic control signal 422, which can be the same as or similar to the diagnostic control signal 260a of FIGS. 5, 5A, and 6. The graph 420 can also be representative of a diagnostic output signal, which can be the same as or similar to the diagnostic output signal 254a, 254a′ of FIGS. 5, 5A, and 6 and the diagnostic control signal 198a of FIG. 4. It should be understood that the graph 420 can also be representative of current pulses in the self-test current signal 218 of FIGS. 5, 5A, and 6.
The signal 422 can include pulses, of which a pulse 424 is but one example. While the signal 422 is shown to include five pulses, other such signals 422 can include more than five or fewer than five pulses.
The graph 430 includes an exemplary diagnostic input signal 432, which can be the same as or similar to the diagnostic input signal 258 of FIGS. 5, 5A, and 6, the diagnostic input signal 23 of FIG. 1, and the diagnostic input signal 192 of FIG. 4. The exemplary diagnostic input signal 432 can include pulses, of which a pulse 434 is but one example. Each pulse of the diagnostic input signal 432 can result in one corresponding pulse of the diagnostic control signal 422 and one corresponding pulse of the diagnostic output signal 422.
While the signal 432 is shown to include five pulses, other such signals 432 can include more than five or fewer than five pulses.
The graph 440 includes another exemplary diagnostic input signal 442, which can be the same as or similar to the diagnostic input signal 258 of FIGS. 5, 5A, and 6, the diagnostic input signal 23 of FIG. 1, and the diagnostic input signal 192 of FIG. 4. The diagnostic input signal 442 can have one pulse 444. Each pulse of the diagnostic input signal 442 can result in a plurality of pulses of the diagnostic control signal 422 and a corresponding plurality of pulses of the diagnostic output signal 422.
The graph 450 includes yet another exemplary diagnostic input signal 452, which can be the same as or similar to the diagnostic input signal 258 of FIGS. 5, 5A, and 6, the diagnostic input signal 23 of FIG. 1, and the diagnostic input signal 192 of FIG. 4. The diagnostic input signal 452 can have a high state 454, a low state 456, and an edge 458. The high state 454 of the diagnostic input signal 452 can result in a plurality of pulses of the diagnostic control signal 422 and a corresponding plurality of pulses of the diagnostic output signal 422.
The graph 460 includes yet another exemplary diagnostic input signal 462, which can be the same as or similar to the diagnostic input signal 258 of FIGS. 5, 5A, and 6, the diagnostic input signal 23 of FIG. 1, and the diagnostic input signal 192 of FIG. 4. The diagnostic input signal 462 can have pulses, e.g., a pulse 464, with a first duty cycle, and pulses, e.g., a pulse 466, with a second different duty cycle. Rising edges of the pulses 464 having the first duty cycle, and including an edge 466, can each result in one corresponding pulse of the diagnostic control signal 422 and one corresponding pulse of the diagnostic output signal 422. The pulses 466 having the second different duty cycle result in no pulse in the diagnostic control signal 422 or in the diagnostic output signal 422.
The graph 470, which has a time scale expanded from that of FIGS. 7-7F includes yet another exemplary diagnostic input signal 478, which can be the same as or similar to the diagnostic input signal 258 of FIGS. 5, 5A, and 6, the diagnostic input signal 23 of FIG. 1, and the diagnostic input signal 192 of FIG. 4. The diagnostic input signal 478 can have a digital chip address 472, a digital register address 474, and digital register data 476. The diagnostic input signal 478 can result in a plurality of pulses of the diagnostic control signal 422 and a corresponding plurality of pulses of the diagnostic output signal 422.
The diagnostic input signal 478 can be in one of a variety of formats or protocols, for example, a custom protocol or a conventional protocol, for example, I2C, SENT, BiSS, LIN, or CAN.
It should be understood that each one of the diagnostic input signals 432, 442, 452, 462, and 478 can be decoded by the diagnostic input decoder 204 of FIG. 4 to result in the diagnostic output/diagnostic control signal 422.
It should be recognized that FIGS. 7B-7F show only a few exemplary types of diagnostic input signals that may be used. Many other types of diagnostic input signals can also be used.
Referring now to FIGS. 8-8D, graphs 480, 490, 500, 510, and 520 have vertical axes with scales in arbitrary units of volts and horizontal axes with scales in arbitrary units of time.
The graph 480 includes an exemplary diagnostic input signal 482, which can be the same as or similar to the diagnostic input signal 258 of FIGS. 5, 5A, and 6, the diagnostic input signal 23 of FIG. 1, the diagnostic input signal 192 of FIG. 4, and the diagnostic input signal 432 of FIG. 7B. The exemplary diagnostic input signal 482 can include pulses, of which a pulse 484 is but one example.
The graph 490 includes an exemplary diagnostic control signal 492, which can be the same as or similar to the diagnostic control signal 260a of FIGS. 5, 5A, and 6, and the diagnostic control signal 422 of FIG. 7A. The graph 490 can also be representative of a diagnostic output signal, which can be the same as or similar to the diagnostic output signal 254a, 254a′ of FIGS. 5, 5A, and 6, the diagnostic output signal 198a of FIG. 4, and the diagnostic output signal 422 of FIG. 7A. It should be understood that the graph 490 can also be representative of current pulses in the self-test current signal 218 of FIGS. 5, 5A, and 6.
The signal 492 can include pulses, of which a pulse 494 is but one example. While the signal 492 is shown to include five pulses, other such signals 492 can include more than five or fewer than five pulses.
Each pulse of the diagnostic input signal 482 can result in one corresponding pulse of the diagnostic control signal 492 and one corresponding pulse of the diagnostic output signal 492. The pulses 494 of the diagnostic output signal 492 are indicative of a self-test that is passing.
While the signal 492 is shown to include five pulses, other such signals 492 can include more than five or fewer than five pulses.
The graph 500 includes yet another exemplary diagnostic output signal 502, which can be the same as or similar to the diagnostic output signal 254a, 254a′ of FIGS. 5, 5A, and 6, and the diagnostic output signal 422 of FIG. 7A. The diagnostic output signal 502 can have a high state 504, a low state 506, and an edge 508. The high state 504 of the diagnostic output signal 502 can result from a plurality of pulses 494 of the diagnostic control signal 492 or from any of the diagnostic input signals of FIGS. 7B-7F. The high state 504 of the diagnostic output signal 502 can be indicative of a self-test that is passing.
The graph 510 includes yet another exemplary diagnostic output signal 512, which can be the same as or similar to the diagnostic output signal 254a, 254a′ of FIGS. 5, 5A, and 6, and the diagnostic output signal 422 of FIG. 7A. The diagnostic output signal 512 can have pulses, e.g., a pulse 514, with a first duty cycle, and pulses, e.g., a pulse 516, with a second different duty cycle. The pulses 514 having the first duty cycle and an edge 518 can each result from one corresponding pulse of the diagnostic control signal 492 or from any of the diagnostic input signals of FIGS. 7B-7F. The pulses 514 having the first duty cycle can be indicative of a self-test that is passing.
The graph 520, which has a time scale expanded from that of FIGS. 8-8C includes yet another exemplary diagnostic output signal 528, which can be the same as or similar to the diagnostic output signal 254a, 254a′ of FIGS. 5, 5A, and 6, and the diagnostic output signal 422 of FIG. 7A. The diagnostic output signal 528 can have a digital chip address 522, a digital register address 524, and digital register data 526. The diagnostic output signal 522 can result from a plurality of pulses of the diagnostic control signal 492 or from any of the diagnostic input signals of FIGS. 7B-7F. Particular digital register data 526 can be indicative of a self-test that is passing.
The diagnostic output signal 528 can be in one of a variety of formats or protocols, for example, a custom protocol or a conventional protocol, for example, I2C SENT, BiSS, LIN, or CAN.
It should be recognized that FIGS. 8A-8D show only a few exemplary types of diagnostic output signals that may be generated. Many other types of diagnostic output signals can also be generated.
Referring now to FIGS. 9-9E, graphs 530, 550, 560, 570, 580, and 590 have vertical axes with scales in arbitrary units of volts and horizontal axes with scales in arbitrary units of time.
The graph 530, like the graph 400 of FIG. 7, includes a sensor non-linear output signal 532 and sensor linear output signal 538, which can be the same as or similar to the sensor non-linear output signal 244a and the sensor linear output signal 246a of FIG. 5, respectively. The sensor non-linear output signal 532 includes high states, for example, high states 534a, 534b, and low states, for example, a low state 536.
The sensor linear output signal 538 is shown here as a triangle signal, but can be any linear signal. The sensor linear output signal 538 includes sections with positive slopes, for example, sections 540a, 540b, and sections with negative slopes, for example, a section 542.
The graph 550, like the graph 430 of FIG. 7B and the graph 480 of FIG. 8, includes an exemplary diagnostic input signal 552, which can be the same as or similar to the diagnostic input signal 258 of FIGS. 5, 5A, and 6, the diagnostic input signal 23 of FIG. 1, and the diagnostic input signal 192 of FIG. 4. The exemplary diagnostic input signal 552 can include pulses, of which a pulse 554 is but one example.
The graph 560 includes an exemplary combined output signal 562, which can be the same as or similar to the combined output signal 256a, 256a′ of FIGS. 5, 5A, and 6, and the combined output signal 54a of FIG. 1. The combined output signal 562 can include pulse groups, e.g., pulse groups 564, 566, combined with the sensor non-linear output signal 532 of FIG. 9, here shown as a dark line. The pulse groups, e.g., pulse groups 564, 566, can be indicative of a self-test that is passing.
The graph 570 includes another exemplary combined output signal 572, which can be the same as or similar to the combined output signal 256a, 256a′ of FIGS. 5, 5A, and 6, and the combined output signal 54a of FIG. 1. The combined output signal 572 can include small pulses, e.g., small pulses 574, 576, combined with the sensor non-linear output signal 532 of FIG. 9, here shown as a dark line. The small pulses, e.g., the small pulses 574, 576, can be indicative of a self-test that is passing.
The graph 580 includes yet another exemplary combined output signal 582, which can be the same as or similar to the combined output signal 256a, 256a′ of FIGS. 5, 5A, and 6, and the combined output signal 54a of FIG. 1. The combined output signal 582 can include pulses, e.g., pulses 584, 586, combined with the sensor non-linear output signal 532 of FIG. 9, here shown as a dark line. The pulses, e.g., the pulses 584, 586, can be indicative of a self-test that is passing.
The graph 590 includes yet another exemplary combined output signal 592, which can be the same as or similar to the combined output signal 256a, 256a′ of FIGS. 5, 5A, and 6, and the combined output signal 54a of FIG. 1. The combined output signal 592 can include small pulses, e.g., pulses 594, 596, combined with the sensor linear output signal 538 of FIG. 9, here shown as a dark line. The pulses, e.g., the pulses 594, 596, can be indicative of a self-test that is passing. Digitally encoded versions of all of the above output signals are also possible.
Referring now to FIGS. 10-10B, graphs 600, 610, and 620 have vertical axes with scales in arbitrary units of volts and horizontal axes with scales in arbitrary units of time.
The graph 600, like the graph 420 of FIG. 7A and the graph 490 of FIG. 8A, includes an exemplary diagnostic control signal 602, which can be the same as or similar to the diagnostic control signal 260a of FIGS. 5, 5A, and 6, and the diagnostic control signal 198a of FIG. 4. The graph 600 can also be representative of a diagnostic output signal, which can be the same as or similar to the diagnostic output signal 254a, 254a′ of FIGS. 5, 5A, and 6. It should be understood that the graph 600 can also be representative of current pulses in the self-test current signal 218 of FIGS. 5, 5A, and 6.
The signal 602 can include pulses, of which a pulse 604 is but one example. While the signal 602 is shown to include five pulses, other such signals 422 can include more than five or fewer than five pulses.
The graph 610 includes a sensor non-linear comparison signal 612, which can be the same as or similar to the sensor non-linear comparison signal 240a′ of FIG. 5A. The sensor non-linear comparison signal 612 includes high states, for example, high states 614a, 614b, and low states, for example, a low state 616.
The graph 620 includes an exemplary sensor non-linear output signal 622, which can be the same as or similar to the sensor non-linear output signal 244a′ of FIG. 5A. The sensor non-linear output signal 622 is representative of the function of the logic circuit 306 of FIG. 5A. The sensor non-linear output signal 622 can include pulses, e.g., pulses 624, 626, combined with the sensor non-linear comparison signal 612 of FIG. 10A, here shown as a dark line. The pulses, e.g., the pulses 624, 626, can be indicative of a self-test that is passing, namely, a properly functioning comparator 240 and SOFC 244 of FIG. 5A.
Referring now to FIG. 11, an exemplary electromagnetic shield 800 can be the same as or similar to the electromagnetic shield 72 of FIG. 3. The electromagnetic shield 800 is placed generally over a magnetic field sensing element 816, which can be the same as or similar to the magnetic field sensing element 92 of FIG. 3. The electromagnetic shield 800 includes a first portion 802 and a second portion 804 separated by a slit 806. The first portion 802 and the second portion 804 are coupled with a conductive region 808. A bonding pad 810 allows the electromagnetic shield 800 to be coupled to a DC voltage, for example, to a ground voltage.
The electromagnetic shield 800 can be formed from a metal layer during manufacture of a magnetic field sensor, for example, the magnetic field sensor 70 of FIG. 3. The metal layer can be comprised of a variety of materials, for example, aluminum, copper, gold, titanium, tungsten, chromium, or nickel.
It should be understood that an electromagnetic shield is not the same as a magnetic shield. An electromagnetic shield is intended to block electromagnetic fields. A magnetic shield is intended to block magnetic fields.
In the presence of an AC magnetic field (e.g., a magnetic field surrounding a current carrying conductor), it will be understood that AC eddy currents 812, 814 can be induced in the electromagnetic shield 800. The eddy currents 812, 814 form into closed loops as shown. The closed loop eddy currents 812, 814 tend to result in a smaller magnetic field in proximity to the electromagnetic shield 800 than the magnetic field that induced the eddy currents 812, 814. Therefore, if the electromagnetic shield 800 were placed near a magnetic field sensing element, for example, the magnetic field sensing element 92 of FIG. 3, the magnetic field sensing element 92 experiences a smaller magnetic field than it would otherwise experience, resulting in a less sensitive magnetic field sensor, which is generally undesirable. Furthermore, if the magnetic field associated with the eddy current is not uniform or symmetrical about the magnetic field sensing element 92, the magnetic field sensing element 92 might also generate an undesirable offset voltage.
The slit 806 tends to reduce a size (i.e., a diameter or path length) of the closed loops in which the eddy currents 812, 814 travel. It will be understood that the reduced size of the closed loops in which the eddy currents 812, 814 travel results in smaller eddy currents 812, 814 and a smaller local effect on the AC magnetic field that induced the eddy current. Therefore, the sensitivity of a magnetic field sensor on which the magnetic field sensing element 816 and the electromagnetic shield 800 are used is less affected by the smaller eddy currents.
Furthermore, by placing the shield 800 in relation to the magnetic field sensing element 816 as shown, so that the slit 806 passes over the magnetic field sensing element 816, it will be understood that the magnetic field associated with any one of the eddy currents 812, 814 tends to form magnetic fields passing through the magnetic field sensing element 816 in two directions, canceling over at least a portion of the area of the magnetic field sensing element 816.
Referring now to FIG. 12, another exemplary electromagnetic shield 850 can be the same as or similar to the electromagnetic shield 72 of FIG. 3. The electromagnetic shield 850 includes four portions 852-858 separated by four slits 860-866. The four portions 852-858 are coupled with a conductive region 876. A bonding pad 878, allows the electromagnetic shield 850 to be coupled to a DC voltage, for example, a ground voltage.
In the presence of a magnetic field, it will be understood that eddy currents 868-874 can be induced in the electromagnetic shield 850. Due to the four slits 860-866, it will be understood that a size (i.e., a diameter or a path length) of the closed loops eddy currents 866-874 tends to be smaller than the size of the closed loop eddy currents 812, 814 of FIG. 11. It will be understood that the reduced size of the closed loops in which the eddy currents 868-874 travel results in smaller eddy currents 868-874 and a smaller local affect on the AC magnetic field that induced the eddy current than that which results from the shield 800 of FIG. 11. Therefore, the sensitivity of a magnetic field sensor on which the magnetic field sensing element 880 and the electromagnetic shield 850 are used is less affected by the smaller eddy currents 868-874 than the sensitivity of a current sensor using the shield 800 of FIG. 11.
Furthermore, by placing the shield 850 in relation to the magnetic field sensing element 880 as shown, so that the slits 860-866 pass over the magnetic field sensing element 880, it will be understood that the magnetic field associated with any one of the eddy currents 868-874, tends to form magnetic fields passing through the magnetic field sensing element 880 in two directions, canceling over at least a portion of the area of the magnetic field sensing element 880.
Referring now to FIG. 13, another exemplary electromagnetic shield 900 can be the same as or similar to the electromagnetic shield 72 of FIG. 3. The electromagnetic shield 900 includes a shielding portion 902 having interdigitated members, of which member 902a is but one example. The interdigitated members are coupled though a conductor portion 904 to a bonding pad 906, which allows the electromagnetic shield 900 to be coupled to a DC voltage, for example, a ground voltage.
It will be recognized that the electromagnetic shield 900 is able to support eddy currents having a much smaller size (i.e., diameter of path length) than the electromagnetic shield 850 of FIG. 12 or the electromagnetic shield 800 of FIG. 11. Therefore, the electromagnetic shield 900 tends to have an even smaller negative affect on sensitivity of a magnetic field sensor than that described above.
Referring now to FIG. 14, an electromagnetic shield 950 can be the same as or similar to the electromagnetic shield 72 of FIG. 3. The electromagnetic shield 950 includes a shielding portion 952 having a plurality of members, of which member 952a is but one example. The members are coupled though a conductor portion 954 to a bonding pad 956, which allows the electromagnetic shield 950 to be coupled to a DC voltage, for example, a ground voltage. Advantages of the electromagnetic shield 950 will be apparent from discussion above.
While shields having features to reduce eddy currents are described above, the shield 72 of FIGS. 3, 3A, 3C, and 3D can also have no features to reduce eddy currents.
Referring now to FIG. 15, an exemplary application of the above-described magnetic field sensors includes five magnetic field sensors 1004a-1004f arranged in a line. A gear shift lever 1000, such as that which may be found in an automobile, can move left or right in the view shown to select a gear, which may, for example, be park (P), reverse (R), neutral (N), drive (D), second gear (2), or first gear (1). Each gear is associated with a respective one of the magnetic field sensors as shown.
The gearshift lever 1000 can have a magnet 1002 disposed on an end thereof nearest to the magnetic field sensors 1004a-1004f. In operation, a magnetic field sensor, e.g., the magnetic field sensor 1004d, senses when the gearshift lever 1000 is at a position of the particular magnetic field sensor, e.g., 1004d, and thus, senses the particular gear associated with the position of the gear shift lever. In this way, the magnetic field sensors 1004a-1004f can provide respective signals to a computer processor or the like, which can electronically/mechanically configure the automobile transmission into the selected gear.
This particular arrangement is shown to point out a potential problem with the arrangements of FIGS. 5, 5A, and 6. In particular, if the magnetic field generated by the magnet 1002 is in the same direction as the magnetic field generated by the self-test conductor 224 of FIGS. 5, 5A, and 6, then the magnetic field generated by the self-test conductor 224 may be overwhelmed by the magnetic field generated by the magnet, resulting in no diagnostic output signal 254a, 254a′ (FIGS. 5, 5A, 6).
In some embodiments, this shortcoming can be overcome merely by selecting the magnetic field generated by the magnet 1002 to be in a direction opposite to the direction of the magnetic field generated by the self-test conductor 224. However, in other embodiments, it may be desirable to have a magnetic field sensor that can select and/or change a direction of the magnetic field generated by the self-test conductor 224. An exemplary arrangement having this ability is shown in FIG. 16.
Referring now to FIG. 16, in which like elements of FIGS. 5, 5A, and 6 are shown having like reference designations, a circuit includes the self-test conductor 224, but arranged in a different way than is shown in other figures. Though shown separately spaced in FIG. 16, it should be understood that, like the embodiments of FIGS. 5, 5A, and 6, the magnetic field sensing element 226 can be proximate to the self-test conductor 224.
Two comparators 1010, 1012 can be coupled to receive the signal 228a from the amplifier 228. The comparator 1010 can also be coupled to receive a comparison signal 1014a representative of a signal from the amplifier 228 when the magnetic field sensing element experiences zero Gauss (or a background magnetic field, e.g., the earth's magnetic field) plus a delta. The comparator 1012 can also be coupled to receive a comparison signal 1014b representative of a signal from the amplifier 228 when the magnetic field sensing element experiences zero Gauss (or a background magnetic field, e.g., the earth's magnetic field) minus a delta.
The comparator 1010 can generate a first comparison signal 1010a, and the comparator 1012 can generate a second comparison signal 1012a. 
A flip-flop (i.e., a latch) 1020 can be coupled to receive the first and second comparison signals 1010a, 1012a, respectively at set and reset inputs and can be configured to generate a first output signal 1020a and a second output signal 1020b. 
A first logic gate, for example, an AND gate 1022, can be coupled to receive the first output signal 1020a, coupled to receive the diagnostic control signal 260a (FIGS. 5, 5A, 6), and configured to generate a control signal 1022a (Control A).
A second logic gate, for example, an AND gate 1024, can be coupled to receive the second output signal 1020b, coupled to receive the diagnostic control signal 260a, and configured to generate a control signal 1024a (Control B).
The self-test conductor 224 can be arranged in the cross arm of an H-bridge surrounded by switches 1026a, 1026b, 1028a, 1028b. The switches 1026a, 1026b are controlled by the first control signal 1022a, and the switches 1028a, 1028b are controlled by the second control signal 1024a. 
Thus, in operation, when the current generator 216 generates the current 218 in response to the diagnostic control signal 260a, the current 218 flows through the self-test conductor 224 in one of two directions determined by the first and second control signals 1022a, 1024a. 
The comparators 1010, 1012 and the flip flop 1020 operate essentially as a window comparator, so that when the magnetic field experienced by the magnetic field sensing element 226 is large in a first direction, the diagnostic current passing through the self-test conductor 224 generates a magnetic field in an opposite second direction (when the diagnostic control signal 260a is also high). Conversely, when the magnetic field experienced by the magnetic field sensing element 226 is large in the second direction, the diagnostic current passing through the self-test conductor 224 is in the opposite first direction (when the diagnostic control signal 260a is also high).
With this arrangement, even in the presence of a fairly large magnetic field in either direction, which tends to saturate the magnetic field sensing element 226, or electronics coupled to the magnetic field sensing element, for example, the amplifier 228, still the self-test signal 218 can generate a magnetic field in the opposite direction, which can propagate to the diagnostic output signal 254, 254a′ of FIGS. 5, 5A, and 6.
It will be apparent that the circuit of FIG. 16 can be incorporated into the circuits of preceding figures.
All references cited herein are hereby incorporated herein by reference in their entirety. Having described preferred embodiments of the invention, it will now become apparent to one of ordinary skill in the art that other embodiments incorporating their concepts may be used. It is felt therefore that these embodiments should not be limited to disclosed embodiments, but rather should be limited only by the spirit and scope of the appended claims.

## Claims

1. A magnetic field sensor, comprising:
a magnetic field sensing element supported by a substrate, the magnetic field sensing element for generating a composite magnetic field signal comprising a measured-magnetic-field-responsive signal portion and a self-test-responsive signal portion, wherein the measured-magnetic-field-responsive signal portion is responsive to a measured magnetic field and the self-test-responsive signal portion is responsive to a self-test magnetic field;
a self-test circuit comprising a self-test current conductor proximate to the magnetic field sensing element, the self-test current conductor for carrying a self-test current to generate the self-test magnetic field, wherein the self-test circuit further comprises a diagnostic request processor configured to control the self test current to be on or off in response to a diagnostic input signal received by the diagnostic request processor or to be indicative of a self test during one or more time periods in response to a control signal generated by the diagnostic request processor; and
a processing circuit coupled to receive a signal representative of the composite magnetic field signal, configured to generate a sensor signal representative of the measured-magnetic field-responsive signal portion, and configured to generate at least one of a diagnostic signal representative of the self-test-responsive signal portion or a composite signal representative of both the measured-magnetic-field-responsive signal portion and the self-test-responsive signal portion.

2. The magnetic field sensor of claim 1, wherein the self-test current conductor comprises a conductor supported by the substrate and proximate to the magnetic field sensing element.

3. The magnetic field sensor of claim 1, wherein the self-test current conductor comprises a conductor supported by the substrate and spanning more than one metal layer supported by the substrate.

4. The magnetic field sensor of claim 1, further comprising a circuit board proximate to the magnetic field sensing element, wherein the self-test current conductor comprises a conductor supported by the circuit board.

5. The magnetic field sensor of claim 4, wherein the self-test current conductor comprises a coil supported by the circuit board and spanning more than one metal layer supported by the circuit board.

6. The magnetic field sensor of claim 1, wherein the self-test current conductor comprises a conductor separate from but proximate to the substrate.

7. The magnetic field sensor of claim 1, further comprising a switching circuit configured to switch a direction of the self-test current and the associated self-test magnetic field in response to a magnitude of the measured magnetic field.

8. The magnetic field sensor of claim 7, further comprising an electromagnetic shield proximate to the self-test current conductor.

9. The magnetic field sensor of claim 8, wherein the electromagnetic shield comprises at least one feature configured to reduce an eddy current in the electromagnetic shield when the shield is exposed to an AC magnetic field.

10. The magnetic field sensor of claim 1, wherein the processing circuit is configured to receive the composite magnetic field signal and configured to generate at least one of the diagnostic signal or the composite signal, wherein the diagnostic signal is responsive to the self-test magnetic field and not responsive to the measured magnetic field, and wherein the composite signal is responsive to both the measured magnetic field and the self-test magnetic field.

11. The magnetic field sensor of claim 10, wherein the processing circuit is further configured to generate the sensor signal, wherein the sensor signal is responsive to the measured magnetic field and not responsive to the self-test magnetic field.

12. The magnetic field sensor of claim 11, further comprising a combining circuit configured to combine a signal representative of the sensor signal with a signal representative of the diagnostic signal to generate a combined output signal.

13. The magnetic field sensor of claim 1, wherein the diagnostic request processor comprises a decoder coupled to receive the diagnostic input signal, configured to decode the diagnostic input signal, and configured to generate a diagnostic control signal to control the self-test current.

14. The magnetic field sensor of claim 13, wherein the self-test circuit further comprises:
a current generator circuit having an output node at which self-test current pulses are generated, wherein the self-test current conductor is coupled to receive the self-test current pulses resulting in the self-test magnetic field having magnetic field pulses.

15. The magnetic field sensor of claim 14, wherein the current generator is configured to generate the self-test current pulses in response to the diagnostic control signal.

16. The magnetic field sensor of claim 13, wherein the diagnostic control signal comprises control pulses, each control pulse resulting in one self-test current pulse from the current generator.

17. The magnetic field sensor of claim 13, wherein the diagnostic control signal comprises control pulses, each control pulse resulting in a plurality of self-test current pulses from the current generator.

18. The magnetic field sensor of claim 13, wherein the diagnostic control signal comprises a first state during which the current generator generates self-test current pulses and a second state during which the current generator does not generate self-test current pulses.

19. The magnetic field sensor of claim 13, wherein the diagnostic control signal comprises first control pulses with a first duty cycle during which the current generator generates self-test current pulses, and wherein the diagnostic control signal comprises second control pulses with a second duty cycle during which the current generator does not generate self-test current pulses.

20. The magnetic field sensor of claim 13, wherein the diagnostic control signal comprises a binary digital word.

21. The magnetic field sensor of claim 13, wherein the processing circuit comprises a track-and-hold circuit having an input node, and output node, and a control node, wherein the track-and-hold circuit is coupled to receive a signal representative of the composite signal at the input node, coupled to receive a signal representative of the diagnostic control signal at the control node, and configured to generate a signal representative of the sensor signal at the output node.

22. The magnetic field sensor of claim 1, further comprising a diagnostic output formatting circuit coupled to receive the diagnostic signal and configured to generate a diagnostic output signal representative of the diagnostic signal, wherein the diagnostic output signal comprises a pulse indicative of a properly functioning magnetic field sensor.

23. The magnetic field sensor of claim 1, further comprising a diagnostic output formatting circuit coupled to receive the diagnostic signal and configured to generate a diagnostic output signal representative of the diagnostic signal, wherein the diagnostic output signal comprises a state indicative of a properly functioning magnetic field sensor.

24. The magnetic field sensor of claim 1, further comprising a diagnostic output formatting circuit coupled to receive the diagnostic signal and configured to generate a diagnostic output signal representative of the diagnostic signal, wherein the diagnostic output signal comprises a predetermined duty cycle indicative of a properly functioning magnetic field sensor.

25. The magnetic field sensor of claim 1, further comprising a diagnostic output formatting circuit coupled to receive the diagnostic signal and configured to generate a diagnostic output signal representative of the diagnostic signal, wherein the diagnostic output signal comprises a binary digital word indicative of a properly functioning magnetic field sensor.

26. The magnetic field sensor of claim 1, further comprising a sensor output formatting circuit coupled to receive the sensor signal and configured to generate a sensor output signal representative of the sensor signal, wherein the sensor output signal comprises a two state non-linear signal responsive to the measured magnetic field.

27. The magnetic field sensor of claim 1, further comprising a sensor output formatting circuit coupled to receive the sensor signal and configured to generate a sensor output signal representative of the sensor signal, wherein the sensor output signal comprises a continuous linear signal responsive to the measured magnetic field.

28. The magnetic field sensor of claim 1, further comprising an electromagnetic shield proximate to the self-test current conductor.

29. The magnetic field sensor of claim 28, wherein the electromagnetic shield comprises at least one feature configured to reduce an eddy current in the electromagnetic shield when the shield is exposed to an AC magnetic field.

30. The magnetic field sensor of claim 1, wherein the measured magnetic field is generated by a current carried by a measured-current conductor.

31. The magnetic field sensor of claim 1, further comprising a lead frame comprising a plurality of leads and a coupling of at least two of the leads proximate to the magnetic field sensor, wherein the measured-current conductor comprises the coupling of the at least two of the leads.

32. The magnetic field sensor of claim 1, wherein the self-test circuit further comprises:
a clock generator configured to generate a clock signal;
a diagnostic clock generator coupled to receive the clock signal and configured to generate a diagnostic clock signal; and
a pulse generator coupled to receive the diagnostic clock signal and configured to generate a pulse signal in response to the diagnostic clock signal, wherein the current generator is coupled to receive the pulse signal and configured to generate the self-test current in response to the pulse signal.

33. The magnetic field sensor of claim 1, wherein the magnetic field sensing element comprises a Hall effect element, wherein the magnetic field sensor further comprises a current or voltage generator coupled to the Hall effect element.

34. The magnetic field sensor of claim 1, wherein the magnetic field sensing element comprises a magnetoresistance element, wherein the magnetic field sensor further comprises a current generator coupled to the magnetoresistance element.

35. The magnetic field sensor of claim 1, further comprising an electronic switch coupled across the self-test current conductor.

36. The magnetic field sensor of claim 1, wherein the processing circuit comprises:
a comparator coupled to receive a signal representative of the composite magnetic field signal, coupled to receive a threshold signal, and configured to generate a non-linear output signal; and
a logic circuit configured to generate the threshold signal having a value dynamically selected from among four different threshold signal values.

37. A method of generating a self-test of a magnetic field sensor, comprising:
generating, with a magnetic field sensing element, a composite magnetic field signal comprising a measured-magnetic-field-responsive signal portion and a self-test-responsive signal portion, wherein the measured-magnetic-field-responsive signal portion is responsive to a measured magnetic field and the self-test-responsive signal portion is responsive to a self-test magnetic field;
controlling a self-test current in a self-test current conductor proximate to the magnetic field sensing element to be on or off in response to a diagnostic input signal received by the diagnostic request processor or to be indicative of as self test during one or more time periods in response to a control signal generated by the diagnostic request processor, the self-test current conductor for carrying the self-test current to generate the self-test magnetic field;
generating a sensor output signal representative of the measured-magnetic-field-responsive signal portion; and
generating at least one of a diagnostic signal representative of the self-test-responsive signal portion or a composite signal representative of both the measured-magnetic-field-responsive signal portion and the self-test-responsive signal portion.

38. The method of claim 37, wherein the self-test current conductor comprises a conductor supported by the substrate and proximate to the magnetic field sensing element.

39. The method of claim 37, wherein the self-test current conductor comprises a coil supported by the substrate and spanning more than one metal layer supported by the substrate.

40. The magnetic field sensor of claim 37, switching a direction of the self-test current and the associated self-test magnetic field in response to a magnitude of the measured magnetic field.

41. The method of claim 40, further comprising electromagnetically shielding the self-test current conductor.

42. The method of claim 37, further comprising electromagnetically shielding the self-test current conductor.

43. The magnetic field sensor of claim 1, wherein the one or more time periods comprises a time period beginning with a power-on of the magnetic field sensor and terminating a predetermined time thereafter.

44. The magnetic field sensor of claim 1, wherein the diagnostic request processor comprises an internal diagnostic clock generator configured to generate the control signal to control the self test current to comprise a group of current pulses during the one or more time periods.

45. The method of claim 37, wherein the one or more time periods comprises a time period beginning with a power-on of the magnetic field sensor and terminating a predetermined time thereafter.

46. The method of claim 37, wherein the controlling the self-test current in response to the control signal comprises:
controlling, in response to an internal control signal, the self-test current to comprise a group of current pulses during the one or more time periods.