View previous topic :: View next topic |
Author |
Message |
drdelphi
Joined: 22 Apr 2007 Posts: 22 Location: Romania
|
16f688 problem with comparators |
Posted: Wed Sep 17, 2008 9:49 am |
|
|
Hey
I'm using PCWHD 4.078 and trying to make the first comparator on a 16f688 compare A1 with the internal vref.
In 16f688.h file supplied by CCS, I found:
#define A1_VR_OUT_ON_A2 0x6fb03
#define A1_VR 0x2ff04
The last byte isn't supposed to be the CMCON0 (19h) register ? In the datasheet, it says that only 0x02 sets the internal vref as the compare Vin+.
Also, there are not defines for the second comparator ... not that I would need it, but I find it weird.
Is the define file wrong or am I missing something ?
Thanks in advance. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Sep 17, 2008 12:14 pm |
|
|
I think the 16F688.H file is incorrect. The comparators in the 16F688 are
similar to the 16F684. The 16F684.H file has definitions that look
more correct. You could try using those #define statements instead.
You should email CCS tech support about this bug. The bug also exists
in compiler vs. 4.079. |
|
|
drdelphi
Joined: 22 Apr 2007 Posts: 22 Location: Romania
|
|
Posted: Wed Sep 17, 2008 11:27 pm |
|
|
thank you for your quick reply.
however, I can't put together all I want in this lousy pic. I need TIMER0, TIMER1, COMP, hardware UART, adc, a led and dataflash.
when I make one of them to work, another one stops working. the uart works only when it wants. the comparators act like crazy, pin_a4 seems to work only as input, I cannot enable only one comparator with internal vref, so one pin is lost for the second comparator which is useless.
still 18F...'s dimensions are too big for my needs.
well, thanks again and wish you all the best |
|
|
|