26K80 Configuration and Port C 0, 1


Closed Thread
Results 1 to 8 of 8
  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 10:45.

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: 26K80 Configuration and Port C 0, 1

    It is now displaying stuff on the screen but all garbled and it feels like the clock is running at the wrong speed.

    DEFINE OSC 32 '8mhz Clock (x4 = 32mhz) Note max speed is 64mhz..
    OSCCON = %01100010 'Internal 8 mhz Osc and stable
    OSCCON2 = %00000000
    OSCTUNE = %01000000 'Enable PLL 8mhz x 4 = 32mhz
    It should be running at 32mhz :?

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: 26K80 Configuration and Port C 0, 1

    Apologies. Operator error.
    Just realised the 18F26K80 is not pin compatible with the 18F2680.
    It has extra power pins and requires extra decoupling caps blah blah..
    Never assume anything.. This explains why it wasn't working in my 18F2680 pcb...

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: 26K80 Configuration and Port C 0, 1

    Actually I was wrong again it is pin compatible and working ok now.

  5. #5


    Did you find this post helpful? Yes | No

    Default Re: 26K80 Configuration and Port C 0, 1

    You appear to be having a fine old chat with yourself there retpsnikrep.
    George

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,611


    Did you find this post helpful? Yes | No

    Default Re: 26K80 Configuration and Port C 0, 1

    Name:  RTFM.jpg
Views: 806
Size:  23.0 KB

    was a moment we had not seen that one ...

    Good ol' times far away ...



    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    3,793


    Did you find this post helpful? Yes | No

    Default Re: 26K80 Configuration and Port C 0, 1

    It took 2 year for the pin compatibility!

    Good you are on-track again!

    Ioannis

  8. #8


    Did you find this post helpful? Yes | No

    Default Re: 26K80 Configuration and Port C 0, 1

    It all went on the back burner and I changed tack after I originally misread 26k80 FM.

    I reread it recently and established my incompetence so I resurrected the original project.

    Thanks for the tips..

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, 21:25
  2. Replies: 6
    Last Post: - 29th December 2011, 22: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, 12:41
  4. 16f877 port configuration & interrupts
    By Rob Martin in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th April 2005, 18:30
  5. Duplicating port input to port output
    By lwindridge in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 26th April 2004, 22: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