English
Language : 

PIC32MX440F256H-80I Datasheet, PDF (300/646 Pages) Microchip Technology – 64/100-Pin General Purpose and USB 32-Bit Flash Microcontrollers
PIC32MX3XX/4XX
When the B-device has finished in its role as host, it
stops all bus activity and turns on its D+ pull-up resistor
by disabling host operations (HOSTEN = 0) and recon-
necting as a device (DPPULUP = 1).
Then the A-device detects a suspend condition (Idle for
3 ms), the A-device turns off its D+ pull-up. Alternatively
the A-device may also power-down the VBUS supply to
end the session.
When the A-device detects the connect condition (via
ATTACHIF), the A-device resumes host operation, and
drives Reset signaling.
11.13.2 CLOCK REQUIREMENTS
For proper USB operation, the USB module must be
clocked with a 48 MHz clock. This clock source is used
to generate the timing for USB transfers; it is the clock
source for the SIE. The control registers are clocked at
the same speed as the CPU (refer to Figure 11-1).
The USB module clock is derived from the Primary
Oscillator (POSC) for USB operation. A USB PLL and
input prescalers are provided to allow 48 MHz clock
generation from a wide variety of input frequencies.
The USB PLL allows the CPU and the USB module to
operate at different frequencies while both use the
POSC as a clock source. To prevent buffer overruns
and timing issues, the CPU core must be clocked at a
minimum of 16 MHz.
The USB module can also use the on-board Fast RC
oscillator (FRC) as a clock source. When using this
clock source, the USB module will not meet the USB
timing requirements. The FRC clock source is intended
to allow the USB module to detect a USB wake-up and
report it to the interrupt controller when operating in
low-power modes. The USB module must be running
from the Primary oscillator before beginning USB
transmissions.
11.14 Interrupts
The USB module uses interrupts to signal USB events
such as a change in status, data received and buffer
empty events, to the CPU. Software must be able to
respond to these interrupts in a timely manner.
11.15 Interrupt Control
Each interrupt source in the USB module has an inter-
rupt flag bit and a corresponding enable bit. In addition,
the UERRIF bit (U1IR<1>) is a logical OR of all the
enabled error flags and is read-only. The UERRIF bit
can be used to poll the USB module for events while in
an Interrupt Service Routine (ISR).
11.16 USB Module Interrupt Request
Generation
The USB module can generate interrupt requests from
a variety of events. To interface these interrupts to the
CPU, the USB interrupts are combined such that any
enabled USB interrupt will cause a generic USB inter-
rupt (if the USB interrupt is enabled) to the interrupt
controller, see Figure 11-11. The USB ISR must then
determine which USB event(s) caused the CPU inter-
rupt and service them appropriately. There are two lay-
ers of interrupt registers in the USB module. The top
level of bits consists of overall USB status interrupts in
the U1OTGIR and U1IR registers. The U1OTGIR and
U1IR bits are individually enabled through the corre-
sponding bits in the U1OTGIE and U1IE registers. In
addition, the USB Error Condition bit (UERRIF) passes
through any interrupt conditions in the U1EIR register
enabled via the U1EIE register bits.
11.17 Interrupt Timing
Interrupts for transfers are generated at the end of the
transfer. Figure 11-10 shows some typical event
sequences that can generate a USB interrupt and
when that interrupt is generated. There is no mecha-
nism by which software can manually set an interrupt
bit.
The values in the Interrupt Enable registers (U1IE,
U1EIE, U1OTGIE) only affect the propagation of an
interrupt condition to the CPU’s interrupt controller.
Even though an interrupt is not enabled, interrupt flag
bits can still be polled and serviced.
11.18 Interrupt Servicing
Once an interrupt bit has been set by the USB module
(in U1IR, U1EIR or U1OTGIR), it must be cleared by
software by writing a ‘1’ to the appropriate bit position
to clear the interrupt. The USB Interrupt, USBIF
(IFS1<25>), must be cleared before the end of the ISR.
DS61143E-page 298
Preliminary
© 2008 Microchip Technology Inc.