How can I turn off USB support in 18F4550


Closed Thread
Results 1 to 2 of 2
  1. #1

    Default How can I turn off USB support in 18F4550

    I have a simple BLINK program that uses 92 words in a 16F877A, 146 bytes in an 18F4620 and a HUGE 2104 bytes in the 18F4550. A quick look at the .LST file shows a lot of routines for the USB port are loaded by default.

    I don't need the USB port in my current project but I do need the code space. How can I prevent the USB support being loaded by default? Sadly I am stuck with the 18F4550 for this job.

    The BLINK code follows.

    ' Example program to blink an LED connected to PORTB.5

    ' define osc 4
    define loader_used 1

    LED var portb.5

    loop: High led
    Pause 100
    Low led
    Pause 100
    High led
    Pause 100
    Low led
    Pause 100
    High led
    Pause 100
    Low led
    Pause 2000
    Goto loop
    End


    ' A PIC 16F877A using PBP 2.47 and PM assembler uses 92 words
    ' A PIC 16F877A using PBP 2.47 and MPASM uses 89 words.
    ' A PIC 18F4680 with PBP 2.47 & MPASM uses 146 bytes.
    ' A PIC 18F4550 using PBP 2.47 and MPASM uses 2104 bytes because it loads
    ' the USB libraries - need to kill that.

  2. #2


    Did you find this post helpful? Yes | No

    Default Found problem.

    I can now compile BLINK to 146 bytes.

    The problem is simple. I copied the USB demo program from USBDemo http://www.picbasic.co.uk/forum/showthread.php?t=5418
    and all its files to c:\testcode last week. This has a number of files xxxx.BAS, .INC, .ASM and yyyy.MAC.

    I then wrote the simple BLINK program and placed it in the same c:\testcode directory. It seems PBP uses its BAS, RAM, INC, etc files from c:\testcode first rather than from c:\pbp.

    By deleting all files from c:\testcode except BLINK.PBP, the program now uses only 146 bytes.

    What a relief.
    Last edited by BrianT; - 6th September 2007 at 04:58. Reason: added information

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, 23:03
  2. 18f4550 USB and pulsin or pulsin alternative
    By vacpress in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 15th January 2009, 14:14
  3. Usb Mass Storage With 18f4550
    By wagner in forum USB
    Replies: 8
    Last Post: - 17th August 2008, 17:46
  4. USB Programmer for 18F4550 PICs
    By Kamikaze47 in forum USB
    Replies: 8
    Last Post: - 21st August 2007, 17:29
  5. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 03:30

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