View previous topic :: View next topic |
Author |
Message |
elellilrah
Joined: 29 Aug 2007 Posts: 14
|
Comparator setup for Microchip 16F684 |
Posted: Wed Aug 29, 2007 5:19 pm |
|
|
Hello,
What is the correct hex number to set up the comparators on the Microchip 16F684 using A1 and A0 in the off state and using C1 - C0 with the output C2OUT? The mode from the data sheet is:
CM<2:0> = 101.
The code generated from the supplied 16F684.h file does not have this option. When I use the PIC Project Wizard, the code generated defaults to:
setup_comparator(NC_NC).
Thanks!
P.S. Also, if anyone can supply what the different nibbles in the 0xnnnnn hex number represent in the setup_comparator() function, that would be even better because the 16F684.h file only seems to have a few of the possible modes. |
|
|
dyeatman
Joined: 06 Sep 2003 Posts: 1934 Location: Norman, OK
|
|
Posted: Wed Aug 29, 2007 5:52 pm |
|
|
What version are you using?
Version 4.053 works with no problems.
setup_comparator(NC_NC_C1_C0);
In the header file:
#define NC_NC_C1_C0 0x10FF05 |
|
|
elellilrah
Joined: 29 Aug 2007 Posts: 14
|
|
Posted: Wed Aug 29, 2007 6:00 pm |
|
|
I am using 3.241 and those files don't have that information in there. I will try your hex code in there and see if it works.
Thanks! |
|
|
elellilrah
Joined: 29 Aug 2007 Posts: 14
|
|
Posted: Thu Aug 30, 2007 1:18 pm |
|
|
The op-code you provided worked perfectly, thank you.
I need to find a more recent copy of the full 16F684.h file as it must have several changes in it. |
|
|
|