Interrupt Service Routine (ISR) Flowcharts
13-92
Figure 13–17. Endpoint 0 RX Interrupt Handler
Endpoint 0 RX handler
End of endpoint 0 RX
handler
Decrement
wlength_count value by
nb of received bytes.
STAT_FLG.
ACK bit set?
Control
read flag set
?
Application-
specific actions
to complete
control read
Read non-ISO RX
FIFO data.
wlength_count
> 0?
Ready to
receive more
data?
Set
CTRL.Set_FIFO_En bit
to 1.
Prepare for
control write
status stage
Want to stall
the command
Want to go
out of the ISR
?
Enable NAK interrupt
by setting
SYSCON1.Nak_En bit
to 1 if not enabled.
Wait until ready to
receive data.
Set
SYSCON2.Stall_cmd
bit to stall the
command.
Is LH-initiated stall
and can remove halt
condition?
Set CTRL.Clr_Halt
bit to 1.
Application
specific action
to resolve stall
No
Yes
Yes
Yes
No
If control write data stage (OUT
transactions on EP0) is out of control,
write data stage and control read
status stage are automatically
stalled by the core.
Yes
wlength_count is 0 (OUT
transactions with more bytes
than expected are
automatically stalled by the
core).
Yes
No
No
Yes
Yes
No. Must be STAT_FLG.STALL.
Write EP_NUM register:
– EP_NUM.EP_Num = 0
– EP_NUM.EP_Dir = 0
– EP_NUM.EP_Sel = 1
– EP_NUM.Setup_Sel = 0
No
Write EP_NUM register:
– EP_NUM.EP_Num = 0
– EP_NUM.EP_Dir = 0
– EP_NUM.EP_Sel = 0
– EP_NUM.Setup_Sel = 0
Write EP_NUM register:
– EP_NUM.EP_Num = 0
– EP_NUM.EP_Dir = 0
– EP_NUM.EP_Sel = 0
– EP_NUM.Setup_Sel = 0
Write EP_NUM register:
– EP_NUM.EP_Num = 0
– EP_NUM.EP_Dir = 0
– EP_NUM.EP_Sel = 0
– EP_NUM.Setup_Sel = 0
?