I might as well use a external op-amp and let it compare the signal to the reference. Using no feedback to adjust amplification I should get a nice TTL out. I only need to find a small footprint op-amp that will take TTL powering and still allow 16v input :) It would free up a lot of ports too as all comparators can be disabled. KreAture ----- Original Message ----- From: "Dave Dilatush" To: Sent: Sunday, June 22, 2003 9:30 PM Subject: Re: [PIC]: Behaviour of PIC16F62x with over-voltage on comparator? > (Re-sent with attachment this time...) > > Kyrre Aalerud wrote... > > >Problem is: > > > >FET off = 16 Volts. > >FET on = 0-70 mV. > > > >I need to compare the voltage when FET is on to a set reference of 70 mV. > >If Voltage across FET is abowe 70mV I have a over-current condition and > >should turn FET off. > > 70 mV is pretty small for the PIC's comparator to deal with, and > 16V is way too large for its inputs to tolerate. The attached > circuit will fix both problems: diode D1 clamps the voltage from > the FET to protect the opamp while R1 limits the current drawn > from the FET to less than a milliamp, and the opamp amplifies the > FET's VDS(ON) by a factor of 48, giving you about 3.5 volts at > the PIC's input. > > Dave D. > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.