Author Topic: When to toggle the data toggle bit ?  (Read 11515 times)

erdmann

  • Member
  • ***
  • Posts: 43
When to toggle the data toggle bit ?
« on: July 04, 2013, 08:47:24 am »
I wonder if toggling the data toggle bit has to continue over the whole "lifeline" of a pipe or if I only need to toggle between all the packets that make up one single transfer.

Consider this: I set up an interrupt transfer for a hub's status pipe:
for each new interrupt transfer that I set up, can I reset the data toggle bit to zero or do I need to continue to toggle the data toggle bit across multiple transfers (each transfer being independent) ?

As far as I understand such an interrupt transfer for the status pipe will finish if some change in status is detected on at least 1 port of the hub and looking into the USB 2.0 and USB 3.0 spec, the data to be transmitted is only 2 bytes (for the maximum of 15 ports) and therefore will only require 1 packet for the data transfer.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: When to toggle the data toggle bit ?
« Reply #1 on: July 04, 2013, 10:34:37 am »
From my book USB Complete:

Bulk endpoints toggle the value in every transaction, resetting the data toggle only after completing a Set Configuration, Set Interface, or Clear Feature(ENDPOINT_HALT) request. Interrupt endpoints can behave the same as bulk endpoints. Or to simplify processing with the risk of losing some data, an interrupt IN endpoint can toggle
its data toggle in each transaction without checking for the host’s ACK.

In the USB 2.0 spec, see 5.75 and 9.45.

erdmann

  • Member
  • ***
  • Posts: 43
Re: When to toggle the data toggle bit ?
« Reply #2 on: July 08, 2013, 08:19:23 am »
Oops. Thanks. I missed that in the spec ...

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: When to toggle the data toggle bit ?
« Reply #3 on: July 08, 2013, 09:56:40 am »
It's kind of buried in the spec, hard to find.