Yes this error is generated by MPASM. A list of MPASM assembler error codes can be found
in the MPASM help file.
You can't stop PBP from including device specific .INC files. You just need to learn how to
use/modify them for your own needs.
The error is due to the __config directive being seen in two places. 1 in the 16F628A.INC file,
and 1 in your code.
If you prefer to insert config options in your code, and use the MPASM assembler, then just
comment out the __config line in the include file.
If you insert config options in your code, and you're using the PM assembler, you don't need
to comment out config options. The PM assembler will use whatever config options you have
in your code & ignore the default config options in the 16F628A.INC file. MPASM will throw
the error.
From the 16F628A.INC file in your PBP install directory:
Code:
NOLIST
ifdef PM_USED
LIST
include 'M16F62xA.INC' ; PM header
device pic16F628A, xt_osc, wdt_on, mclr_on, lvp_off, protect_off
XALL
NOLIST
else
LIST
LIST p = 16F628A, r = dec, w = -302
INCLUDE "P16F628A.INC" ; MPASM Header
; __config _XT_OSC & _WDT_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF
NOLIST
endif
LIST
PBP automatically includes 16F628A.INC when you compile for this target.
If the PM assembler is used ifdef PM_USED = true, and the M16F62xA.INC file is also
included.
If MPASM is used, then the P16F628A.INC file located in your MPLAB install directory is used.
A list of all config options available for this PIC can be found in these secondary include files
that 16F628A.INC points to.
M16F62xA.INC if PM is used or P16F628A.INC if MPASM is used.
_INTOSC_OSC_NOCLKOUT is the correct option for using the internal osc, but MPASM will
complain if it sees the __config directive twice.
So;
1. Modify the config options in the PBP 16F628A.INC file.
or;
2. Comment the __config line out in this file, and drop them in your code.
If you read through both threads Darrel linked to above, it should be easy to understand.
Bookmarks