PDA

View Full Version : General USB questions



BobEdge
- 20th April 2009, 17:17
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...

mister_e
- 20th April 2009, 18:07
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/showpost.php?p=30682&postcount=148

HTH

Squibcakes
- 21st April 2009, 05:19
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/showpost.php?p=30682&postcount=148

HTH

Good one! I should visit this forum more often.