USB Transactions
13-55
USB Function Module
Non-Acknowledged Transactions (NAK)
The device can be configured via the Nak_En bit, either to inform the local host
of a NAKed transaction or not. If the NAK_EN bit is cleared, no interrupt is
asserted to the local host if an OUT transaction completes with a NAK hand-
shake and the NAK bit not set. If the Nak_En bit is set, the USB module issues
an endpoint-specific interrupt to the local host at completion of an OUT trans-
action to an endpoint and the NAK bit is set. In response to the endpoint inter-
rupt, the local host must read EPN_STAT register to identify the endpoint caus-
ing the interrupt then write a 1 to the interrupt bit to clear it. The local host must
set EP_Num to the endpoint number and EP_Sel to 1 then read the endpoint
status. The NAK bit is set to indicate that the endpoint received a transaction
to which the USB module signaled NAK handshaking.
The local host must set the Set_FIFO_En bit to allow the next USB OUT
transaction to the endpoint to be placed into the RX FIFO and then clear the
EP_Sel bit. This clears the NAK bit for this endpoint and allows the next trans-
action status to be written to the STAT_FLG register.
13.3.1.2
Non-Isochronous, Non-Control OUT Transaction Error Conditions
STALLed Transactions
The USB module responds to an endpoint OUT transaction with a STALL
handshake to indicate an error condition on the endpoint either if the end-
point’s EP_Halted bit is set or if a request error occurs (control transactions
only). When an endpoint OUT transaction is given a STALL handshake, the
endpoint’s STALL bit is set and an endpoint-specific interrupt is generated for
the endpoint. The FIFO_En bit is of lower priority than the EP_Halted; when
the EP_Halted bit is set, transactions to the RX endpoint are stalled, regard-
less of the FIFO_En value. If the FIFO_En bit is set, the FIFO_En bit is auto-
matically cleared at the end of the STALLed transaction, and RX FIFO is
cleared.
In response to the endpoint interrupt, the local host must read EPN_STAT reg-
ister to identify the endpoint causing the interrupt, then write a 1 to the interrupt
bit to clear it. The local host must set EP_Num to the endpoint number and
EP_Sel to 1, then read the endpoint status. The STALL bit is set to indicate that
the endpoint received a transaction to which the USB module signaled STALL
handshaking.
If the EP_Halted has been set by the local host and can be removed, the local
host must set the Clr_Halt to clear the condition and set the Set_FIFO_En to
allow the next USB OUT transaction to the endpoint to be placed into the RX