2 voltages compare to Vref & interrupt

Thread Starter

oookey

Joined May 24, 2010
70
Hi ,

Please refer to the sketch for the circuit arrangement, I tried to compare two voltages Vin1 and Vin2, whichever greater than Vref (0.4V), will trigger interrupt to stop output, if both voltages lower than Vref interrupt will start output again.

I’m using 16f628A mikroC compiler, any suggestions how I should configure the chip to have 0.4V reference, and what other registers that involve in this task? Thanks
 

Attachments

ErnieM

Joined Apr 24, 2011
8,377
That looks like the comparator setting I would use.

For a full listing of register settings see:
TABLE 10-1: REGISTERS ASSOCIATED WITH COMPARATOR MODULE
TABLE 11-1: REGISTERS ASSOCIATED WITH VOLTAGE REFERENCE
 
Top