General USB questions


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Location
    Holmfirth England
    Posts
    116

    Default General USB questions

    Hi,

    Just a few questions about USB, to help point me in the right direction for my latest project.

    I need to monitor arc voltage & current, of a stud weld, for upto 1.5 seconds, and read the values into a PC, oscilloscope style. I have HID maker FS, and will soon have an update for PBP so i can use a PIC18F4550. So I have never used hid maker so far.

    I have read that the high speed usb will poll for data every 1mS, this would be an ideal sample rate for my application.

    I think i would need only the 2 variables, and a flag to tell the pc that a weld is happening, and to store the results.

    So Can I simply read the a/d converter where hid maker says put your code here, and it will send the two variables, and flag bit, whenever the pc polls for it? Is the 1mS timing reliable enough for me to measure the weld time from my readings?

    I am kind of thinking that this is how a joystick works. The axes are read maybee a hundred times by its controller, but only the values that are read just before being polled for are sent. Am I correct, or am I misunderstanding how the whole thing works?

    The other option is to read the values, store them in some fast memory, and send them as a block to the pc, once the weld is finished, but this seems to involve more hardware, & much more complex programming.

    Any tips would be very much appreciated, and would probably save me from going miles down the wrong road, a hundred times.

    Best regards
    Bob...

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

    Default

    PC and PIC must comunicate together at least each few mSec to keep communication alive, that's USBSERVICE's job, but you can send your data when you want, the way you want. See USBDemo in code example section, and the famous POST #148 where Darrel gave a way better solution to handle USBSERVICE, save loads of headaches, run in background etc etc etc
    http://www.picbasic.co.uk/forum/show...&postcount=148

    HTH
    Steve

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

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

    Thumbs up

    Quote Originally Posted by mister_e View Post
    PC and PIC must comunicate together at least each few mSec to keep communication alive, that's USBSERVICE's job, but you can send your data when you want, the way you want. See USBDemo in code example section, and the famous POST #148 where Darrel gave a way better solution to handle USBSERVICE, save loads of headaches, run in background etc etc etc
    http://www.picbasic.co.uk/forum/show...&postcount=148

    HTH
    Good one! I should visit this forum more often.

Similar Threads

  1. USB CDC Communications for Dummies!
    By Squibcakes in forum USB
    Replies: 104
    Last Post: - 15th January 2014, 13:43
  2. Simple USB Comms Problem
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th January 2010, 20:17
  3. Basic USB question(s)
    By muddy0409 in forum USB
    Replies: 1
    Last Post: - 20th May 2009, 21:19
  4. USB PIC without USB Connection
    By Tissy in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 26th December 2005, 17:39
  5. General Programmer Questions
    By mslaney in forum General
    Replies: 1
    Last Post: - 17th December 2004, 18:16

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