
Interrupts
9
System Level Solutions
January 2013
USB 2.0 (USB20SR) Device IP Core User Guide
Figure 3-2. Data Organization
The buffer pointer always point to byte 0. The USB core always fetches four
bytes from the buffer memory. The actual final byte that is transmitted in the
N
th
transaction depends on the Buffer Size. The MaxPacketSize must always
be a multiple of 4 bytes.
Interrupts
The USB core provides interrupt outputs. The output is fully programmable.
The usage of the interrupt is up to the system into which the USB core is
incorporated.
The interrupt mechanism in the USB core consists of a two level hierarchy:
1.
The main interrupt source register
(INT_SRC) indicates interrupts
that are endpoint independent. These interrupts indicate overall events
that have either global meaning for all endpoints or can not be associated
with an endpoint because of an error condition.
2.
The endpoint interrupt source register
indicates events that are
specific to an endpoint.
Timing
The interrupt output are asserted when the condition that is enabled in the
interrupt mask occurs. They remain asserted until the main interrupt register
is read.
Software Interaction
An interrupt handler should first read the main interrupt source register
(INT_SRC) to determine the source of an interrupt. It must remember the
value that was read until it is done processing of each interrupt source. If any
of the bits 15 to 0 are set, the interrupt handler should also read the appropriate
Config/ Status Bits
Interrupt Mask
Buffer 0 Pointer
Buffer 1 Pointer
EPn _CSR:
EPn_IMS:
EPn_BUF0:
EPn_BUF1:
Interrupt Source
Buffer 1 Size
Used Bit
Used Bit
0
16
17
30
31
Buffer 0 Size