18f4550 running slow?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    27

    Default 18f4550 running slow?

    Hi,

    I recently upgraded to the latest version of pbp3, and it came with mplab 8.85. I'm using these with an ICD2, and the latest versions at first seemed to be less 'buggy' [I used to get spurious errors regularly with previous software versions].

    I dusted off some old test projects, and all was well with the 16f628A and 18f2550 stuff I wrote a while back.

    However, when I swapped out the 18f2550 from my breadboard, and inserted a 18f4550, things weren't right. I went back to the most basic code, the tried and trusted flashing LED and, sure enough, it seems to be running over ten times slower than it should, at a guesstimate.

    The code runs perfectly on a 18f2550, flashing the LED around once a second, but takes over ten seconds on a 18f4550. No problem, I thought, it's an oscillator setting, and so I started changing the config bits. After a whole day pulling my hair out, I cannot get it to work with what seems to be the right timing. I have tried every configuration possible [I'm sure], and no go.


    I built a MIDI footpedal for a friend, a while ago, and had the project archived. I re-compiled it, and it doesn't work, that's without changing a line of code. What I now have is the most basic breadboard setup. Connections to Vdd, Vss, PGD, PGC, MCLR [tied with 10k resistor], 20mhz crsytal, and an LED from RB0.

    As I said, unplug the perfectly working 18f2550, plug in the 18f4550, change the device and download the 18f4550 code within mplab, and the LED runs over ten times slower.

    I Googled 18f4550 running slow, and found one applicable result, and the person on that forum put it down to a pcb issue, and it was never resolved satisfactorily.

    I'm convinced it's a software issue, as I have had small 18f4550 projects, including a USB one, working ok.

    Has anybody else run into this issue with this device? I need the extra pins on the 4550 for my next project, and it's *really* frustrating to be able to plug a 2550 back in and watch it work perfectly!


    The simplest 'code' in the world is included below. I have manually tried changing the config bits, and re-programming again and again, to no avail.

    Any pointers would be much appreciated.


    G



    DEFINE OSC 20

    ;---------------------------------------------------------------------------------------------
    #config
    __CONFIG _CONFIG1H, _FOSC_HS_1H
    #endconfig
    ;---------------------------------------------------------------------------------------------

    main:

    TRISB = 0
    lp1:
    portb.0 = 1
    pause 1000
    portb.0 = 0
    pause 1000

    goto lp1

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    2,597


    Did you find this post helpful? Yes | No

    Default Re: 18f4550 running slow?

    Try with this:

    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_1_2L & _VREGEN_ON_2L
    @   __CONFIG    _CONFIG2H, _WDT_OFF_2H
    @   __CONFIG    _CONFIG3H, _CCP2MX_OFF_3H & _PBADEN_OFF_3H & _LPT1OSC_OFF_3H & _MCLRE_ON_3H
    @   __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
    
    DEFINE OSC 48
    
    TRISA = %00000000
    TRISB = %00000000
    TRISC = %00000000
    TRISD = %00000000
    TRISE = %00000000
    
    ADCON1 = %00001111
    
    Led VAR PORTC.2
    
    LoopThis:
      TOGGLE Led
      PAUSE 500
      GOTO LoopThis
    
    END
    The led should blink real close to 1 second intervals.

    Robert

Similar Threads

  1. 18f4550 running slow?
    By Giulio in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 22nd October 2012, 21:28
  2. 18F4550 not running
    By comwarrior in forum General
    Replies: 6
    Last Post: - 1st January 2011, 01:07
  3. Replies: 7
    Last Post: - 20th December 2010, 19:43
  4. DT Interrupt and Elapsed Time Running Slow
    By ShaneMichael in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 11th May 2009, 18:00
  5. PIC18F2431 Running Super SLow!!
    By Philip Biebach in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 26th July 2006, 12:03

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