Datasheet

PIC16C745/765
DS41124D-page 62 Preliminary 1999-2013 Microchip Technology Inc.
10.5.1.3 USB Error Interrupt Status Register (UEIR)
The USB Error Interrupt Status Register (UEIR) con-
tains bits for each of the error sources within the USB.
Each of these bits are enabled by their respective
error enable bits (UEIE). The result is OR'ed together
and sent to the ERROR bit of the UIR register. Once
an interrupt bit has been set it must be cleared by writ-
ing a zero to the respective interrupt bit. Each bit is set
as soon as the error condition is detected. Thus, the
interrupt will typically not correspond with the end of a
token being processed.
REGISTER 10-3: USB ERROR INTERRUPT FLAGS STATUS REGISTER (UEIR: 192h)
R/C-0 R/C-0 R/C-0 R/C-0 R/C-0 R/C-0 R/C-0 R/C-0
BTS_ERR OWN_ERR WRT_ERR BTO_ERR DFN8 CRC16 CRC5 PID_ERR R = Readable bit
C = Clearable bit
U = Unimplemented
bit, read as ‘0’
-n = Value at POR
reset
bit7 bit0
bit 7: BTS_ERR: A bit stuff error has been detected
bit 6: OWN_ERR: This bit is set if the USB is processing a token and the OWN bit within the BDT is equal to 0
(signifying that the microprocessor owns the BDT and the SIE does not have access to the BDT). If process-
ing an IN TOKEN this would cause a transmit data underflow condition. Processing an OUT or SETUP
TOKEN would cause a receive data overflow condition.
bit 5: WRT_ERR: Write Error
A write by the MCU to the USB Buffer Descriptor Table or Buffer area was unsuccessful. This error occurs
when the MCU attempts to write to the same location that is currently being written to by the SIE.
bit 4: BTO_ERR: This bit is set if a bus turnaround time-out error has occurred. This USB uses a bus turnaround
timer to keep track of the amount of time elapsed between the token and data phases of a SETUP or OUT
TOKEN or the data and handshake phases of a IN TOKEN. If more than 17-bit times are counted from the
previous EOP before a transition from IDLE, a bus turnaround time-out error will occur.
bit 3: DFN8: The data field received was not 8 bits. The USB Specification 1.1 specifies that data field must be an
integral number of bytes. If the data field was not an integral number of bytes this bit will be set.
bit 2: CRC16: The CRC16 failed
bit 1: CRC5: This interrupt will detect CRC5 error in the token packets generated by the host. If set the token
packet was rejected due to a CRC5 error.
bit 0: PID_ERR: The PID check field failed
Note 1: Bits can only be modified when UCTRL.SUSPND = 0.