I tried that but i keep getting compile errors on all 3 lines saying "Symbol not previously defined"
Edit: Ive had a look in the datasheet and it seems they should exist. Im not sure why im getting an error. The correct chip is selected
I tried that but i keep getting compile errors on all 3 lines saying "Symbol not previously defined"
Edit: Ive had a look in the datasheet and it seems they should exist. Im not sure why im getting an error. The correct chip is selected
Last edited by The Master; - 27th September 2009 at 12:24.
Just quickly tried to compile your example with v2.46 without error.
It would suggest that if these three lines...
CMCON=7
CVRCON=0
CCP1CON=0
...are causing you problems, then you have NOT got the correct chip selected somewhere...
And it goes to say that you have default Analog functions still enabled on your PIC.
It's always a good idea to EXPLICITY define the start of your program with the chips CONFIG parameters along with the chip you are using... example...
...because if, further down the line, you inadvertantly start to compile for the wrong chip, you end up with a whole heap of errors pointing you to the fact that you've done something wrong (or have the wrong chip selected somewhere).Code:@ DEVICE pic10F206, WDT_OFF ' Watchdog Timer Disabled @ DEVICE pic10F206, MCLR_OFF ' Master Clear Options Internal @ DEVICE pic10F206, PROTECT_OFF ' Code Protection Disabled
I never got the fuses to work from within the code. It seems like theres a few ways of doing it and i never found the right one. I did read an example somewhere that said to change an include file. Heres the line in that file
__config _CONFIG1, _HS_OSC & _WDT_OFF & _LVP_OFF & _CP_OFF
CMCON, CVRCON and CCP1CON are working fine. The 3 that dont work are ADCON0, ADCON1, and ANSEL. The datasheet says they should exist and i found them defined in PIC14EXT.BAS which aparently gets included for the PIC16F87. As you can see from my code the chip is defined correctly. That line gets picked up by an app i wrote that handles the compiling. Just to be on the safe side i went back to MCS and tried to compile as ive done in the past (16F87 is selected) and it still wont compile.
The Datasheet is shared between the F87 and F88. Those Registers don't exist in the F87 (first paragraph of section 12).
Ok, I see that now. It does look like the 16F87 still has A/D convertors though but not as many. Should the 3 working lines have disabled those? Im not sure it matters though because the pins im having trouble with arnt marked as ANx
Bookmarks