Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Guidance on config syntax please

Status
Not open for further replies.

fenderman

Member
Hi All,
Up till now I have used the Configure>Configuration Bits to set up the PIC, and have used some of the Config directives in the smaller (8/16 pin) devices.
I'm trying to use the assembler config directive to setup the config bits for a PIC16F886 chip, but altough the assembler reports no errors, I don't think that the configuration bits are getting set correctly as not all chips are setting the config bits, and I have to revert to the Configure>Configuration Bits method to get a reliable device.

This is the syntax I am using .... where am I going wrong please.

__CONFIG1 = _INTRC_OSC_NOCLKOUT
__CONFIG1 = _WDT_OFF
etc.
I suspect that the assembler is seeing the __CONFIG1 as a label, rather than an assembler directive ....

Any help would be appreciated.

fenderman
 
I do like this
Code:
	__CONFIG    _CONFIG1, _CP_OFF & _CCP1_RB0 & _DEBUG_OFF & _WRT_PROTECT_OFF & _CPD_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _HS_OSC
     	__CONFIG    _CONFIG2, _IESO_OFF & _FCMEN_OFF
 
Code:
[I]; '__CONFIG' directive is used to embed configuration data within .asm file.
; The labels following the directive are located in the respective .inc file.
; See respective data sheet for additional information on configuration word.

  [SIZE=2]  __CONFIG    _CONFIG1, _LVP_OFF & _FCMEN_ON & _IESO_OFF & _BOR_OFF & _CPD_OFF & _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_OFF & _INTRC_OSC_NOCLKOUT

    __CONFIG    _CONFIG2, _WRT_OFF & _BOR21V[/SIZE][/I]
you may study the template file at
C:\Program Files\Microchip\MPASM Suite\Template\Code and lookk for the chip 16F886temp.asm
 
Last edited:
Thats the answer !

Thats what I was looking for ... thats done the trick ... many thanks, lightning fast replies as well ...
many thanks
Fenderman
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top