Universal Serial Bus
M30240 Group
Rev.1.00 Sep 24, 2003 Page 327 of 360
• Example of USB Function Interrupt
• Do not use Read Modify Write instructions on the following USB Control and Status registers:
• USB Endpoint 0 Control and Status (EP0CS)
• USB Endpoint x IN Control and Status (EPxICS)
• USB Endpoint x OUT Control and Status (EPxOCS)
Refer to Chapter 1, Section 1.5 for more information on these registers and how to modify their contents.
C Language
ram1=USBIS1;
/*Read from USB Interrupt Status register 1*/
ram2=USBIS2;
/*Read from USB Interrupt Status register 2*/
ram2 &=0x1F;
/*Mask flags except USB Function Interrupt status flags*/
USBIS1=ram1;
/*Write to USB Interrupt Status register 1*/
USBIS2=ram2;
/*Write to USB Interrupt Status register 2*/
Assembly Language:
mov.b USBIS1, ram1
;*Read from USB Interrupt Status register 1*
mov.b USBIS2, ram2
;*Read from USB Interrupt Status register 2*
and.b #1Fh, ram2
;*Mask flags except USB Function Interrupt status flags*
mov.b ram1, USBIS1
;*Write to USB Interrupt Status register 1*
mov.b ram2, USBIS2
;*Write to USB Interrupt Status register 2*