1. 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.
    Dismiss Notice

__config problem

Discussion in 'Microcontrollers' started by Savlon, Apr 7, 2004.

  1. Savlon

    Savlon New Member

    Joined:
    Feb 10, 2004
    Messages:
    15
    Likes:
    0
    Location:
    Manchester, England
    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 (text):
    __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!
     
  2. motion

    motion New Member

    Joined:
    Jul 14, 2003
    Messages:
    560
    Likes:
    0
    Location:
    Quezon City.PH
    This is taken from the file "PICF16F737.INC"

    Code (text):
    ; 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.
     
  3. johnson

    johnson New Member

    Joined:
    Apr 5, 2004
    Messages:
    9
    Likes:
    0
    how about Pic Basic? I have the same problem in implementing _config ......
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Savlon

    Savlon New Member

    Joined:
    Feb 10, 2004
    Messages:
    15
    Likes:
    0
    Location:
    Manchester, England

    Got the oscillator working now, thanks very much!!
     

Share This Page