USBDemo, something to learn USB a little bit


Closed Thread
Results 1 to 40 of 279

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: USBDemo, something to learn USB a little bit

    Pin 4 of the USB connector is Ground.
    It and the Shield should be connected to VSS on the LAB-X1.

    Have you removed the MAX232 chip?
    You've set the RX pin to output, which is likely to cause high currents if the MAX232 is still there.
    DT

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


    Did you find this post helpful? Yes | No

    Default Re: USBDemo, something to learn USB a little bit

    Quote Originally Posted by Darrel Taylor View Post
    Pin 4 of the USB connector is Ground.
    It and the Shield should be connected to VSS on the LAB-X1.
    ...
    Tried both USB pin 4 (black wire) and the eyelet from the shielding connected to VSS, same garbles on LCD.

    I used one of the VSS pins on the PIC, does it have to be a special VSS contact on the Lab X1?


    Quote Originally Posted by Darrel Taylor View Post
    ...
    Have you removed the MAX232 chip?
    You've set the RX pin to output, which is likely to cause high currents if the MAX232 is still there.
    I didn't remove the MAX232, but I installed headers on my Lab X1. The jumpers for RX and TX pins are disabled, same with VUSB pin.


    EDIT: I didn't have the recommended capacitors so I used two 0.1uF ceramic caps in parallel across VUSB and VSS. Could that be a problem?
    Last edited by Demon; - 21st January 2012 at 04:45.

  3. #3
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: USBDemo, something to learn USB a little bit

    I'm just getting started with USB. I've gone through the CDC demo and created my own variants with success (after a bit of teething pain) and now I'm trying to move on to HID. I've found the DT_HID260.zip file and I've been playing with the contents, but I'm not having any luck getting DT_HID260.pbp, DT_INTS-18.bas, ReEnterPBP-18.bas and my code to work together. I'm so close.... I think, but right now I can't even compile.

    I've got 2 errors that have me completely stumped:
    Illegal opcode (USB_INT)
    Address label duplicated or different in second pass (INT_RETURN)

    Any clues where to look? Many thanks...

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


    Did you find this post helpful? Yes | No

    Default Re: USBDemo, something to learn USB a little bit

    It sounds like you would also be getting an error that says it can't open include file DT_INTS-18.bas.

    Did you put it in your PBP folder?
    DT

  5. #5
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: USBDemo, something to learn USB a little bit

    Actually I just resolved it. It seems the line to include DT_HID260.pbp must come AFTER the INT_CREATE. I moved the include from the top of the file to this location and the errors went away.

    Compiles no errors means it will work fine right? Well not exactly, but I'll chew on "why" by myself for a bit.

    Thanks for the help!

  6. #6
    Join Date
    Dec 2010
    Posts
    409


    Did you find this post helpful? Yes | No

    Default Re: USBDemo, something to learn USB a little bit

    Well I though I'd leverage Darrel's heavy lifting and put the USB code (including the interrupt structure) together with the SD card code and make myself basically an overly complicated and expensive thumb drive, purely for my education. It seems, however, that the includes consume more than the 2K space for variables, and after about an hour of trying to make things less generic by eliminating variables wherever possible in favor of fixed values, I still don't have enough space. I'm also not sure if I'm even getting close - is there any way to have the compiler tell you how much you are over by, rather than simply "unable to fit"?

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


    Did you find this post helpful? Yes | No

    Default Re: USBDemo, something to learn USB a little bit

    Charlie,

    I had a similar problem once; so I copied the Includes in the code and removed all the variables I didn't need. That worked in my particular situation.

    Robert

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 07:55
  2. How to receive stream of bytes using PIC USART
    By unifoxz in forum mel PIC BASIC Pro
    Replies: 34
    Last Post: - 20th June 2009, 10:38
  3. Replies: 9
    Last Post: - 31st July 2008, 08:56
  4. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 00:55
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 3

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts