Section 5. usb – MagTek MCP User Manual

Page 47

Advertising
background image

41

SECTION 5. USB


This protocol can work as is with a RS-232 interface. However, the protocol needs to be adapted
slightly to work with a USB interface. This section explains how to adapt this protocol to work
with a USB interface. Everything mentioned in the preceding sections apply to the USB
interface except what is pointed out in this section.

The serial transport protocol is effectively “tunneled” over the USB.

The baud synchronization S-frame command is not used with USB.

The character wait timeout is handled slightly differently. The period is measured from the time
a USB packet is received to the time the next USB packet is received. Devices will use a
minimum CWT value of 100ms.

The device shall support Full speed USB.

The protocol will be implemented on the following three pipes.

The device shall contain 1 bulk out pipe. The host shall use this pipe to transmit frames. The
device shall use this pipe to receive frames.

The device shall contain 1 bulk in pipe. The host shall use this pipe to receive frames. The
device shall use this pipe to transmit frames.

The device shall contain 1 interrupt in pipe. The host shall poll this pipe periodically to
determine if the device is ready to transmit a frame. The device shall transmit one null packet on
this pipe when it is ready to transmit a frame otherwise it will send a NAK. After the host
receives this null packet it shall read the frame from the bulk in pipe. The host should not try to
read the frame from the bulk in pipe until it receives the null packet on the interrupt in pipe. The
host shall use the polling interval specified in the devices interrupt in endpoint descriptor for the
polling frequency for this pipe. Typically this interval will be 10ms but it may vary on some
devices.

Since different USB peripheral hardware has different endpoint number assignment limitations,
the endpoint numbers that these pipes are assigned to could vary from device to device. These
endpoint number assignments could even vary between different device revisions with the same
model number. Therefore the host should use the transfer type and transfer direction to identify
the proper pipes to use for this protocol and not the endpoint numbers.

The host shall use the maximum packet size specified in the pipes endpoint descriptors. This
size may vary from one device to another.

All devices shall use vendor identifier 0x0801.

Advertising