2 cautions when using interrupts – NEC switch User Manual

Page 129

Advertising
background image

CHAPTER 8 USB FUNCTION

User’s Manual U12978EJ3V0UD

129

8.6.2 Cautions when using interrupts

Pay attention to the following when using an interrupt request generated by the USB function.

(1) Because USBREIF is set by transition from the J state to the K state on the bus, it is also set during sync

detection or packet reception. Thus, disable the generation of interrupt requests by setting the interrupt mask

flag (USBREMK) during bus idle or control transfer.

(2) Because USBREIF is set by transition from the J state to the SE0 state, or by transition from the K state to

the SE0 state on the bus, it is also set during EOP reception or bus idle retention EOP reception. Thus,

disable the generation of interrupt requests by setting the interrupt mask flag (USBREMK) during bus idle or

control transfer.

(3) When clearing the interrupt mask flag (USBREMK), do so immediately before the transition to bus suspend

mode (immediately before the STOP instruction execution).

(4) When the USB reset signal or the Resume signal is received, the USB clock starts operating. As a

consequence, USBTMIF and UWDERR are set after the elapse of a certain period (85.3

µs: f

X

= 6.0 MHz

operation) of time from reception start. Therefore, when shifting to bus suspend mode (execution of stop

instruction), set the interrupt mask flag (USBTMMK) and disable the generation of interrupt requests.

Advertising