__config problem

Status
Not open for further replies.

Savlon

New Member
Hi, could anyone please tell me where i am going wrong. I am trying to program a PIC16F737 to have an internal 8MHz clock, when i use the config command i get an error saying "ERROR[126] Argument out of range (not a valid config register address)" when i build. The code is:

Code:
__config 0x3790

I have tried using the binary value too (b'11011110010000') but get the same error. Has anybody ever had this problem? I tried using the configuration bits window, however when i began to program the chip a warning comes up saying that the configuration settings have not been updated, proceed with previous configuration, can anybody tell me how to update these settings?

Thanks!
 
This is taken from the file "PICF16F737.INC"

Code:
; To use the Configuration Bits, place the following lines in your source code
;  in the following format, and change the configuration value to the desired 
;  setting (such as CP_OFF to CP_ALL).  These are currently commented out here
;  and each __CONFIG line should have the preceding semicolon removed when
;  pasted into your source code.

;Program Configuration Register 1
;		__CONFIG    _CONFIG1, _CP_OFF & _CCP2_RC1 & _DEBUG_OFF & _VBOR_2_0 & _BOREN_1 & MCLR_OFF & _PWRTE_OFF & _WDT_OFF & _HS_OSC

;Program Configuration Register 2
;		__CONFIG    _CONFIG2, _BORSEN_1 & _IESO_OFF & _FCMEN_OFF

The __CONFIG pseudo op can only take 8-bit operands and so two are needed. Also, avoid using "magic numbers". Use the labels supplied by Microchip.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…