PDA

View Full Version : Comparator question



Christopher4187
- 1st August 2013, 15:21
I've never used a comparator on a PIC before so I had some questions before I dove into it. This is in reference to an 18F87J50.

1. The comparator module can have a different reference than the reference I use to power the board. In other words, I can power the board with 2 AA batteries and then measure the voltage on a separate AA battery that is only connected to pin 15 (negative) and pin 18 (positive).

2. I supply the point at which I want the comparator to trigger to pin 14. So if I want the comparator to trigger at 1.3V then use something like a voltage divider and put 1.3V on pin 14.

3. If needed, I could also use AVdd/AVss or VRef+/VRef- for the comparator module.

Are these statements correct? The main issue I'm having is that the voltage I need to measure does not use the same reference as the power supply for the PIC. The final design will use AVdd/AVss but I need to get something going now and can't reconfigure the PCB.

kellyseye
- 2nd August 2013, 12:04
Providing the reference and measured voltages have a COMMON return (negative) it doesn't matter what you use for the voltages.