18f4550


Closed Thread
Results 1 to 16 of 16

Thread: 18f4550

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Nikos,

    If you haven't already, it's best to comment out the default oscillator settings in the 18F4550.inc file in the PBP folder, I'm sure you've done that before with other PIC's ...

    Then you can set the options in your main program.
    Here's a possibility for blinking an LED on PORTA.1 with a 4550 using the Internal Oscillator @4Mhz and your original code ...
    Code:
    '18F4550 with Int OSC Blinky
    
    @   __CONFIG   _CONFIG1H,  _FOSC_INTOSC_XT_1H
    
    DEFINE OSC 4         ; CPU runs @ 4 Mhz
    OSCCON = %01100010   ; 4 Mhz Internal Oscillator
    
    ;DEFINE OSC 8         ; CPU runs @ 8 Mhz
    ;OSCCON = %01110010   ; 8 Mhz Internal Oscillator
    
    ADCON1 = $0F         ; Disable Analog inputs
    
    loop:
        High PORTA.1 'Turn on LED
        Pause 500 ' Delay for .5 seconds
        Low PORTA.1 'Turn off LED
        Pause 500 ' Delay for .5 seconds
    Goto loop ' Go back to loop and blink LED forever
    
    End
    Keep in mind that the internal oscillator can't drive the USB module. But you can add a crystal to drive the USB and still run the CPU on Internal. Your choice.

    HTH,
    DT

  2. #2
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Question

    Thanks to every one that want to help and share with us a piece of his
    (or her) experience.

    According to Darrel and his piece of his program, I have a problem.
    I used to use Micrcode studio Plus for 16f628.
    Now with the 18f4550 I need the MPLAB.So, I download the latest version of it and set it up to me laptop.
    I did what the microEngineering Labs says about the :
    --The PICBASIC™ and PICBASIC PRO™ Compilers can now be used with Microchip's MPLAB®!--
    http://www.melabs.com/support/mplab.htm

    After all that I try to compile the 18F4550 with Int OSC Blinky that Darrel post and I get two errors Error[118] look at the attached photo

    Please advice
    Nikos
    Attached Images Attached Images  

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


    Did you find this post helpful? Yes | No

    Default

    Steve

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

  4. #4
    Join Date
    Feb 2005
    Location
    GREECE
    Posts
    120


    Did you find this post helpful? Yes | No

    Default

    I did the following but nothing...
    Please H E L P ME.I DO NOT UNDERSTAND!!!!


    Why I have to change thE INC file?Why I never did it with 16f628?
    We are talking for the INC file in the pbp folder?



    ;************************************************* ***************
    ;* 18F4550.INC *
    ;* *
    ;* By : Leonard Zerman, Jeff Schmoyer *
    ;* Notice : Copyright (c) 2006 microEngineering Labs, Inc. *
    ;* All Rights Reserved *
    ;* Date : 06/05/06 *
    ;* Version : 2.47 *
    ;* Notes : *
    ;************************************************* ***************
    NOLIST
    if def PM_USED
    LIST
    "Error: PM does not support this device. Use MPASM."
    __CONFIG _CONFIG1H, _FOSC_INTOSC_XT_1H <-------- add it
    NOLIST
    else
    LIST
    LIST p = 18F4550, r = dec, w = -311, w = -230, f = inhx32
    INCLUDE "P18F4550.INC" ; MPASM Header
    __CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    __CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
    __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
    __CONFIG _CONFIG3H, _PBADEN_OFF_3H
    __CONFIG _CONFIG4L, _LVP_OFF_4L & _ICPRT_OFF_4L & _XINST_OFF_4L
    NOLIST
    endif
    LIST
    EEPROM_START EQU 0F00000h
    BLOCK_SIZE EQU 32

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Oops, my fault. I should have been more complete with my descriptions.

    The .INC file should look like this. The 2 red lines are commented out.
    Code:
    ;****************************************************************
    ;*  18F4550.INC                                                 *
    ;*                                                              *
    ;*  By        : Leonard Zerman, Jeff Schmoyer                   *
    ;*  Notice    : Copyright (c) 2004 microEngineering Labs, Inc.  *
    ;*              All Rights Reserved                             *
    ;*  Date      : 12/31/04                                        *
    ;*  Version   : 2.46                                            *
    ;*  Notes     :                                                 *
    ;****************************************************************
            NOLIST
        ifdef PM_USED
            LIST
            "Error: PM does not support this device.  Use MPASM."
            NOLIST
        else
            LIST
            LIST p = 18F4550, r = dec, w = -311, f = inhx32
            INCLUDE "P18F4550.INC"	; MPASM  Header
      errorlevel -230
    ;        __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    ;        __CONFIG    _CONFIG1H, _FOSC_HSPLL_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
            NOLIST
        endif
            LIST
    EEPROM_START	EQU	0F00000h
    BLOCK_SIZE	EQU	32
    DT

Similar Threads

  1. 18f4550 usb problem.. so im getting crazy..
    By MeSaKu in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th May 2009, 22:03
  2. Usb Mass Storage With 18f4550
    By wagner in forum USB
    Replies: 8
    Last Post: - 17th August 2008, 16:46
  3. 18F4550 to 18F2550
    By mpardinho in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th September 2007, 23:13
  4. How can I turn off USB support in 18F4550
    By BrianT in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th September 2007, 03:56
  5. USB Programmer for 18F4550 PICs
    By Kamikaze47 in forum USB
    Replies: 8
    Last Post: - 21st August 2007, 16:29

Members who have read this thread : 0

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