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 CCS Technical Support

Can't set_comparators or setup_vref PIC16F506 PCW 3.236

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



Joined: 27 Feb 2013
Posts: 1

View user's profile Send private message

Can't set_comparators or setup_vref PIC16F506 PCW 3.236
PostPosted: Wed Feb 27, 2013 12:26 pm     Reply with quote

program will compile as shown.
Using PCW ver 3.236

If I uncomment set_comparators I get error message 'Unidentified Identifier -- setup_comparator'

If I uncomment setup_vref I get error message 'Unidefined Identifier -- setup_vref'

Code:
#include <16F506.H>
#fuses NOMCLR
#fuses NOPROTECT
#fuses NOWDT
#fuses INTRC_IO
#fuses IOSC4
#device adc=8
#use delay (clock=4000000)
 
void main()
{
 
 //setup_comparator(NC_NC_NC_NC);
 
 //setup_vref(FALSE);

  setup_adc(ADC_CLOCK_INTERNAL);
  setup_adc_ports(AN2);
  set_adc_channel(2);

 }
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Wed Feb 27, 2013 3:47 pm     Reply with quote

3.236, is too old.

The 16F506, was only added to the data library at about this point. The chip setup had the variable for setup_comparators, as NC_NC, not NC_NC_NC_NC. Vref control values weren't added till the version 4 compilers.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 27, 2013 4:42 pm     Reply with quote

PCB vs. 4.073 is included with vs. 8.xx of the MPLAB IDE. I don't know if
it's included with MPLAB X, because I've never downloaded MPLAB X.

But anyway, when installing MPLAB vs. 8.xx, you will be given a chance
to select which features you want to install. Just look in the "Third Party"
section and select the CCS PCB compiler. You'll get vs. 4.073 installed
and it will compile those two lines correctly for the 16F506. I just checked.
The PCB compiler is installed in this directory:
c:\Program Files\Microchip\Third Party\PICC\
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