English
Language : 

PIC18F47J53 Datasheet, PDF (396/586 Pages) Microchip Technology – 28/44-Pin, High-Performance USB Microcontrollers with nanoWatt XLP Technology
PIC18F47J53 FAMILY
23.5.1.1 Bus Activity Detect Interrupt Bit
(ACTVIF)
The ACTVIF bit cannot be cleared immediately after
the USB module wakes up from Suspend mode or
while the USB module is suspended. A few clock
cycles are required to synchronize the internal hard-
ware state machine before the ACTVIF bit can be
cleared by firmware. Clearing the ACTVIF bit before
the internal hardware is synchronized may not have an
effect on the value of ACTVIF. Additionally, if the USB
module uses the clock from the 96 MHz PLL source,
then after clearing the SUSPND bit, the USB module
may not be immediately operational while waiting for
the 96 MHz PLL to lock. The application code should
clear the ACTVIF flag as provided in Example 23-1.
Note:
Only one ACTVIF interrupt is generated
when resuming from the USB bus Idle con-
dition. If user firmware clears the ACTVIF
bit, the bit will not immediately become set
again, even when there is continuous bus
traffic. Bus traffic must cease long enough
to generate another IDLEIF condition
before another ACTVIF interrupt can be
generated.
EXAMPLE 23-1: CLEARING ACTVIF BIT (UIR<2>)
Assembly:
BCF
LOOP:
BTFSS
BRA
BCF
BRA
DONE:
UCON, SUSPND
UIR, ACTVIF
DONE
UIR, ACTVIF
LOOP
C:
UCONbits.SUSPND = 0;
while (UIRbits.ACTVIF) { UIRbits.ACTVIF = 0; }
DS39964B-page 396
Preliminary
 2010 Microchip Technology Inc.