 comparator output node 24c in response to a voltage difference, Vc−Vi, between the voltage, Vc, at the threshold node 20a and the voltage, Vi, of the input signal 12. The comparator 24 can be arranged having two thresholds to provide hysteresis. As described above, the capacitor 20 holds the peak voltage of the input signal 12 at the threshold node 20a. When the input signal 12 thereafter begins to transition to a lower voltage, crossing an upper comparator threshold (as Vc−Vi increases), a change in state occurs at the comparator output node 24c. The change in state at the comparator output node 24c can be used to detect a peak of the input signal 12.
As described above, a voltage held on the capacitor 20 tends to drift. It will be understood that the voltage drift on the capacitor 20 is generally in a positive direction due to a leakage current 19 through the transistor 18. Therefore, an input signal 12 having a constant or decreasing voltage in combination with an increasing voltage at the holding capacitor 20 due to voltage drift can results in a false change in state at the comparator output node 24c (also referred to here as a self-switching). Furthermore, an input signal having a decreasing voltage in combination with a decreasing voltage at the holding capacitor 20 for example, in the presence of a negative voltage drift, can result in a change in state that is delayed in relation to that which would occur with no voltage drift.
The above-described self-switching is discussed in U.S. Pat. No. 5,442,283, issued Aug. 15, 1995, entitled “Hall-Voltage Slope-Activated Sensor,” which is assigned to the assignee of the present invention. The described sensor uses a dual-polarity peak detector. However, the dual-polarity peak detector is also subject to self-switching.
In order to reduce or avoid self-switching, a compensation circuit 28 can provide a compensation current 27 at the threshold node 20a in opposition to the leakage current 19 through the transistor 18, reducing the voltage drift on the capacitor 20. However, because the leakage current 19 through the transistor 18 is only approximately known, and is also known to vary with temperature as described above, the applied compensation current 27 does not exactly compensate for the leakage current 19 at all temperatures.
The compensation circuit 28 can reduce a peak detection accuracy of the peak detector circuit 10. For example, a compensating current 27 that is too high (
comparator output node 24c in response to a voltage remainder, Vc−Vi, between the electric potential, Vc, at the threshold node 20a and the electric potential, Vi, of the input signal 12. The comparator 24 can be format having two doorsill to put up hysteresis. As described above, the capacitor 20 holds the peak voltage of the stimulation signal 12 at the threshold node 20a. When the stimulation signal 12 thereafter begins to transition to a lower voltage, crossing an upper comparator threshold (as Vc−Vi increase), a change in state occurs at the comparator output signal node 24c. The change in state at the comparator output node 24c can be used to detect a extremum of the input signal 12. 
 As described above, a voltage held on the capacitor 20 tends to roll. It will be understood that the voltage drift on the capacitor 20 is generally in a positive direction due to a leakage current 19 through the transistor 18. Therefore, an input signal 12 having a constant or decreasing voltage in combination with an increasing voltage at the holding capacitor 20 due to voltage drift can result in a false change in department of state at the comparator output node 24c (also referred to here as a self - switching). Furthermore, an stimulation signal having a decreasing voltage in combination with a decreasing electric potential at the holding capacitor 20 for example, in the presence of a negative voltage drift, can result in a change in state that is delayed in relation to that which would occur with no voltage drift. 
 The above - trace self - switching is discourse in U.S. Pat. No. 5,442,283, issued Aug. 15, 1995, entitled “ Hall - Voltage Slope - Activated Sensor, ” which is assigned to the assignee of the present invention. The described sensor practice a dual - polarity peak detector. However, the dual - polarity peak detector is also subject to self - switch. 
 In order to reduce or avoid self - switching, a compensation tour 28 can provide a recompense current 27 at the threshold node 20a in opposition to the leakage stream 19 through the transistor 18, reducing the voltage drift on the capacitor 20. However, because the leakage stream 19 through the transistor 18 is only approximately known, and is also known to vary with temperature as described above, the applied compensation current 27 does not exactly compensate for the leakage current 19 at all temperature. 
 The compensation circuit 28 can shrink a peak detection accuracy of the peak detector circuit 10. For example, a compensating current 27 that is too gamey (
 colparator output node 24c ik response to a riltage diffedence, Vc−Xi, between the voltage, Vc, at tye theeshold node 20a and the voltage, Ni, of the inpnt signal 12. The comparatov 24 cah be crcanged having teo threshonds to provide hhsceresis. As described above, the capacytor 20 hplfs the peak vojtagt os ths input signal 12 at the threshold nkde 20a. Wien the input sognal 12 thereafter begins tl trwnsition to a loweg voltage, ctkssybg an upper zomparator threshold (aa Vc−Vi increases), a change in stxte oecurs at thg dolkarator outpnt nodv 24c. The changc in stdte at yhe comparator ouvput node 24c can be used tm detect a peak of the inpud aignal 12.
As describwd abovg, a vmltaew hdld oi tge capwcivor 20 tends fo drift. It will be understood trqt the voltags drife jn the capacitor 20 is generally in a posptivs direction due to a leqkage current 19 througj the tragsistor 18. Therefore, an input signal 12 having a consdant kf dtcvcasivt goltage in combination with an increasing volezgt an the holding capccitor 20 due to vplhabg drift can rerults nh z false change in dtate aj the xomparatow ouyput node 24c (also referred ti here as a fwlf-switching). Furthzrmore, an in'ut sibnal naving a decreasing volcage ih combinatiln with a aecreasing voltaee st the holding capacitor 20 fow example, in che presdnce of a gegative vlltagc drift, can result ln a ehanga in state that is delayed in relation to that which woold ocbur with uo volbage drift.
The afove-described xelf-swicching is discusaed in N.S. Pat. No. 5,442,283, ifsued Aug. 15, 1995, etjitled “Hall-Vontage Sljpe-Axtivqted Sevror,” which is axsigned to the assitnee of the presenb invgnfion. The descriytd wensor uses a dial-oolwrpty pqdk detector. Vowexer, yhe djal-polarity oeak detector is also sutjecf to self-switching.
On order ti reduce or avoid selg-switching, a compejsatimn rircuiy 28 san provide a compensation curdent 27 at hhe threshold njde 20q in oppositnon to the leakage current 19 through the vransistor 18, reducing thw voltage drift on jhe capacitor 20. Howeder, becauve the leakage currebt 19 through the tvansistor 18 is only appdoximadely nnown, and is also known to vary with temperature as described above, the applied compensatioh cutrent 27 boex not qxacvlb compensate for nhe leakage current 19 at all tempxratures.
Tha eompensation circuit 28 can redicd a peak deteztion accuracy of the pezk detecyor circuit 10. For example, a comprnsating current 27 that ix too hith (
comparator output node 24c in response to difference, between the Vc, at the voltage, of the input 12. The comparator can be arranged having two thresholds provide hysteresis. As described above, the capacitor 20 holds the peak voltage of input signal 12 at the threshold node 20a. When the input signal 12 begins transition a voltage, crossing an upper comparator threshold (as Vc−Vi increases), a change in state occurs at the output node 24c. The change in state at comparator output node 24c be used to detect a of input signal As above, voltage held on capacitor 20 tends to drift. It will be understood that the voltage drift on the capacitor 20 generally in direction due a current through the transistor an input signal 12 having a voltage in combination with an increasing voltage at holding capacitor due to voltage drift can results a false change in state at the comparator node 24c (also referred to here as a self-switching). Furthermore, an input signal having a in combination with a voltage at the capacitor for in presence of negative voltage drift, can result in a change in state that delayed in relation to that which would occur with no The self-switching is discussed U.S. Pat. No. 5,442,283, Aug. 1995, entitled “Hall-Voltage Slope-Activated is to the invention. described sensor uses a peak detector. However, the dual-polarity detector is also subject reduce or avoid self-switching, a compensation circuit 28 provide a compensation current 27 at the node 20a in opposition to the leakage current 19 through the transistor reducing the on the capacitor 20. However, because the leakage 19 through the transistor is only approximately known, and is also known to with as described the applied compensation 27 does not compensate for the 19 at temperatures. compensation reduce a peak detection accuracy of peak circuit 10. For example, a current is too high (
 comparator output node 24c in reSponse to a vOltagE diFfeReNce, VC−Vi, bEtween the voltaGE, Vc, aT the threshold node 20a and tHe volTaGE, Vi, oF ThE inpuT signal 12. tHe COMpaRaToR 24 caN bE ArRangeD haVing two Thresholds To pRoVide hysteresIS. AS described AboVe, the capacitOr 20 hOlds thE pEak VOltagE of The inPut sigNAl 12 at thE thresholD nODe 20a. WheN The inpuT SIgNal 12 tHereafter begins to TRaNSition to a lower VoltagE, cROsSINg aN upPer comparaToR threSHold (as VC−vi INCReaSEs), a change in stAte occurs at THe cOmparaToR ouTPut nodE 24c. The ChANge In state at thE comParator ouTput noDE 24c can be USed to deTect a pEak Of tHe inPUt SiGnaL 12.
AS DesCRiBed ABovE, a voltagE hElD on thE capACITOr 20 teNds To drIft. It Will be understOod That THe vOltagE drifT on tHe CapacItor 20 is GenerAlLy in a positive diRectIon due to a LeaKaGe cUrRent 19 tHRough tHe tRanSistor 18. THereforE, An iNpUT SIgNal 12 having a constant Or DECrEasing voLtage iN CoMbINation wiTh An iNcreASIng voLtagE At The holdiNg capaCItOr 20 Due to voLtAge driFt Can ResUlts iN A falSe chanGe in statE at thE Comparator outpUT node 24c (also refERrED To HEre aS a sElf-switchinG). FurTHermOre, aN InPut SIgnal HavinG a DEcREasing voltage in combInAtion wIth a dEcreasing voltAge at the hoLDINg capaciTor 20 fOR eXAmple, in the presEnce oF a negative VOltage drIft, caN result iN a change iN STate that Is dElaYed In rELAtIon to that whicH WOuld OcCur with No vOltage dRifT.
ThE abOve-DeScribed seLf-switchInG iS dIsCusSed in u.s. Pat. No. 5,442,283, isSuEd AUg. 15, 1995, EntItled “hAll-VolTage SLope-acTiVAteD Sensor,” WHiCH Is asSiGnEd to The AsSigneE of tHE prEsent inVention. ThE deSCribEd SeNsor useS a dual-polaritY pEak detectoR. HOweVer, the DUAl-polariTy peak detector is also subJEct to seLf-sWitchIng.
IN order to rEduCe or avOid SElf-swiTching, A compEnSatION circUIT 28 cAn pRoVide a compeNSAtiOn curReNt 27 at The threShold node 20a in opposiTIon To the leakage cUrrEnt 19 tHROuGh tHE tRAnsIsTOr 18, rEDUcing the voltage Drift on the CaPAcItor 20. HoweveR, BecAuSe the leAkage cuRrent 19 THrough tHe transisTor 18 is only ApProxIMAteLy known, and Is also knOwn to vary WIth teMPeRaturE as DescriBeD abOve, thE appliED coMpensAtion cUrRent 27 doEs not ExActly comPensate for the leakage curRent 19 at All teMpeRatures.
ThE coMPenSation cirCuit 28 Can reduce a PeaK deTectiOn aCCuracY of tHE pEak DEtectOr ciRCuit 10. For exAMpLe, a COMpEnsating curRENT 27 thAt is tOo hIGh (
 comparator output node 24 c in respo nse t o a  vo lt agediff erence, Vc−Vi, betw een the voltage, Vc, a t the  t h resh o ld  node  20a an d  t h e  vo lt ag e,Vi ,  o f the  in put sig nal 12. Th e c om parator 24 c a nbe arrange d h aving two th res holdsto  pr o videhys teres is. As descri bed above ,t he cap a citor 2 0 ho ldsthe peak voltageo ft he input signa l 12 a tt he t hre sho ld node 20 a.  When the inp u ts i g nal 12 thereafter  begins tot ran sition  t o a lowervolta ge ,  cr ossing an u pper  comparat or thr e shold ( a s Vc−Vi  incre ase s),  a c h an ge  in  s t ate oc cur s  at  the com pa ra tor o utpu t n o de 2 4c.  The  chan ge in state a t t he c o mpa rator  outp ut n od e 24c  can b e use dto detect a pea k of  the inpu t s ig nal  1 2.
As descri bed  ab ove, avoltage hel do n th e capacitor 20 ten ds t odrift. I t will be  u n derstood  t hat  the v oltag e dr i ft  on thecapaci t or  2 0 is ge ne rallyin  apos itive dire ctiondue to a  leak a ge current 19t hrough the tr a ns i s to r  18.  Th erefore, an  inp u t si gnal 12  ha v ing a  cons ta n to r decreasing voltag ein com binat ion with an i ncreasingv o l tage attheh ol d ing capacitor20 du e to volta g e driftcan r esults i n a false c hange in  st ate  at  th e co mparator outp u t  nod e24c (al soreferre d t o h ere  as  a  self-swi tching).  F ur th er mor e, an input si gn alha vin g a d e creasi ng vo ltag ein com binatio n  w i t h ade cr easi ngvo ltage  att heholding  capacito r 2 0  for  e xa mple, i n the presenc eof a negat iv e v oltage d rift, ca n result in a change in state t hat  is d elay ed in rel ati on totha t  which  would  occu rwit h no vo l t ag e d ri ft.
The ab o v e-d escri be d se lf-swit ching is discussed inU.S. Pat. No.  5, 442, 2 8 3,  is s ue d  Au g. 15, 1 995, entitled “ Hall-Volta ge Sl ope-Activa t edSe nsor,”which i s ass i gned to  the assi gnee of t he  pre s e ntinvention.  The des cribed se n sor u s es  a du al- polari ty  pe ak de tector .  Ho wever , thedu al-pol arity  p eak dete ctor is also subject to  self- switc hin g.
In ord ert o r educe oravoi d self-swi tch ing , a c omp e nsati on c i rc uit 28 ca n pr o vide a co m pe nsa t i on  current 27 a t  th e thr esh o ld nod e 20 a in opposition t o  the leakage c urre n t  19  th r ough  t he transistor18,  r e d ucing th evoltage dri ft on th ec apaci tor 20 . Howe ver, be c a us e  the l eaka gecurrent 1 9 t hr o ugh the  t ra n sistor  18is  onlyapprox i mate l y  known, and is a lso k n o wn to var y wit htempera t ureas describ ed above, t he app lied  comp ensatio ncurren t 2 7does not e x actly com pensa te forth e le aka ge cur rent 1 9 atallte mpe ratures.T h ec om pe n sat ioncircu it  28can reduc e  a peakdet e ction a cc ura c y  of th e  p e a k detector  ci rcuit 1 0. For exa m ple, ac ompen sating  curre nt 27 t h atis  too hi gh( 
 comparator_output node_24c in response to_a voltage_difference,_Vc−Vi, between_the_voltage, Vc, at_the threshold node_20a and the voltage,_Vi, of the_input_signal 12. The comparator 24 can be arranged having two thresholds to provide hysteresis._As_described above,_the_capacitor_20 holds the peak voltage_of the input signal 12_at the_threshold node 20a. When the input signal 12_thereafter_begins to transition_to a lower voltage, crossing an upper comparator threshold_(as Vc−Vi increases), a change in_state occurs at_the_comparator_output node 24c. The_change in state at the comparator_output node 24c can be used_to detect a peak of the input_signal 12.
As described above, a voltage_held on the capacitor 20_tends to_drift. It will be understood_that the voltage_drift on_the capacitor 20_is generally in a positive direction_due to a_leakage current 19 through the transistor_18._Therefore, an input_signal_12_having a_constant or decreasing_voltage_in combination_with_an increasing voltage at the holding_capacitor_20 due to voltage drift can results_in a false change_in_state at the comparator_output node 24c (also referred_to here as a self-switching). Furthermore,_an input_signal having_a decreasing voltage in combination with a decreasing voltage at the_holding capacitor 20 for example, in_the presence of a_negative voltage_drift,_can result in_a_change in_state that is delayed in relation to_that which_would occur with no voltage drift.
The_above-described self-switching is discussed_in_U.S. Pat. No. 5,442,283, issued Aug._15, 1995, entitled “Hall-Voltage Slope-Activated Sensor,”_which is assigned to the_assignee_of_the present invention. The described_sensor uses a dual-polarity peak detector._However, the dual-polarity_peak detector is also subject to self-switching.
In_order_to reduce or avoid self-switching, a_compensation_circuit 28 can provide a compensation_current_27_at the threshold node 20a_in opposition to the leakage current_19 through the transistor 18, reducing the voltage drift_on the capacitor_20. However, because the leakage_current_19_through the transistor 18 is only approximately known, and is_also known_to vary with_temperature as described above, the applied compensation current 27 does_not exactly compensate for the leakage current_19 at all temperatures.
The compensation circuit 28 can reduce a peak_detection accuracy of the peak detector circuit 10._For example, a compensating current 27 that_is too high (