Usb Serial Interface Engine

usb serial interface engine

USB has become a popular interface for exchanging data between PC s and peripherals. An increasing number of portable peripherals are using the USB interface to.

In the USB FAQ regarding error detection in USB protocol, it was given as follows.

SS_GET_PAGE nodeId 2651 param en534460 P189_15342

12. How does USB protocol detect an error in communication.

USB protocol detects error using CRC Cyclic Redundancy Check. This is done by the SIE Serial Interface Engine, thus eliminating the need of CRC check in software and reduces the software overhead. For token packet CRC is 5 bit data packet CRC is 16 bits.

13. What happens if the SIE receives data that is corrupted.

The SIE discards the corrupt packet if the packet fails the CRC checks. No software intervention is required. An error flag is set indicating that a corrupted packet was received. The SIE will not ACK packets that have incorrect CRC values. For interrupt, bulk, and control transfers the host will try to retransmit the packet if it fails to receive the ACK. In this way these transmissions will not have data loss due to a corrupted packet but may suffer from lower application bandwidth.

Can anyone help me with info on SIE, its flags and how CRC is implemented in the PIC18 USB framework.

define USB_ENDPOINT_ERROR_CRC16                0x24    // USB Module - CRC16 failure.

This error code value was listed in usb_common.h

Hmm, from you quote above and what I used to know too, the CRC errors are handled in hardware SIE and hence not visible and maybe not even available to the user software

Rule of thumb: Always read inputs from PORTx and write outputs to LATx. If you need to read what you set an output to, read LATx.

SIE reports CRC error to U1EIR PIC32, PIC24 or UEIR PIC18, USB ERROR INTERRUPT STATUS

PIC SIE s CRC implementation should follow this document from USB.org

USB-IF Technical White Papers - Cyclic Redundancy Checks in USB

Thanks guys. That was very helpful.

Any references to serial interface engine basics.

This webpage explains bus signaling well

USB Made Simple, Part 3 - Data Flow

USB spec defines the SIE process in details. Therefore, the implementation of SIE for the bus side is almost same among USB MCUs. But the SIE interface to the firmware ie. registers is implementation-specific.

Here is a brief explanation, supplement of PIC datasheet.

Roughly speaking, SIE has two major roles,

1 Packet decoding, and automatic response to transaction

1 Packet decoding - transaction response

USB PHY shapes incoming bus signaling using 4x over-sampling DPLL for full-/low-speed. NRZI decode and bit-unstuff is applied to the incoming signaling. SIE detects SYNC pattern at the start of every packet from this signaling. After a SYNC pattern, a PID Packet ID field follows. The next fields after PID depend on its PID value. An EOP concludes the packet.

In this way, a packet is decoded by SIE. Many protocol errors, including CRC, are checked in this process UEIR.

When SIE puts a packet, it is encoded using bit-stuffing and NRZI, before the packet is sent to the bus.

A transaction starts with a SETUP, OUT or IN packet Token packets coming from host. One or two packets follow a token packet in a transaction. The timing of these packets in a transaction is tightly tied together by the USB spec. Therefore, SIE automatically responds to token packets according to the endpoint status, set by the firmware beforehand. In other word, a transaction is fully processed by SIE.

After Seeing a SETUP and a DATA0 packet from host,

- If the SETUP or DATA0 packet is corrupted, SIE gives no response to host.

- If the device address of the SETUP packet doesn t match to this one UADDR, SIE ignores this packet.

- If the default endpoint is not enabled UEP0.EPCONDIS. EPOUTEN. EPINEN, SIE gives no response to host protocol error.

- If the default endpoint is not armed BD0STAT.UOWN for EP0 OUT, SIE returns no response to host. This is spec violation. The firmware should manage this endpoint, so that this accident doesn t occur.

- If the endpoint is armed, an ACK packet is sent by SIE. The 8 bytes SETUP data is stored to the buffer, specified by BD0ADRH:BD0ADRL, BD0CNT for EP0 OUT. And SIE notifies firmware of the transaction completion UOWN, UIR.TRNIF, UCON.PKTDIS. Until firmware drops PKTDIS bit, all endpoints return NAK to IN/OUT transactions.

After Seeing an OUT and a DATA packet from host,

- If the OUT or DATA packet is corrupted, SIE gives no response to host.

- If the device address of the OUT packet doesn t match to this one UADDR, SIE ignores this packet.

- If the target endpoint is not enabled UEPn.EPOUTEN, SIE gives no response to host protocol error.

- If the endpoint is not armed BDnSTAT.UOWN for EPn OUT, SIE returns a NAK packet to host. Firmware is notified of nothing.

- If the endpoint is armed, an ACK packet is sent by SIE, for a control/interrupt/bulk endpoint UEPn.EPHSHK. The data is stored to the buffer, specified by BDnADRH:BDnADRL, BDnCNT for EPn OUT. And it notifies firmware of the transaction completion UOWN and UIR.TRNIF. For an isoc endpoint, no ACK is put by SIE. SIE notifies firmware at the end of DATA packet.

- If STALL bit is enabled BDnSTAT.BSTALL, a STALL packet is sent to host. Firmware is notified UEPn.EPSTALL, UIR.STALLIF

After Seeing an IN packet from host,

- If the IN packet is corrupted, SIE gives no response to host.

- If the device address of the IN packet doesn t match to this one UADDR, SIE ignores this packet.

- If the target endpoint is not enabled UEPn.EPINEN, SIE gives no response to host protocol error.

- If the endpoint is not armed BDnSTAT.UOWN, SIE returns a NAK packet to host. Firmware is notified of nothing.

- If the endpoint is armed, a DATA packet is sent by SIE. The data is sent from the buffer, specified by BDnADRH:BDnADRL, BDnCNT for EPn IN. For a control/interrupt/bulk endpoint, SIE expects ACK packet from host. When SIE gets a ACK packet successfully, it notifies firmware of the transaction completion UOWN and UIR.TRNIF. For an isoc endpoint, no ACK comes from host. SIE notifies at the end of DATA packet output.

In above explanation, I didn t touch to data toggle, to make it simple.

For data toggle, refer to BDnSTAT.DTS and DTSEN of the PIC datasheet.

Also, see these sections of the USB2.0 spec

8.6 Data Toggle Synchronization and Retry

These bus events are monitored by SIE

SIE notifies firmware of these events at detection.

- Suspend and Resume UIR.IDLEIF. ACTVIF

Also, SIE may put Remote Wakeup signaling by firmware request UCON.RESUME.

post edited by chinzei - 2012/04/18 :49.

Draft 1 DESIGNING A ROBUST USB SERIAL INTERFACE ENGINE SIE What is the SIE. A typical function USB hardware interface is shown in Fig. 1. USB.

USB Serial Interface Engine (SIE) - Error detection in USB protocol

Great but Cheap Usb Serial Interface Engine, Cheap Electronic Components Supplies,Integrated Circuits,Computer Office,Industry Science, as well as Cheap.

usb serial interface engine

Part 3

Buy Usb Serial Interface Engine from Reliable China Usb Serial Interface Engine suppliers.Find Quality Usb Serial Interface Engine Electronic Components.

RS-232 to USB,but the aim is to perform this switch with a 3.3V voltage regulator and the Serial Interface Engine with Digital Phase Locked Loop and 48 MHz.

SIE Serial Interface Engine DESIGNING A ROBUST USB SERIAL INTERFACE ENGINE SIE page revision: 6, last edited: 01 Nov 2012 .

to the right illustrate the possible flow of events in the

IN token packet is not recognised, the device will not respond

at all. Otherwise, if it has data to send it will send it

in a DATA0 or DATA1 packet, If it is not ready to send data

it will send a NAK packet. If the endpoint is currently halted

then it will respond with a STALL packet.

case of DATA0/1 being sent, the host will acknowledge with

an ACK, unless the data is not validly received, in which

case it does not send an ACK. Note: the host never sends

OUT token packet is not recognised, the device will not respond

at all. It will then ignore the DATAx packet because it does

not know that it has been addressed.

OUT token is recognised but the DATAx packet is not recognised,

then the device will not respond.

data is received but the device can t accept it at this time,

it will send a NAK, and if the endpoint is currently halted,