Colour Processor Interface ASIC
The SETUP phase contains details of the command being sent to the camera including, the specific command
request, whether the command is a WRITE (host to camera) or READ (camera to host) command and the
number of bytes expected in the DATA phase. (For further information on the SETUP phase please refer to
USB Specification Version 1.0, Section 9.3).
The DATA phase is used to transfer a number of bytes of information associated with the command to the
camera if this is a WRITE command or from the camera if this is a READ command. The DATA phase can
consist of a number of discrete DATA transactions on the bus. With CPiA-based USB cameras, data is
transfered in 8-byte packets with the remaining data bytes transfered in the last data transaction being less
than 8 bytes if the total number of bytes to be transfered is not a multiple of 8. This is because the maximum
packet size of Control Endpoint 0 in CPiA is 8 bytes.
The STATUS phase is used to indicate whether or not all was well with the SETUP and DATA phases and
consequently whether or not the control transfer has completed successfully. If at any time the camera
receives an unrecognised command (for example due to data corruption on the USB) or it cannot process a
valid command for some reason it returns a STALL handshake on the bus to indicate to the host that
something is wrong.
2.2.4.3 USB Device Enumeration
The USB hub detects that a high speed USB device has been dynamically attached to one of its downstream
ports by the presence of a 1.5KOhm pull-up resistor on the D+ differential data line on the upstream port of
the device, as is the case with a CPiA-based USB camera. Before the port to which the camera has been
connected can be enabled the hub ensures that the device is reset. It does this by issuing SE0 reset
signalling on the USB differential data lines for at least 10ms and then enables the port. This causes the
camera to ‘listen’ to USB traffic at bus address 0 until such time as it is assigned its own unique USB bus
address. The camera is ready to respond to host access within 10ms of this reset signalling being de-
asserted. Note that the hub waits a specified delay time after device attach before issuing the reset signalling
to ensure the device’s internal power supply has stabilised.
Now that the camera is listening at bus address 0 the host begins to communicate with the camera. The initial
communications comprise the device enumeration traffic sequence. The host first issues a GetDescriptor
(DEVICE) command (SETUP Packet 80 06 00 01 00 00 40 00) to Control Endpoint 0 (which all USB devices
must support) at bus address 0. The host only receives the first 8 data bytes of the DATA phase of this control
transfer (that is, the first DATA transaction within the DATA phase) before issuing the STATUS phase.
The host then issues a SetAddress command (SETUP Packet 00 05 yz wx 00 00 00 00 where wxyz is the
USB device address) to assign a unique USB bus address to the camera. Following the STATUS phase of a
successful SetAddress command the camera then ‘listens’ and responds to USB traffic at this unique
address only.
The host continues by issuing a GetDescriptor (DEVICE) command (SETUP Packet 80 06 00 01 00 00 12 00).
In response to the GetDescriptor (DEVICE) command the camera returns its DEVICE descriptor which
comprises 18 bytes of information. The DEVICE descriptor describes general information about the USB
device. The table below shows the DEVICE descriptor information returned by a CPiA-based USB camera in
response to the GetDescriptor (DEVICE) command. This information can be checked at device enumeration
time using a USB bus analyser such as the CATC Inspector when debugging a CPiA-based USB camera
design.
Descriptor Field
bLength
bDescriptorType
Size
(bytes)
Value
1
0x12
1
0x01
Description
Size of this descriptor in bytes.
DEVICE Descriptor Type.
V:\apps\cpia\docs\cpia datasheet\cpia_datasheet4.fm
02/07/98
17
Commercial In Confidence