18f2550 oscillator problems


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Sep 2007
    Posts
    26

    Default 18f2550 oscillator problems

    Hi all,

    I am running an 18f2550 using internal oscillator. I have a timing problem that causes the program to run what I believe is 4 times slower than it should.

    I have the following fuses set in 18f255.inc in the PBP directory.

    __CONFIG _CONFIG1L, _PLLDIV_1_1L
    __CONFIG _CONFIG1H, _FOSC_INTOSCIO_EC_1H
    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _PBADEN_OFF_3H
    __CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L

    I have the following code running on chip.

    OSCCON=%01100000
    DEFINE OSC 4
    TRISA=%0000000
    ADCON1 = 7 ' A/D off, all digital
    high PORTA.5
    pause 1000
    low PORTA.5
    pause 1000
    high PORTA.5

    I am sure the LED on PORTA.5 is staying on for 4 seconds and then goes off for 4 seconds before finally coming back on. What am I doing wrong?

  2. #2
    Join Date
    Sep 2007
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Sorry, I should also have said I am using MPASM

  3. #3
    Join Date
    Sep 2007
    Posts
    9


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Try to set de _PLLDIV_1_1L to _PLLDIV_5_1L. This is also the setting when I'm using USB on the 18F2550 with a 20MHz oscillator.

    Regards,
    Ronald.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i'll bet on
    Code:
            __CONFIG _CONFIG1L, _PLLDIV_1_1L & _CPUDIV_OSC1_PLL2_1L
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    INTOSCIO ??? How about INTCKO instead.

    Try -- OSCCON=%01111100
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    INTCKO is not a valid fuse in my current MPASM version (5.11) for the 18F2550
    Code:
    ;----- CONFIG1H Options --------------------------------------------------
    _FOSC_XT_XT_1H       EQU  H'F0'    ; XT oscillator, XT used by USB
    _FOSC_XTPLL_XT_1H    EQU  H'F2'    ; XT oscillator, PLL enabled, XT used by USB
    _FOSC_ECIO_EC_1H     EQU  H'F4'    ; External clock, port function on RA6, EC used by USB
    _FOSC_EC_EC_1H       EQU  H'F5'    ; External clock, CLKOUT on RA6, EC used by USB
    _FOSC_ECPLLIO_EC_1H  EQU  H'F6'    ; External clock, PLL enabled, port function on RA6, EC used by USB
    _FOSC_ECPLL_EC_1H    EQU  H'F7'    ; External clock, PLL enabled, CLKOUT on RA6, EC used by USB
    _FOSC_INTOSCIO_EC_1H EQU  H'F8'    ; Internal oscillator, port function on RA6, EC used by USB
    _FOSC_INTOSC_EC_1H   EQU  H'F9'    ; Internal oscillator, CLKOUT on RA6, EC used by USB
    _FOSC_INTOSC_XT_1H   EQU  H'FA'    ; Internal oscillator, XT used by USB
    _FOSC_INTOSC_HS_1H   EQU  H'FB'    ; Internal oscillator, HS used by USB
    _FOSC_HS_1H          EQU  H'FC'    ; HS oscillator, HS used by USB
    _FOSC_HSPLL_HS_1H    EQU  H'FE'    ; HS oscillator, PLL enabled, HS used by USB

    and the OSCCON was right in the first post.

    Sorry mackrackit
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. 18F2550 timing
    By sstt1976 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 22nd August 2008, 00:30
  2. 18f2550 + 24lc512
    By mpardinho in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th December 2007, 22:02
  3. Madness, 18F2550!
    By tom in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 11th February 2007, 11:00
  4. 18f2550 'access is denied' USB error?
    By Giulio in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 30th December 2006, 14:29
  5. EasyHid and 18F2550 - why? what? how?
    By Giulio in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 28th December 2006, 07:57

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