USBDemo, something to learn USB a little bit


Closed Thread
Results 1 to 40 of 279

Hybrid View

  1. #1
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Unhappy

    I was able to just put the mcHID.dll in the Visual Basic project folder where my project files are located. That solved working with VB, but I still don't have the easyHID program at my disposal. Maybe I will just have to slug it out by hand.

    -Sterling

  2. #2
    Join Date
    Oct 2003
    Location
    Australia
    Posts
    257


    Did you find this post helpful? Yes | No

    Talking

    OK, got it sussed!

    The problem was in my report descriptor section..... originally, I had setup up a "joystick" descriptor, which worked, but then later I changed the descriptor to a "simulator control".

    The confusing thing was that windows was happy to use this new descriptor, and I figure the HID PID/VID sections in the registery never got updated (ie windows still recognised the pedals as a joystick).

    When I plugged them into another PC for the first time, windows installed the pedals as a simulator control and that is why they didn't show up into the game devices list.

    After changing the report descriptor scetion back to a joystick - all is working!

    I guess the moral of the story here is that if you use the same VID/PID for different USB applications your USB device may not install properly.

    I found that just removing the usb device from the device manager isn't enough, as you may need to delete all keys in the registry that ref. the paticular PID/VID device.

    Clear as #*$#@!! mud?

    As for installing EasyHID - I haven't had any problems installing (XP Pro 32). I don't suppose you can set compatabillity to XP(32) for the setup file?

    Cheers Squib

  3. #3
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Of course I took your excellent example and tore it all apart to modify it into something completely useless to me.

    I'm not getting data from USBbufferin on the device. I am kind of curious about a line in the VB side:

    "hidWriteEx VendorID, ProductID, BufferOut(0) ' send it"

    Doesn't that just send the first element of the array? On the device I am trying to read USBbufferin[2] but get nothing. I should point out that my version has this as a normal BYTE, not the LSB of another number or whatever you had.


    -Sterling
    Last edited by SterlingY; - 16th March 2007 at 02:33.

  4. #4
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    More info:

    In the VB code, if I put the following line "BufferOut(2) = 145" in the WriteSomeData() function, I get "0" when reading on the device, however, If I put that same line in the Form_Load() function, it sends the data, so I think the Form is constantly reloading. How can this be?

    -Sterling

  5. #5
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    I seem to be talking to myself here, but that's okay.

    I just wanted to say that I got it working. I don't know how. But, I ran the original USBDEMO.exe, and then everything started working with my modified version.

    Crazy, I know!

    -Sterling

  6. #6
    Join Date
    Mar 2007
    Location
    West Hollywood, CA
    Posts
    38


    Did you find this post helpful? Yes | No

    Smile

    Here I go again:

    The problem was that VB buffer(1) comes into the device as buffer[2]

  7. #7
    Join Date
    Dec 2003
    Location
    Storrs, Ct.
    Posts
    91


    Did you find this post helpful? Yes | No

    Default Thanks mister e

    Thanks for the inspiration Steve. My upgrade is complete, PBP2.47,EasyPic 4, PicFlash 7.03, a new laptop to stuff it all in and some 18f4550 samples.
    Thanks to Uncle Sam for a quick tax return also.


    Had some trouble with the USB stuff at first but this post solved my problems.
    http://www.picbasic.co.uk/forum/show...4&postcount=32

    Not sure what to do with the $20 I got left. Dinner at Denny's with my wife maybe?
    Then again I could use another USB cable...

    Thanks again Steve.

Similar Threads

  1. Bits, Bytes Words and Arrays
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 24
    Last Post: - 14th June 2016, 08: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, 11:38
  3. Replies: 9
    Last Post: - 31st July 2008, 09:56
  4. PICBasic newbie problem
    By ELCouz in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 12th February 2008, 01:55
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 02:07

Members who have read this thread : 1

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