Patent ID: 7923996

Claim:
A magnetic field sensor, comprising: a magnetic field sensing element supported by a substrate, the magnetic field sensing element for generating an output signal comprising a magnetic-field-responsive signal portion, wherein the magnetic-field-responsive signal portion has a sensitivity to a first magnetic field; a feedback circuit, comprising: a current conductor supported by the substrate and proximate to the magnetic field sensing element, the current conductor for generating a second magnetic field; and a gain-calculation circuit configured to generate a gain-calculated signal and a gain-adjustment signal both responsive to the second magnetic field, wherein the gain-calculation circuit comprises a sample-and-hold circuit configured to sample and hold the gain-calculated signal in response to an enable signal to generate the gain-adjustment signal; and a gain-adjustment circuit supported by the substrate and having a gain-adjustment node coupled to receive the gain-adjustment signal, wherein the gain-adjustment circuit is configured to adjust the sensitivity of the magnetic-field-responsive signal portion in response to the gain-adjustment signal.