1
00:00:00,120 --> 00:00:09,690
Control transfer, this is a very, very important USB TransFair or endpoint type, because control

2
00:00:09,690 --> 00:00:16,210
TransFair, as we mentioned before, is used to configure the device to be able to work properly.

3
00:00:16,380 --> 00:00:23,880
So the first type of transfers you will be doing at the very early stage when configuring or USB device

4
00:00:23,880 --> 00:00:28,000
and negotiating with the host will be control transfers.

5
00:00:28,140 --> 00:00:31,150
So let's go through control transfer in details.

6
00:00:31,170 --> 00:00:35,340
It has a bit more information in comparison with the other transfers.

7
00:00:35,550 --> 00:00:41,190
However, when you understand this correctly, it will be very easy to control.

8
00:00:41,190 --> 00:00:47,050
Transfer is an unpatriotic transfer so it doesn't happen regularly.

9
00:00:47,070 --> 00:00:52,990
This happens only on need control, transfer guarantees, error-free transfer.

10
00:00:53,010 --> 00:00:55,440
So it has handshaking, in other words.

11
00:00:55,950 --> 00:01:03,330
And control transfer is used to to transfer device enumeration and configuration packets.

12
00:01:03,780 --> 00:01:08,340
And this is what we have just mentioned in the very early stage.

13
00:01:08,340 --> 00:01:15,750
When you connect your USB device to the to the USB port in the host USB enumeration process will start

14
00:01:15,750 --> 00:01:22,520
and the negotiation between the device and the host will happen by sending USB control transfers.

15
00:01:22,530 --> 00:01:30,810
And again, we mention this officially for end point zero and point zero must be configured to be a

16
00:01:30,810 --> 00:01:32,760
control end point.

17
00:01:33,390 --> 00:01:39,720
So it will send and receive control transfers in both directions because.

18
00:01:40,650 --> 00:01:48,870
When you connect your USB device to the USB port in the host, USB enumeration process will start and

19
00:01:48,870 --> 00:01:55,590
the negotiation between the device and the host will happen on the end point zero, which must be control

20
00:01:55,590 --> 00:02:03,390
end point because the host will try to request some data about our device through that endpoint zero,

21
00:02:03,690 --> 00:02:07,470
or it will try to send some data to our device.

22
00:02:07,470 --> 00:02:13,740
Or we can also say it will try to tell our device to change or to set some of its configuration on the

23
00:02:13,740 --> 00:02:15,290
out end point zero.

24
00:02:15,540 --> 00:02:23,100
And because this is configuration related information, it must happen on an control end point and its

25
00:02:23,100 --> 00:02:30,390
end point zero because it's just the default control end point in every USB device and therefore USB

26
00:02:30,390 --> 00:02:38,130
device enumeration happens happens always on end point zero, the maximum data payload in control transfer

27
00:02:38,130 --> 00:02:41,670
is eight, 16, 32 or 64 bytes.

28
00:02:41,670 --> 00:02:43,770
I haven't mentioned the unit here.

29
00:02:44,430 --> 00:02:50,220
This is for full speed devices and it's 64 bytes for high speed devices.

30
00:02:51,140 --> 00:02:57,300
Now we are going to talk about a very, very, very important part of control transfer.

31
00:02:58,130 --> 00:03:06,380
I hope that you noticed that all other transfers we talked about so interrupt, transfer, bulk transfer

32
00:03:06,380 --> 00:03:11,390
and transfer, all of them consist of a single transaction.

33
00:03:11,600 --> 00:03:20,030
So one interrupt transfer consists of only one single transaction, the same for bulk transfer.

34
00:03:20,030 --> 00:03:25,630
It consists only of one bulk transaction and the same for ISO Cronos.

35
00:03:25,970 --> 00:03:35,180
However, control transfer consists of multiple transactions and these transactions are divided into

36
00:03:35,180 --> 00:03:36,270
three stages.

37
00:03:36,530 --> 00:03:44,780
So again, one single control transfer consists of multiple transactions as opposed to the other USPI

38
00:03:44,780 --> 00:03:45,800
transfer types.

39
00:03:46,010 --> 00:03:53,300
So control transfer consists of multiple transactions and these transactions are divided into three

40
00:03:53,300 --> 00:03:54,020
stages.

41
00:03:54,350 --> 00:04:03,710
The first stage of a controlled transfer is called set up stage and set up stage has one transaction.

42
00:04:03,710 --> 00:04:06,350
And here, please notice to not be confused.

43
00:04:06,680 --> 00:04:12,560
Here we are talking about set up stage, which has one transaction in it.

44
00:04:12,560 --> 00:04:20,240
So it has three packets in it, a token packet which is set up, token packet in this case, and then

45
00:04:20,240 --> 00:04:22,940
data packet and then handshake packet.

46
00:04:23,480 --> 00:04:26,500
We will see these packets in details later.

47
00:04:26,670 --> 00:04:34,660
So setup stage is not one packet set up stage is one transaction, which means it has three packets.

48
00:04:35,030 --> 00:04:40,640
The second stage in control transfer is called data stage.

49
00:04:41,150 --> 00:04:49,340
They the stage is optional, which means that the stage can have zero to multiple transactions in it.

50
00:04:49,460 --> 00:04:56,330
So in more details in data stage, we do some data transmitting in the direction from the device to

51
00:04:56,330 --> 00:04:56,960
the whole store.

52
00:04:57,110 --> 00:05:03,410
So in the indirection or in the direction from the horse to the device or in the out direction, but

53
00:05:03,500 --> 00:05:04,370
it's optional.

54
00:05:04,370 --> 00:05:08,060
It depends on the control transfer we want to achieve.

55
00:05:08,270 --> 00:05:15,050
We can have zero to multiple out or end data transactions in data stage.

56
00:05:15,420 --> 00:05:18,980
And again, we will explain this in more detail in the next slide.

57
00:05:19,370 --> 00:05:24,650
And the third USP control transfer stage is called status stage.

58
00:05:25,870 --> 00:05:29,800
Status stage has only one transaction in it.

59
00:05:30,280 --> 00:05:38,440
This is just as same as acknowledging or let's say signaling that a controlled transfer is now finished

60
00:05:38,950 --> 00:05:42,430
and it has one transaction in it.

61
00:05:43,390 --> 00:05:53,050
So let me repeat this last time a controlled transfer consists of multiple transactions, these transactions

62
00:05:53,050 --> 00:05:54,910
are divided into three stages.

63
00:05:55,120 --> 00:05:59,440
Stage one is the set up stage, which has one transaction in it.

64
00:06:00,380 --> 00:06:04,370
Namely, it has three packets in it, the next stage is.

65
00:06:05,380 --> 00:06:13,210
Data stage, it has from zero to multiple data transmitting transactions, either in the direction in

66
00:06:13,210 --> 00:06:14,880
or out doesn't matter.

67
00:06:15,220 --> 00:06:19,690
We have we can have zero to multiple transactions in the data stage.

68
00:06:19,840 --> 00:06:24,550
And the final stage in control transfer is called status stage.

69
00:06:24,700 --> 00:06:26,740
It has one transaction in it.

70
00:06:28,050 --> 00:06:34,980
Hopefully, this theoretical introduction to the control transfer stages was simple.

71
00:06:36,100 --> 00:06:36,840
Don't worry.

72
00:06:36,880 --> 00:06:41,800
Right now, in the next slide, we will explain this in more details on three nice figures.

