
EZ-USB FX2 Technical Reference Manual
Page 4-12 EZ-USB FX2 Technical Reference Manual v2.1
Figure 4-2 illustrates a typical USB ISR for endpoint 2-IN.
Figure 4-2. The Order of Clearing Interrupt Requests is Important
The registers associated with the individual USB interrupt sources are described in Chapter 15,
"Registers" and Section 8.6, "CPU Control of FX2 Endpoints". Each interrupt source has an
enable (IE) and a request (IRQ) bit. Firmware sets the IE bit to 1 to enable the interrupt. The FX2
sets an IRQ bit to 1 to request an interrupt, and the firmware clears an IRQ bit by writing a “1” to it.
4.4.2.1 SUTOK, SUDAV Interrupts
Figure 4-3. SUTOK and SUDAV Interrupts
USB_ISR: push dps
push dpl
push dph
push dpl1
push dph1
push acc
;
mov a,EXIF ; FIRST clear the USB (INT2) interrupt request
clr acc.4
mov EXIF,a ; Note: EXIF reg is not bit-addressable
;
mov dptr,#USBERRIRQ ; now clear the USB interrupt request
mov a,#10000000b ; use EP8ISOERR as example
movx @dptr,a
;
; (service the interrupt here)
;
pop acc
pop dph1
pop dpl1
pop dph
pop dpl
pop dps
;
reti
D
A
T
A
0
8 bytes
Setup
Data
C
R
C
1
6
Data Packet
A
C
K
H/S Pkt
S
E
T
U
P
A
D
D
R
E
N
D
P
C
R
C
5
Token Packet
SETUP Stage
SUTOK
Interrupt
SUDAV
Interrupt
Kommentare zu diesen Handbüchern