18F2620 pbp3 example config please


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: 18F2620 pbp3 example config please

    Anyone with a config for a similiar 18F chip then? 2525, 4525, 4620?

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: 18F2620 pbp3 example config please

    I found this example so will keep trying.

    #CONFIG
    __CONFIG _CONFIG1H, _OSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    #ENDCONFIG

  3. #3
    Join Date
    Feb 2010
    Location
    USA, New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default Re: 18F2620 pbp3 example config please

    I did a migration of code from the 16F877 to the 18F452. They are *both* kind of older now...8^) If you thought it would be useful I can dig up the configurations for comparison. I never throw old code away, I just archive it. I've got versions of this particular ported code that go back to nearly the previous centrury.

    Best Regards,
    Paul
    The way to avoid mistakes is to gain experience. The way to gain experience is to make mistakes.

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: 18F2620 pbp3 example config please

    If you have something it would be useful thanks.

  5. #5
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: 18F2620 pbp3 example config please

    The configs aren't so much different. If you use a programmer like an ICD2/3 or a PICKIT3, MPLAB will show you the options.

    The easiest thing to do would be to set it up in a way that makes sense and simply try it.
    Charles Linquist

  6. #6
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 18F2620 pbp3 example config please

    The sub directory, "DEVICE_REFERENCE" of the PBP3 directory has an example with and all of the options listed.
    Dave
    Always wear safety glasses while programming.

  7. #7


    Did you find this post helpful? Yes | No

    Default Re: 18F2620 pbp3 example config please

    That's very useful thanks but how do you know which configs go on which line ? can you mix them up?

    CONFIG1H? xxxx & xxxx & xxxx etc etc
    CONFIG2H?
    CONFIG3H?
    etc

    Or do you just have as many config lines as reqd?

  8. #8
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: 18F2620 pbp3 example config please

    Maybe I am not understanding the question, the 1H things go on the 1H line, 2H on the 2H line...
    Dave
    Always wear safety glasses while programming.

  9. #9
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,617


    Did you find this post helpful? Yes | No

    Default Re: 18F2620 pbp3 example config please

    Hi,
    Just look at the .INFO file, it has a "section" for each CONFIG you can possibly set for the device, choose one from each section if you don't know the default, like:
    Code:
    ; This is for the 18F26K20
    #CONFIG
      CONFIG FOSC = HSPLL
      CONFIG FCMEM = ON
      CONFIG IESO = OFF
      CONFIG PWRT = ON
      CONFIG BOREN = OFF
      ; And so on
    #ENDCONFIG
    That way you don't have to know which bit belongs to which register.

    Otherwise you have to resort to the datasheet and/or the .inc file for the device located in the MPASM directory, at the bottom of that file you'll find which bit goes where, like:
    Code:
    ;----- CONFIG1H Options --------------------------------------------------
    _FOSC_LP_1H          EQU  H'F0'    ; LP oscillator
    _FOSC_XT_1H          EQU  H'F1'    ; XT oscillator
    _FOSC_HS_1H          EQU  H'F2'    ; HS oscillator
    _FOSC_RC_1H          EQU  H'F3'    ; External RC oscillator, CLKOUT function on RA6
    _FOSC_EC_1H          EQU  H'F4'    ; EC oscillator, CLKOUT function on RA6
    _FOSC_ECIO6_1H       EQU  H'F5'    ; EC oscillator, port function on RA6
    _FOSC_HSPLL_1H       EQU  H'F6'    ; HS oscillator, PLL enabled (Clock Frequency = 4 x FOSC1)
    _FOSC_RCIO6_1H       EQU  H'F7'    ; External RC oscillator, port function on RA6
    _FOSC_INTIO67_1H     EQU  H'F8'    ; Internal oscillator block, port function on RA6 and RA7
    _FOSC_INTIO7_1H      EQU  H'F9'    ; Internal oscillator block, CLKOUT function on RA6, port function on RA7
    _FCMEN_OFF_1H        EQU  H'BF'    ; Fail-Safe Clock Monitor disabled
    _FCMEN_ON_1H         EQU  H'FF'    ; Fail-Safe Clock Monitor enabled
    _IESO_OFF_1H         EQU  H'7F'    ; Oscillator Switchover mode disabled
    _IESO_ON_1H          EQU  H'FF'    ; Oscillator Switchover mode enabled
    
    
    ;----- CONFIG2L Options --------------------------------------------------
    _PWRT_ON_2L          EQU  H'FE'    ; PWRT enabled
    _PWRT_OFF_2L         EQU  H'FF'    ; PWRT disabled
    _BOREN_OFF_2L        EQU  H'F9'    ; Brown-out Reset disabled in hardware and software
    _BOREN_ON_2L         EQU  H'FB'    ; Brown-out Reset enabled and controlled by software (SBOREN is enabled)
    _BOREN_NOSLP_2L      EQU  H'FD'    ; Brown-out Reset enabled in hardware only and disabled in Sleep mode (SBOREN is disabled)
    _BOREN_SBORDIS_2L    EQU  H'FF'    ; Brown-out Reset enabled in hardware only (SBOREN is disabled)
    _BORV_30_2L          EQU  H'E7'    ; VBOR set to 3.0 V nominal
    _BORV_27_2L          EQU  H'EF'    ; VBOR set to 2.7 V nominal
    _BORV_22_2L          EQU  H'F7'    ; VBOR set to 2.2 V nominal
    _BORV_18_2L          EQU  H'FF'    ; VBOR set to 1.8 V nominal
    And so on but again, I prefer the new way posted above.

    /Henrik.

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