User manual

...the world's most energy friendly microcontrollers
2012-04-24 - Giant Gecko Family - d0053_Rev0.96 266
www.energymicro.com
Figure 15.14. Interrupt Service Routine for Bulk/Control OUT Transaction in DMA Mode
Interrupt
?
No
yes
Start
Yes,
No
/
No
Yes
No
Deallocate
Channel
Yes
Yes
Yes,
No
USB_HCx_INT.
ACK = 1?
USB_HCx_INT.XACTERR = 1
USB_HCx_INT.XFERCOMPL = 1
USB_HCx_INT.STALL = 1 or
USB_HCx_INT.ACK = 1
USB_HCx_INT.NAK = 1
Reset Err_cnt
Err_cnt =
Err_cnt + 1
Err_cnt = =
3 ?
1. Reprogram
Buffer pointers
2. Re-initialize
Channel
1. Err_cnt = 1
2. Re-initialize
channel
3. Reprogram
Buffer pointers
1. Reset Err_cnt
2. Deallocate
channel
Service based on the
other interrupt status
bits namely: AHBERR,
FRMOVRERR,
BBLERR and
DATATGLERR
Unm asked the required
USB_HAINTMSK and
USB_HCx_INTMSK status
bits
Read USB_HAINT to
determ ine the channel
which caused the
Interrupt and read the
corresponding USB_HCx_INT
USB_HCx_INT.
CHHLTD = 1 ?
In Figure 15.14 (p. 266) that the Interrupt Service Routine is not required to handle NAK responses.
This is the difference of proposed flow with respect to current flow. Similar flow is applicable for Control
flow also.
The NAK status bits in USB_HCx_INT registers are updated. The application can unmask these
interrupts when it requires the core to generate an interrupt for NAK. The NAK status is updated because
during Xact_err scenarios, this status provides a means for the application to determine whether the
Xact_err occurred three times consecutively or there were NAK responses in between two Xact_err.
This provides a mechanism for the application to reset the error counter accordingly. The application