What is the proper technique for setting configuration values?
The proper way is described in the manual and for a 16F part it IS the "one liner". Back in the day MELABS had their own assembler for which the @ DEVICE stuff you reference was used. PM is now obsolete and you need to use whatever Microchip dictates for their MPASM. The manual states:
Microchip determines the form and syntax of the actual configuration directives, and they are not consistent for different families of PIC microcontrollers.
So, with PBP3 and a 16F part you do it the one line way, for the 16F684:
Code:
#CONFIG
__config _INTRC_OSC_NOCLKOUT & _WDT_ON & _MCLRE_ON & _CP_OFF
#ENDCONFIG
Which, I suppose you could "extend" to what Arcangel is showing (not tested and IMHO more cluttered than the oneliner)
Code:
@MyConfig = _INTRC_OSC_NOCLKOUT
@MyConfig = MyConfig & _WDT_ON
@MyConfig = MyConfig & _MCLR_ON
@MyConfig = MyConfig & _CP_OFF
#CONFIG
__config MyConfig
#ENDCONFIG
For 18F parts it's more like the way it was with the PM assembler:
Code:
#config
CONFIG FOSC = HS
CONFIG WDTEN = OFF
CONFIG PWRT = ON
CONFIG BOREN = OFF
CONFIG PBADEN = OFF
CONFIG MCLRE = OFF
CONFIG LVP = OFF
CONFIG DEBUG = OFF
CONFIG XINST = OFF
#endconfig
/Henrik.
Bookmarks