Using Generic USB Controllers
signals and other status information. In the notification, wValue = 0x0000,
wLength = 0x0002, and the returned data has this format:
;
3
Firmware and host-application programmers can do much to ensure efficient
data transfers for CDC USB virtual COM-port devices.
These are issues that effect the performance of device firmware:
- Set wMaxPacketSize in the bulk endpoint descriptors to 64 (recommended)
for full speed or 512 (required) for high speed. These sizes enable transfer-
ring the most data possible in each USB transaction. Plus, if a full-speed
bulk endpoint’s wMaxPacketSize is less than 64, some USB host controllers
(UHCI type) will schedule no more than one transaction per millisecond for
the endpoint. - To transfer large amounts of data to the host as quickly as possible, use
wMaxPacketSize data packets. Larger packets mean fewer transactions are
needed to transfer the data. - When sending data to the host in multiple transactions, avoiding returning
NAK. Immediately after sending a packet of data, refill the endpoint buffer
and arm the endpoint for the next transaction. For the fastest response, con-
figure the endpoint to cause an interrupt after sending data. - When receiving data from the host, avoid returning NAK. Immediately
after receiving a packet of data, retrieve the data from the endpoint buffer
and arm the endpoint for the next transaction. For the fastest response, con-
figure the endpoint to cause an interrupt on receiving data.
On the host, be aware that writing to control lines or changing the parity type
or other parameters can be slow compared to performing the same operations
1
15..7 -- Reserved.
6 bOverRun Received data has been discarded
due to an overrun in the device.
5 bParity A parity error has occurred.
4bFraming A framing error has occurred.
3 bRingSignal State of ring indicator (RI).
2bBreak Break state.
1 bTxCarrier State of data set ready (DSR).
0 bRxCarrier State of carrier detect (CD).