+ Reply to Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default PIC19176 Configuration bits

    On some PIC's one can define the CONFIG bits by this syntax (for example on the 18F45K22):

    Code:
    #CONFIG
        CONFIG  FOSC = INTIO67        ; Internal oscillator block
        CONFIG  PLLCFG = ON           ; PLL Control
        CONFIG  PRICLKEN = OFF        ; Primary clock can be disabled by software
        CONFIG  FCMEN = OFF       
    etc
    but on others, like the 16F19176 needs this type of syntax:

    Code:
    #CONFIG
        __CONFIG _CONFIG1, _FEXTOSC_OFF
        __CONFIG _CONFIG1, _RSTOSC_HFINTPLL    
    etc
    Anyone knows why?

    And then it gives me Overwriting previous address contents (8007)...

    Testing on PBP 3.1.2.3 and MPASMX of the 5.15 MPLABX

    Ioannis
    Last edited by Ioannis; - 4th November 2019 at 20:37.

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: PIC19176 Configuration bits

    OK, after many compilations with errors, it seems that for the specific PIC needs this exactly syntax of the configs:

    __CONFIG _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINTPLL & ...

    But this is not very helpful as one cannot add comments as to what each config bit does.

    Ioannis

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    1,746

    Default Re: PIC19176 Configuration bits

    this format ?
    Code:
    #CONFIG
    cfg1  = _FEXTOSC_OFF
    cfg1&= _RSTOSC_HFINTPLL
    cfg1&= _......
      __CONFIG _CONFIG1, cfg1
    #ENDCONFIG
    This is more entertaining than Free to Air TV

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: PIC19176 Configuration bits

    Thanks Richard.

    Yes, this too works OK. Although more typing this helps keeping the comments about each config bit.

    Still, question remains, why different MCU need different format.

    Ioannis

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    1,746

    Default Re: PIC19176 Configuration bits

    they don't

    Code:
    #CONFIG  
     __CONFIG _CONFIG1, _FEXTOSC_OFF   
     __CONFIG _CONFIG1, _RSTOSC_HFINTPLL    
    etc
    you cannot do this, its syntatically incorrect


    Code:
    #CONFIG 
     __CONFIG _CONFIG1, _FEXTOSC_OFF 
     __CONFIG _CONFIG2, _RSTOSC&_HFINTPLL  
     etc
    would be ok if _RSTOSC&_HFINTPLL are in config word 2
    Last edited by richard; - 4th November 2019 at 22:43. Reason: formatted
    This is more entertaining than Free to Air TV

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    1,746

    Default Re: PIC19176 Configuration bits

    Code:
    #CONFIG
        CONFIG  FOSC = INTIO67        ; Internal oscillator block
        CONFIG  PLLCFG = ON           ; PLL Control
        CONFIG  PRICLKEN = OFF        ; Primary clock can be disabled by software
        CONFIG  FCMEN = OFF       
    etc
    this format is pic18 only
    This is more entertaining than Free to Air TV

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: PIC19176 Configuration bits

    Quote Originally Posted by richard View Post
    [CODE]this format is pic18 only
    That explains it. But where is this referred?

    Thanks once again.
    Ioannis

  8. #8
    Join Date
    May 2013
    Location
    australia
    Posts
    1,746

    Default Re: PIC19176 Configuration bits

    That explains it. But where is this referred?
    where most things reside these days
    This is more entertaining than Free to Air TV

  9. #9
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: PIC19176 Configuration bits



    Nice!

Similar Threads

  1. Configuration bits
    By CipiCips in forum PBP3
    Replies: 18
    Last Post: - 14th March 2019, 21:14
  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, 17:51

Members who have read this thread : 12

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