Configuration bits 18F45K20


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2005
    Posts
    17

    Default Configuration bits 18F45K20

    Attempting to set configuration bits using PB pro 3 and running version 8.88 MPIDE and trying to work out how to set and use the internal oscillator as follows

    #CONFIG
    __CONFIG _CONFIG1H, _FOSC_HS_1H
    #ENDCONFIG


    If I replace HS with either INTOSCIO or INTOSC it fails to compile with:
    Error[113] C:\PIC\WORK\RF_REMOTE2.ASM 30 : Symbol not previously defined (_FOSC_INTOSC_1H)

    Could someone please advise what probably something simple that I'm missing.

    Thanks,

    Rob.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: Configuration bits 18F45K20

    Hi,
    As far as I can see It's either INTIO7 or INTIO67 depending on if you want ClkOut on RA6 or not.

    Remember that when adding your own CONFIG like this ALL of the PBP default ones gets thrown out the window and replaced with yours instead. It's not only changing ones you give it. So, it's usually best to copy the default ones and then change and/or add to them or there's a quite a chance of you missing something.
    Code:
      #CONFIG
        CONFIG  FOSC = INTIO67        ; Internal Oscillator, no clock out
        CONFIG  FCMEN = OFF           ; Fail-Safe Clock Monitor disabled
        CONFIG  IESO = OFF            ; Oscillator Switchover mode disabled
        CONFIG  PWRT = OFF            ; PWRT disabled
        CONFIG  BOREN = SBORDIS       ; Brown-out Reset enabled in hardware only (SBOREN is disabled)
        CONFIG  BORV = 18             ; VBOR set to 1.8 V nominal
        CONFIG  WDTEN = ON            ; WDT is always enabled. SWDTEN bit has no effect
        CONFIG  WDTPS = 512           ; 1:512
        CONFIG  CCP2MX = PORTC        ; CCP2 input/output is multiplexed with RC1
        CONFIG  PBADEN = OFF          ; PORTB<4:0> pins are configured as digital I/O on Reset
        CONFIG  LPT1OSC = OFF         ; Timer1 configured for higher power operation
        CONFIG  HFOFST = ON           ; HFINTOSC starts clocking the CPU without waiting for the oscillator to stablize.
        CONFIG  MCLRE = ON            ; MCLR pin enabled; RE3 input pin disabled
        CONFIG  STVREN = ON           ; Stack full/underflow will cause Reset
        CONFIG  LVP = OFF             ; Single-Supply ICSP disabled
        CONFIG  XINST = OFF           ; Instruction set extension and Indexed Addressing mode disabled (Legacy mode)
        CONFIG  DEBUG = OFF           ; Background debugger disabled, RB6 and RB7 configured as general purpose I/O pins
        CONFIG  CP0 = OFF             ; Block 0 (000800-001FFFh) not code-protected
        CONFIG  CP1 = OFF             ; Block 1 (002000-003FFFh) not code-protected
        CONFIG  CP2 = OFF             ; Block 2 (004000-005FFFh) not code-protected
        CONFIG  CP3 = OFF             ; Block 3 (006000-007FFFh) not code-protected
        CONFIG  CPB = OFF             ; Boot block (000000-0007FFh) not code-protected
        CONFIG  CPD = OFF             ; Data EEPROM not code-protected
        CONFIG  WRT0 = OFF            ; Block 0 (000800-001FFFh) not write-protected
        CONFIG  WRT1 = OFF            ; Block 1 (002000-003FFFh) not write-protected
        CONFIG  WRT2 = OFF            ; Block 2 (004000-005FFFh) not write-protected
        CONFIG  WRT3 = OFF            ; Block 3 (006000-007FFFh) not write-protected
        CONFIG  WRTC = OFF            ; Configuration registers (300000-3000FFh) not write-protected
        CONFIG  WRTB = OFF            ; Boot Block (000000-0007FFh) not write-protected
        CONFIG  WRTD = OFF            ; Data EEPROM not write-protected
        CONFIG  EBTR0 = OFF           ; Block 0 (000800-001FFFh) not protected from table reads executed in other blocks
        CONFIG  EBTR1 = OFF           ; Block 1 (002000-003FFFh) not protected from table reads executed in other blocks
        CONFIG  EBTR2 = OFF           ; Block 2 (004000-005FFFh) not protected from table reads executed in other blocks
        CONFIG  EBTR3 = OFF           ; Block 3 (006000-007FFFh) not protected from table reads executed in other blocks
        CONFIG  EBTRB = OFF           ; Boot Block (000000-0007FFh) not protected from table reads executed in other blocks
    
    ;  #ENDCONFIG

  3. #3
    Join Date
    Nov 2005
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: Configuration bits 18F45K20

    Thanks Henrik!

    That worked, but where did you find all those configuration bits? I've looked high an low but all documentation I've seen refers to INTOSCIO or INTOSC or something along those lines?

    Rob.

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,520


    Did you find this post helpful? Yes | No

    Default Re: Configuration bits 18F45K20

    Hi Rob,
    Have you looked in the manual ;-)

    In section 4.9, #CONFIG....#ENDCONFIG it says (among other things):
    Microchip determines the form and syntax of the actual configuration directives, and they are not consistent for different families of PIC microcontrollers. We have attempted to include the information for each chip in a device information file. The files are located in your PBP install in the Device Reference folder. (PIC16F877.INFO, PIC18F4620.INFO, etc.)
    That's where I found it.

    /Henrik.

  5. #5
    Join Date
    Nov 2005
    Posts
    17


    Did you find this post helpful? Yes | No

    Default Re: Configuration bits 18F45K20

    Hi Henrik,

    Guess I didn't read that section!! :-(

    Rob.

Similar Threads

  1. Configuration bits and timing
    By Christos_K in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th November 2012, 08:53
  2. configuration bits
    By Izone1173 in forum mel PIC BASIC
    Replies: 2
    Last Post: - 18th June 2009, 04:17
  3. Configuration bits
    By Perrin` in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 3rd July 2008, 14:40
  4. Configuration bits
    By DJEE in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th June 2007, 19:20
  5. Configuration bits
    By Armando Herjim in forum General
    Replies: 0
    Last Post: - 5th December 2006, 16:51

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts