Hi,
First of all you need to configure your comparator modes through the CMCON register.
Syntax : CMCON = %0x0xxxxx
You would find the details from the datasheet about the different modes. Now if you are using the internal reference for your comparator then you need to setup the VRCON register to specify the reference voltage. Same way VRCON =
Now in your application you need to poll the Comparator Output bit CMCON.6 for the comparator status. If you need interrupts then you need to setup the peripheral interrupt registers as well along with the PIE bit in the INTCON. Any change in the comparator status causes an interrupt.
Regards
Sougata
see post #3 here for possible help
http://www.picbasic.co.uk/forum/show...2459#post62459
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Thanks a lot. I'll try to read the links provided and write the commands that you all had provided. Will come back if I face any problems.
Thanks again..![]()
Bookmarks