CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

16f688 problem with comparators

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
drdelphi



Joined: 22 Apr 2007
Posts: 22
Location: Romania

View user's profile Send private message Yahoo Messenger

16f688 problem with comparators
PostPosted: Wed Sep 17, 2008 9:49 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Sep 17, 2008 12:14 pm     Reply with quote

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

View user's profile Send private message Yahoo Messenger

PostPosted: Wed Sep 17, 2008 11:27 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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