26K80 Configuration and Port C 0, 1


Results 1 to 8 of 8

Threaded View

  1. #1

    Default 26K80 Configuration and Port C 0, 1

    I'm moving from a 2680 to 26K80.
    The LCD in my 2680 code does not now work in the 26K80 code.

    I know this is related to port C 0,1 and a new function in the 26K80 SOSCEL

    I am trying to disable the new function and set the Port C,0,1 to digital mode as per the data sheet.
    I am using the old style config layout

    Code:
    #CONFIG         ;18F26K80 CAN Enabled
     __CONFIG _CONFIG1L, _SOSCSEL_DIG_1L
     __CONFIG _CONFIG1H, _FOSC_INTIO2_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
     __CONFIG _CONFIG2L, _PWRTEN_ON_2L & _BOREN_OFF_2L & _BORV_3_2L
     __CONFIG _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
     __CONFIG _CONFIG3H, _MSSPMSK_MSK7_3H & _CANMX_PORTB_3H & _MCLRE_OFF_3H
     __CONFIG _CONFIG4L, _STVREN_OFF_4L & _BBSIZ_BB1K_4L
     __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
     __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
     __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
     __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
     __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
     __CONFIG _CONFIG7H, _EBTRB_OFF_7H
    #ENDCONFIG
    This compiles correctly but the PIckit2 programmer gives an error (Verification of configuration failed)

    I'm obviously not doing something correctly or have missed something else.. Any ideas.

    I get the assembler warning config deprecated, but I thought you could ignore that and still use the old layout..

    I also have just tried the new config layout.

    #CONFIG
    CONFIG RETEN = OFF
    CONFIG INTOSCSEL = HIGH
    CONFIG SOSCSEL = DIG ; DIGITAL I/O on port C 0,1
    CONFIG XINST = OFF ; Disabled
    CONFIG FOSC = INTIO2
    CONFIG PLLCFG = ON ; Enabled
    CONFIG FCMEN = OFF ; Disabled
    CONFIG IESO = OFF ; Disabled
    CONFIG PWRTEN = OFF ; Disabled
    CONFIG BOREN = OFF ; Enabled in hardware, SBOREN disabled
    CONFIG BORV = 3 ; 1.8V
    CONFIG BORPWR = ZPBORMV ; ZPBORMV instead of BORMV is selected
    CONFIG WDTEN = OFF
    CONFIG WDTPS = 512 ; 1:512
    CONFIG CANMX = PORTB ; ECAN TX and RX pins are located on RB2 and RB3, respectively
    CONFIG MSSPMSK = MSK7 ; 7 Bit address masking mode
    CONFIG MCLRE = OFF
    CONFIG STVREN = ON ; Enabled
    CONFIG BBSIZ = BB2K ; 2K word Boot Block size
    CONFIG CP0 = OFF ; Disabled
    CONFIG CP1 = OFF ; Disabled
    CONFIG CP2 = OFF ; Disabled
    CONFIG CP3 = OFF ; Disabled
    CONFIG CPB = OFF ; Disabled
    CONFIG CPD = OFF ; Disabled
    CONFIG WRT0 = OFF ; Disabled
    CONFIG WRT1 = OFF ; Disabled
    CONFIG WRT2 = OFF ; Disabled
    CONFIG WRT3 = OFF ; Disabled
    CONFIG WRTC = OFF ; Disabled
    CONFIG WRTB = OFF ; Disabled
    CONFIG WRTD = OFF ; Disabled
    CONFIG EBTR0 = OFF ; Disabled
    CONFIG EBTR1 = OFF ; Disabled
    CONFIG EBTR2 = OFF ; Disabled
    CONFIG EBTR3 = OFF ; Disabled
    CONFIG EBTRB = OFF ; Disabled
    #ENDCONFIG
    This complies with no warnings or errors but programming the device with pickit 2 gives the same configuration verification error.
    LCD still not working..
    Last edited by retepsnikrep; - 3rd February 2018 at 09:45.

Similar Threads

  1. New user: port configuration problem/unexpected interaction/16F887
    By Experimenter in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 14th March 2014, 20:25
  2. Replies: 6
    Last Post: - 29th December 2011, 21:39
  3. 18F2520 - problem configuring fuse for port B as digital port.
    By hwhisperer in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th October 2010, 11:41
  4. 16f877 port configuration & interrupts
    By Rob Martin in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th April 2005, 17:30
  5. Duplicating port input to port output
    By lwindridge in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th April 2004, 21:43

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