USBDemo, something to learn USB a little bit


Closed Thread
Results 1 to 40 of 279

Hybrid View

  1. #1
    selimkara's Avatar
    selimkara Guest


    Did you find this post helpful? Yes | No

    Default Thanks Steve, but..

    Thanks for your rapid response and interest. We are working in Physics dept. at Trakya University. Our aim is to control some experimental structures (for example temperature, light intensity...). To do so, we need a less complex and short VB6 procedure. I think using virtual comm port is very useful to do this. Am I wrong? We had succeeded similar connection, using CDC via MSCOMM in VB6 with a short code. But in pic side, we could not set interrupts. Your code(pic) is very useful and simple. So we want to use your pic code and change your VB code to adapt MSCOMM (virtual comport). You may ask why we don't use serial comm.because there's no comm port on new laptops, so we must learn to use USB.
    If I'm not misunderstand, in the following conversation (#36) between you and Squibcakes, Squib reported that he succeeded this. I would like to know how? I think some changes must be made at pic code. If you or squib have tips about this or have complete codes, I'd be grateful. Thanks for your previous suggestions. We'll also utilize them.

    sincerely
    Selim

    #36---------------------------------------------------
    Mr_E
    Yeah ok well thanks for your input anyway - always welcome I'm happy to edit the the .inc file and leave it at that.

    Great news! I finally got the CDC virtual comport working!!!!!!

    Now I can send data via USB (virtual comport) and out of the Pic 18F4550 USART! and vice versa!
    -------------------------------------------------------
    I'm stoked that this actually works!

    Squib

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by selimkara View Post
    T
    If I'm not misunderstand, in the following conversation (#36) between you and Squibcakes, Squib reported that he succeeded this. I would like to know how? I think some changes must be made at pic code. If you or squib have tips about this or have complete codes, I'd be grateful. Thanks for your previous suggestions. We'll also utilize them.

    The post was regarding setting the config fuses by way of changing the 18f4550.inc file.
    I never actually used CDC with the USB demo, totally separate and apart

    As Steve said, you don't need to use CDC to send you data back to the PC. This code uses HID interface and the VB program displays the data coming from the PIC.

    As far as VB is concerned I have no clue - One day I should learn it!

    Squib

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


    Did you find this post helpful? Yes | No

    Default

    Selim,

    Maybe I missed something in the conversation,
    But this might be what you're looking for ...

    USB CDC Communications for Dummies! (Squibcakes)
    http://www.picbasic.co.uk/forum/showthread.php?t=5806
    <br>
    DT

  4. #4
    selimkara's Avatar
    selimkara Guest


    Did you find this post helpful? Yes | No

    Red face No CDC no Cry...

    Ok. Thanks everybody. I think that was a stupid idea. I'll use and develop UsbDemo. Thanks Steve, Darrell and Squib.

    Bye

  5. #5


    Did you find this post helpful? Yes | No

    Default I Can't I Can`t i really donīt understand

    Hi.

    To Mister_E or anyone that really understand this (i clearly donīt). I made this post already but none seemed to understand it, so i am posting again in other words.

    I made this software that controls an USB device, it all began with Mister_E`s demo, it is working really fine now, no problems with it. NOW i want to use two devices, same software!. Lets say this is a temperature sensor, now i want to measure two diferent points so i wanīt to connect two diferent sensors. HOW can i differentiate both devices? when i connect the second one the first connected gets useless (I am sure the handler is replaced).

    Iīve been reading the whole code for Visual Basic and PBP, i donīt intend to change my device ID and Product ID.. this would be useless. Does the Driver easyHID only works with one device?

    Please give me a little advice on this matter.. How can i use two different handlers?

    Thanks

    DJC

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


    Did you find this post helpful? Yes | No

    Default

    2 different ways
    1) assign, then read the device serial number -> this has to work
    2) use a specific data byte in DataToSend as identifier -> not 100% sure of it
    Steve

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

  7. #7


    Did you find this post helpful? Yes | No

    Default But one of the devices just..

    Hi.. thanks for your reply Mister_E.

    I have this problem with both solutions!... i dont have two working devices when i connect them... i just have one! When i connect the second one the first connected doesnīt work!
    My guess is that this happens because the handler of the first connected device is lost and replaced for the second one.. hence my sent data (from pc to device) is just received in one of the ports (this is for sure!) so it wouldnīt work to use the serial number because i canīt even get it :s.

    The same reason for the second choice.

    I also think that both devices could have exactly the same software, my guess is that this is a matter of software (in VB), there should be a way to create two different connections (what i call handlers) but i donīt get where this is done in the code Sub ConnectHID().

    Again maybe i am thinking this wrong but this is what you would do with two diferent serial devices in different serial ports, you would have two different interrupt routines in the VB software to control each one.

    I really hope someone could guide me here, has none connected two devices?

    Thanks again for your time and concern,

    DJC

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 : 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