
EZ-USB FX2 Technical Reference Manual
Page 8-16 EZ-USB FX2 Technical Reference Manual v2.1
For the small endpoints (EP0 and EP1IN/OUT), these conditions are synonymous with the end-
point BUSY bit making a 1-to-0 transition (busy to not-busy). As with all FX2 interrupts, this one is
enabled by writing a “1” to its enable bit, and the interrupt flag by writing a “1” to it.
Do not
attempt to clear an IRQ bit by reading the IRQ register, ORing its contents with a bit mask
(e.g. 00010000), then writing the contents back to the register. Since a “1” clears an IRQ bit, this
clears
all
the asserted IRQ bits rather than just the desired one. Instead, simply write a single “1”
(e.g., 00010000) to the register.
8.6.3.3 USBERRIE, USBERRIRQ, ERRCNTLIM, CLRERRCNT
These registers are used to monitor the “health” of the USB connection between the FX2 and the
host.
USBERRIE
This register contains the interrupt-enable bits for the “Isochronous Endpoint Error” interrupts and
the “USB Error Limit” interrupt.
An “Isochronous Endpoint Error” occurs when the FX2 detects a PID sequencing error for a high-
bandwidth, high-speed ISO endpoint.
USBERRIRQ
This register contains the interrupt flags for the “Isochronous Endpoint Error” interrupts and the
“USB Error Limit” interrupt.
ERRCNTLIM
FX2 firmware sets the USB error limit to any value from 1 to 15 by writing that value to the lower
nibble of this register; when that many USB errors (CRC errors, Invalid PIDs, garbled packets,
etc.) have occurred, the “USB Error Limit” interrupt flag will be set. At power-on-reset, the error
limit defaults to 4 (0100 binary).
The upper nibble of this register contains the current USB error count.
CLRERRCNT
Writing any value to this register clears the error count in the upper nibble of ERRCNTLIM. The
lower nibble of ERRCNTLIM is not affected.
8.6.3.4 TOGCTL
As described in Chapter 1, "Introducing EZ-USB FX2" the host and device maintain a data toggle
bit, which is toggled between data packet transfers. There are certain times when the firmware
must reset an endpoint’s data toggle bit to 0:
Comentarios a estos manuales