|
|
View previous topic :: View next topic |
Author |
Message |
danielz85
Joined: 22 Sep 2012 Posts: 37
|
comparator basic understanding. |
Posted: Tue Oct 30, 2012 3:24 am |
|
|
Hi
We are using the pickit2 with pic16f690.
We use the internal comparator to call the interrupt routine.
We set the comparator positive pin(+) to be Vref .
We input some voltages in the negative pin(-) which is RC2 pin.
We can't understand the way this comparator works , and the data sheet doesn't say anything but "when comparator change its value=interrupt"
1. can we input negative voltages to the negative pin of comparator? like measuring a pure sin wave ? (it is working perfect but not sure if its ok).
2. if we set the Vref to be 1v, it has interrupt right when we turn the pic on, and if we set it to be lower than 1v, its not happening :
how is it work ? interrupt is happen only when there is a change that is bigger than 1v ?
3. when Vref is 0.4v , and v- is (-0.6v) we have an interrupt each time we input the -0.6 and also when we take it out. what is that ?
We can't understand, what is the rules, the exact rules for the comparator to turn the interrupt ? who has to be bigger ? can it be negative ?
Thanks a lot. |
|
|
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Tue Oct 30, 2012 8:11 am |
|
|
Quote: | 1. can we input negative voltages to the negative pin of comparator? like measuring a pure sin wave ? (it is working perfect but not sure if its ok)
2. if we set the Vref to be 1v , it has interrupt right when we turn the pic on, and if we set it to be lower than 1v , its not happening :
how is it work ? interrupt is happen only when there is a change that is bigger than 1v ?
3. when vref is 0.4v , and v- is (-0.6v) we have an interrupt each time we input the -0.6 and also when we take it out . what is that ?
We cant understand, what is the rules, the exact rules for the comparator to turn the interrupt ? who has to be bigger ? can it be negative ? | Most of the answers ARE in the data sheet.
1) Do NOT apply voltages beyond the supply rails.
2) The common mode range is 0 to VDD - 1.5V. I would expect normal operation anywhere within that range. The offset is +/- 10mV at worst, so has to be allowed for.
3) Do not take an input to -0.6V. You are at risk of latch up, and other nasties.
The manual explains when interrupts occur. You can watch the output of the comparator, it's available on a pin. You can then watch what happens as you apply voltages to the input pins. In normal mode the output moves in the same direction as the V+ input pin and in the opposite direction to the V- input pin.
Mike |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|