I correct DEFINE OSC 8 this should be in uppercase, I have read the manual again page 281 section 8.1.3.
in section 4.9 page 100 of the manual I found the following
#CONFIG...#ENDCONFIG
#CONFIG
;configuration directives in Assembly Language
#ENDCONFIG
#CONFIG can be used to insert a block of Assembly Language directives that specify
settings for target device's configuration words. These settings control things like the
oscillator type, code protection, and other parameters that must be set before the
program code executes. For detailed information about configuration words, see the
datasheet for the specific PIC microcontroller that you are compiling for. Most
datasheets will list the information in a section named "Configuration" or "Special
Features".
The #CONFIG block is similar to the ASM..ENDASM and @ runtime commands
because its contents are written in Assembly Language. It is a special case,
however, and differs from the runtime commands in significant ways. The code
enclosed in a #CONFIG block always replaces the default configuration settings that
PBP would normally include. The code is placed in a special location in the
generated Assembly Language. This location is reserved for configuration directives;
therefore #CONFIG should not be used for other Assembly instructions.
Microchip determines the form and syntax of the actual configuration directives, and
they are not consistent for different families of PIC microcontrollers. We have
attempted to include the information for each chip in a device information file. The
files are located in your PBP install in the Device Reference folder.
(PIC16F877.INFO, PIC18F4620.INFO, etc.)
Here are a few examples that you might use for various parts:
'Config for 16F877A
#CONFIG
__config _XT_OSC & _WDT_ON & _LVP_OFF & _CP_OFF
#ENDCONFIG
'Config for 18F46J50
#CONFIG
CONFIG XINST = OFF
CONFIG PLLDIV = 5
CONFIG WDTPS = 512
CONFIG CPUDIV = OSC1
CONFIG OSC = HSPLL
#ENDCONFIG
Bookmarks