Or simply Above_Threshold = CM1CON0.6 or you may not even need a "mirror" of the output, instead of using Above_Threshold in your main application simply use CM1CON0.6 directly.
On the other hand, if all the interrupt is really doing is to "copy" the state of the comparator output then there's really no need to use the interrupt at all - simply read the comparator output directly in your code.
If you want you can even create an alias, like:
Above_Threshold VAR CM1CON0.6
Now, when you use Above_Threshold in your program you are actually reading the comparator output.
/Henrik.




Bookmarks