Remove Text Formatting
Loading...

+ Reply to Thread
Results 1 to 10 of 10

Thread: 18F4550 config

  1. #1
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425

    Default 18F4550 config

    I've searched and found threads on it but nobody came out and said "this is exactly what you write." I've tried a bunch of different things but I can't get it to work. I would like to know how this:

    _CONFIG1H, _FOSC_HSPLL_HS_1H

    can be set to HS instead of HSPLL.

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default Re: 18F4550 config

    Yes, you can use HS. If you have pbp 3.x, you can check by looking in the pbp3 directory, under the device reference file.

    For the 4550 osc configs, you will find these options:
    Code:
    ;  Oscillator Selection bits
    ;    CONFIG FOSC = HSPLL_HS	    ;HS oscillator, PLL enabled (HSPLL)
    ;    CONFIG FOSC = HS	    ;HS oscillator (HS)
    ;    CONFIG FOSC = INTOSC_HS	    ;Internal oscillator, HS oscillator used by USB (INTHS)
    ;    CONFIG FOSC = INTOSC_XT	    ;Internal oscillator, XT used by USB (INTXT)
    ;    CONFIG FOSC = INTOSC_EC	    ;Internal oscillator, CLKO function on RA6, EC used by USB (INTCKO)
    ;    CONFIG FOSC = INTOSCIO_EC	    ;Internal oscillator, port function on RA6, EC used by USB (INTIO)
    ;    CONFIG FOSC = ECPLL_EC	    ;EC oscillator, PLL enabled, CLKO function on RA6 (ECPLL)
    ;    CONFIG FOSC = ECPLLIO_EC	    ;EC oscillator, PLL enabled, port function on RA6 (ECPIO)
    ;    CONFIG FOSC = EC_EC	    ;EC oscillator, CLKO function on RA6 (EC)
    ;    CONFIG FOSC = ECIO_EC	    ;EC oscillator, port function on RA6 (ECIO)
    ;    CONFIG FOSC = XTPLL_XT	    ;XT oscillator, PLL enabled (XTPLL)
    ;    CONFIG FOSC = XT_XT	    ;XT oscillator (XT)
    http://www.scalerobotics.com

  3. #3
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425

    Default Re: 18F4550 config

    I'm stuck in time with PBP 2.50B. One of the programs I use will not work with a higher version unless I upgrade and I can't right now. Anyhow, I put this in my include file:

    __CONFIG _CONFIG1H, _FOSC_HS

    but it still doesn't work. If I can't put it in my include file, can I type anything into my program that would make it work? I'm used to using @device for 16F parts but I'm sure you already know it doesn't work with 18F parts.

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default Re: 18F4550 config

    That is not one of the options from the list.

    Here are the defaults from PBP
    Code:
            __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
            __CONFIG    _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
            __CONFIG    _CONFIG2L, _PWRT_OFF_2L & _BOR_ON_2L & _BORV_3_2L & _VREGEN_ON_2L
            __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
            __CONFIG    _CONFIG3H, _CCP2MX_ON_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
            __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
    So you could change: _FOSC_HSPLL_HS_1H to _FOSC_HS_1H

    To know you options (without pbp3) you can look at the .inc files in your mpasm suite folder. Mine is located here: C:\Program Files (x86)\Microchip\MPASM Suite
    Last edited by ScaleRobotics; - 26th June 2012 at 15:48.
    http://www.scalerobotics.com

  5. #5
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425

    Default Re: 18F4550 config

    It works! Thanks!

    I'm easy to please

  6. #6
    Join Date
    Jan 2010
    Posts
    37

    Default Re: 18F4550 config

    Hi!
    Can somebody help me to config 18F4550 (without USB) in PBP 2.60?
    I want to use
    1. internal 8MHz oscillator
    or
    2. external 20MHz oscillator.
    My English skills doesn't allow me to understand datasheet.
    Thank you very much.

  7. #7
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,923

    Default Re: 18F4550 config

    Internal 8
    Code:
    DEFINE OSC 8  
    ASM
     __CONFIG   _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
     __CONFIG   _CONFIG1H, _FOSC_INTOSCIO_EC_1H
     __CONFIG    _CONFIG2H, _WDT_OFF_2H & _WDTPS_512_2H
     __CONFIG    _CONFIG3H, _PBADEN_OFF_3H & _MCLRE_OFF_3H 
     __CONFIG    _CONFIG4L, _LVP_OFF_4L
     ENDASM
     OSCCON = %01110000
    Dave
    Always wear safety glasses while programming.

  8. #8
    Join Date
    Nov 2014
    Posts
    4

    Default Re: 18F4550 config

    Hello folks,

    I hope it finds all of you very well.
    Honestly I have been confused.

    In brief as a quick question under Mecanique PicBasic Compiler Ver. 2.5 for achieving to maximum available speed on PIC18F4550 (48MHz), Are below herewith setting “enough” in my program? USB connection is not the desired goal, just to achieve to Maximum available speed in an ordinary program.
    Code:
    ASM
      __config  _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
      __config  _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    
    …. Etc…
    
    ENDASM
    
    .
    .
    .
    DEFINE OSC 20
    .
    .
    .
    And a 20MHz XTAL be connected to Pins:13 & 14

    Am I right?

    Thank you very much in advance for your always Kind Support.

    Regards,

    Andy

    P.S. 18F4550.inc File has been already edited. By adding “ ; ”

  9. #9
    Join Date
    Oct 2009
    Posts
    537

    Default Re: 18F4550 config

    I'm no expert, but from a quick google I found these settings for use with a 20mhz crystal from the datasheet with a 48mhz USB timing

    Code:
    ASM 
     __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
     __CONFIG    _CONFIG1H, _FOSC_HS_1H
     __CONFIG    _CONFIG2H, _WDT_ON_2H & _WDTPS_128_2H
     __CONFIG    _CONFIG3H, _PBADEN_OFF_3H
     __CONFIG    _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
    ENDASM

  10. #10
    Join Date
    Nov 2014
    Posts
    4

    Default Re: 18F4550 config

    Hello Scampy,

    Thank you very much in advance for participating and answer,

    As we see the result of your Google searching is as same as my text, isn't it?

    Quote Originally Posted by Scampy View Post
    from a quick google I found these settings for use with a 20mhz crystal from the datasheet with a 48mhz USB timing

    Code:
    ASM 
     __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
     __CONFIG    _CONFIG1H, _FOSC_HS_1H
    If our suggestions be right, perhaps the wrong point would be on some where else.

    I still need HELP!

    Regards,

    Andy

Members who have read this thread : 15

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