PIC18EXT.BAS Alteration


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94

    Question PIC18EXT.BAS Alteration

    Hi,

    I need access to the UCON register (USB Control Register) so that I can disable the USB port in an 18F4550.

    I have added the line:

    Code:
    UCON    var byte EXT
    into the PIC18EXT.BAS file and this seems to have done the trick.

    Is this the correct way to have done this or should I not have touched this file at all?

    Thanks very much

    Rob
    Last edited by Rob; - 25th January 2007 at 17:15. Reason: Needed to enclose code in correct fashion

  2. #2
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    Hi Rob,

    You can add whatever external register definitions you like to this file. That's
    how I add any that aren't already in there.
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

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


    Did you find this post helpful? Yes | No

    Default

    Just remember that the next PBP upgrade will overwrite that file.

    Keep track of what you've changed.
    <br>
    DT

  4. #4
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94


    Did you find this post helpful? Yes | No

    Talking Thanks!

    Cheers for your replies - much appreciated (as always!).

    Kind Regards

    Rob

  5. #5
    Join Date
    Apr 2008
    Posts
    10


    Did you find this post helpful? Yes | No

    Default 18F2455 PortC.4 & 5 as input

    I added the definition of UCON to the PIC18EXT.BAS file. Which eliminates the compile error. But the PortC.4 and 5 when read with either a high or low applied read zero. What else do i need to do to use these ports as input.

    RD

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


    Did you find this post helpful? Yes | No

    Default

    Adding UCON implies that you are using USB.

    PORTC.4, PORTC.5 are the USB D+/D- pins, so you won't be able to use them as digital I/O at the same time as USB.
    <br>
    DT

Similar Threads

  1. Elapsed_Int-18 Alteration
    By Rob in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 31st January 2008, 11:51

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