Interrupt Service Routine (ISR) Flowcharts
13-90
Figure 13–16. Parse Command Routine (Setup Stage Control Transfer Request)
Parse command routine
End of parse command
routine
Read byte from DATA
register.
Save bmRequest type
byte.
Read byte from DATA
register.
Save bRequest byte.
Read byte from DATA
register.
Save (LS) byte of
wValue.
Read byte from DATA
register.
Save (MS) byte of
wValue.
Read byte from DATA
register.
Save (LS) byte of
windex.
Read byte from DATA
register.
Save (MS) byte of
windex.
Read byte from DATA
register.
Save (LS) byte of
wLength.
Read byte from DATA
register.
Save (MS) byte of
wLength.
Write EP_NUM register:
– EP_NUM.EP_Num = 0
– EP_NUM.EP_Dir = 0
– EP_NUM.EP_Sel = 0
– EP_NUM.Setup_Sel = 1
This clears the
IRQ_SRC.Setup bit.
Write EP_NUM register:
– EP_NUM.EP_Num = 0
– EP_NUM.EP_Dir = 0
– EP_NUM.EP_Sel = 0
– EP_NUM.Setup_Sel = 0
IRQ_SRC.
Setup = 0?
Yes
A new setup transaction
has been received while
the LH was reading setup
data. The LH must handle
new setup data.
Discard
setup data
No