View previous topic :: View next topic |
Author |
Message |
jackmackeral
Joined: 27 Feb 2013 Posts: 1
|
Can't set_comparators or setup_vref PIC16F506 PCW 3.236 |
Posted: Wed Feb 27, 2013 12:26 pm |
|
|
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: 19546
|
|
Posted: Wed Feb 27, 2013 3:47 pm |
|
|
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
|
|
Posted: Wed Feb 27, 2013 4:42 pm |
|
|
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\ |
|
|
|