18F25K20 osc setting problem


Closed Thread
Results 1 to 20 of 20

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: 18F25K20 osc setting problem

    Gevo, This compiles just fine for me.

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

    In fact I use MPLAB 8.73a
    I am how ever using PBPX 3.0.7.4
    Dave Purola,
    N8NTA
    EN82fn

  2. #2
    Join Date
    Jul 2005
    Location
    The Netherlands
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: 18F25K20 osc setting problem

    Hi Dave,

    Thanks for your input. This give errors for PBP Pro...

    error (122) Illegal opcode (_CONFIG1H)
    error (122) Illegal opcode (_CONFIG2H)
    error (122) Illegal opcode (_CONFIG3H)
    error (122) Illegal opcode (_CONFIG4L)

    If have plans to upgrade to PBP3 :-)

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: 18F25K20 osc setting problem

    I think the #CONFIG syntax was introduced with v3.

    George

  4. #4
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: 18F25K20 osc setting problem

    The the following.

    Browse to where you have your PBP2.60 folder installation. Scroll down until you find the 18F25K20.INC file and open it in notepad. It should look something like this

    Code:
    ;****************************************************************
    ;*  18F25K20.INC                                                *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2008 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 09/15/08                                        *
    ;*  Version   : 2.60                                            *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            "Error: PM does not support this device.  Use MPASM."
            NOLIST
        else
            LIST
            LIST p = 18F25K20, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F25K20.INC"	; MPASM  Header
            __CONFIG    _CONFIG1H, _FOSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
            __CONFIG    _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
            __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
            NOLIST
        endif
            LIST
    EEPROM_START	EQU	0F00000h
    BLOCK_SIZE	EQU	32
    Under the section "Include P18F25k20.inc" you'll see all the config settings... comment out all four lines thus:

    Code:
    ;****************************************************************
    ;*  18F25K20.INC                                                *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2008 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 09/15/08                                        *
    ;*  Version   : 2.60                                            *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            "Error: PM does not support this device.  Use MPASM."
            NOLIST
        else
            LIST
            LIST p = 18F25K20, r = dec, w = -311, w = -230, f = inhx32
            INCLUDE "P18F25K20.INC"	; MPASM  Header
            ;__CONFIG    _CONFIG1H, _FOSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
            ;__CONFIG    _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
            ;__CONFIG    _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
            ;__CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
            NOLIST
        endif
            LIST
    EEPROM_START	EQU	0F00000h
    BLOCK_SIZE	EQU	32
    Now include the settings in your main PBP code
    Code:
    ASM
        @ __CONFIG    _CONFIG1H, _FOSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
        @ __CONFIG    _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
        @ __CONFIG    _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
        @ __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    ENDASM
    This should compile correctly in PBP 2.60

  5. #5
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: 18F25K20 osc setting problem

    Quote Originally Posted by towlerg View Post
    I think the #CONFIG syntax was introduced with v3.

    George
    That's correct...

    Quote Originally Posted by Dave View Post
    Gevo, This compiles just fine for me.

    #CONFIG
    __CONFIG _CONFIG1H, _FOSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    __CONFIG _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
    __CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    #ENDCONFIG
    Dave, the OP is using 2.60. It doesn't support the #CONFIG /#ENDCONFIG satements

  6. #6
    Join Date
    Jul 2005
    Location
    The Netherlands
    Posts
    40


    Did you find this post helpful? Yes | No

    Angry Re: 18F25K20 osc setting problem

    Hello Scampy, thanks for the workout.

    I have comment out the four line's in the .INC file (PBP folder)

    I have add the line's to PBP main code and get errors after compiling. (PBP v2.60C)

    4 time this error > [warning 207] .... Found label after column 1. (@)
    4 time this error > [error 121] illegal label (@)

    I don't understand why PBP give this error, the instructions/settings are equal as in de .INC file what you advice me to comment out.

    If change some __ like this;

    ASM
    @_CONFIG _CONFIG1H, _FOSC_INTIO67_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    @_CONFIG _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
    @_CONFIG _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
    @_CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    ENDASM
    Now I get 4 other errors:

    Error [122] illegal opcode (_CONFIG1H)
    Error [122] illegal opcode (_CONFIG2H)
    Error [122] illegal opcode (_CONFIG3H)
    Error [122] illegal opcode (_CONFIG4L)

    Pfff, all this to get RA6 and RA7 as I/O...

  7. #7
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: 18F25K20 osc setting problem

    Quote Originally Posted by Gevo View Post
    Hello Scampy, thanks for the workout.

    I have comment out the four line's in the .INC file (PBP folder)

    I have add the line's to PBP main code and get errors after compiling. (PBP v2.60C)

    4 time this error > [warning 207] .... Found label after column 1. (@)
    4 time this error > [error 121] illegal label (@)

    I don't understand why PBP give this error, the instructions/settings are equal as in de .INC file what you advice me to comment out.
    The following compiles fine using PBP 2.60c and MPASM 5.06 (old but that's not what's causing your problem.

    Code:
    '****************************************************************
    '*  Name    : UNTITLED.BAS                                      *
    '*  Author  : [select VIEW...EDITOR OPTIONS]                    *
    '*  Notice  : Copyright (c) 2015 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 04/06/2015                                        *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    
            
    ASM  
         __CONFIG    _CONFIG1H, _FOSC_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
         __CONFIG    _CONFIG2H, _WDTEN_ON_2H & _WDTPS_512_2H
         __CONFIG    _CONFIG3H, _CCP2MX_PORTC_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _HFOFST_ON_3H & _MCLRE_ON_3H
         __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L
    ENDASM
    Notice that there are no @'s in the config settings, and that I have the config settings indented. If you have the underscore (_) at the start of column 1 you get those errors.

    Cut and paste those settings at the start of your code, make sure you have the 18F25K20 selected in microcode studio and hit the compile button

  8. #8
    Join Date
    Jul 2005
    Location
    The Netherlands
    Posts
    40


    Did you find this post helpful? Yes | No

    Default Re: 18F25K20 osc setting problem

    Hi Scampy,

    I cut and paste the settings at the start of the code, change _FOSC_HS_1H to _FOSC_INTIO67_1H to get RA6 and RA7 as I/O en compile without error's.

    The LED is flashing now and the PIC RUNs without the crystal.

    Thank you very much for your advice to solve this !

Similar Threads

  1. DEFINE OSC Serout problem
    By Bonxy in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 10th April 2010, 17:19
  2. 18F25K20 and EEPROM - Bug ???
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd March 2009, 21:14
  3. 18F25K20 & ANSEL = Error
    By BigWumpus in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th December 2008, 02:36
  4. 18f2550 USB OSC Problem
    By serkanc in forum USB
    Replies: 10
    Last Post: - 29th October 2008, 20:52
  5. Setting OSC pins to o/p's
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 20th October 2005, 21:34

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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