Author Topic: USB communication limits?  (Read 4291 times)

vbsaltydog

  • Newbie
  • *
  • Posts: 5
USB communication limits?
« on: October 08, 2014, 04:31:58 pm »
The digispark literature says that the USB connection can be used to program the chip but it says that USB is otherwise limited.
What are the USB communication limitations?

I need to poll the digispark regularly via USB to get values from sensors and to send control values for motor control.

I plan to do this using Arduino serial commands such as those outlined here:
http://playground.arduino.cc/Interfacing/LinuxTTY

Does the digispark support bidirectional USB serial communication beyond that of the IDE for programming/flashing?

Thanks

DeuxVis

  • Full Member
  • ***
  • Posts: 107
Re: USB communication limits?
« Reply #1 on: October 09, 2014, 01:03:13 am »
Have a look at the "Using the Digispark's USB features" section in the digispark wiki : http://digistump.com/wiki/digispark

Maybe also play with the various USB sample sketchs.

vbsaltydog

  • Newbie
  • *
  • Posts: 5
Re: USB communication limits?
« Reply #2 on: October 09, 2014, 07:47:49 pm »
Thanks.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: USB communication limits?
« Reply #3 on: October 10, 2014, 06:51:24 am »
Yes, there are some examples to be found on the Wiki and here in the forums, if you search. Maybe some kind soul will spend some time giving the wiki some love one day, and organize some of the common question/answer info from the forums on there. Wish I had time to work on it myself.

The DigiUSB library has 'read' and 'write' methods that can do two-way low-level communications. There are examples in python, ruby and C++ of how to do this USB communication on the host side. I've done low-level HID communications between the DigiSpark and my MacBookPro using nodejs and the node-hid library. Though I believe I did have to make a slight modification to the DigiUSB library:

http://digistump.com/board/index.php/topic,1178.msg5130.html#msg5130

There's also the 'CDC (Serial over USB)' library in the works... I haven't played with that yet, myself:

http://digistump.com/board/index.php/topic,1519.0.html

vbsaltydog

  • Newbie
  • *
  • Posts: 5
Re: USB communication limits?
« Reply #4 on: October 10, 2014, 05:28:06 pm »
Useful info. Thank you.