Datasheet
2012 Microchip Technology Inc. DS30684A-page 373
PIC18(L)F2X/45K50
24.6.3 DUAL POWER WITH SELF-POWER
DOMINANCE
Some applications may require a dual power option.
This allows the application to use internal power pri-
marily, but switch to power from the USB when no inter-
nal power is available. Figure 24-11 shows a simple
Dual Power with Self-Power Dominance mode exam-
ple, which automatically switches between Self-Power
Only and USB Bus Power Only modes.
Dual power devices must also meet all of the special
requirements for inrush current and Suspend mode
current and must not enable the USB module until
V
BUS is driven high. See Section 24.6.1 “Bus Power
Only” and Section 24.6.2 “Self-Power Only” for
descriptions of those requirements. Additionally, dual
power devices must never source current onto the 5V
V
BUS pin of the USB cable.
FIGURE 24-11: DUAL POWER EXAMPLE
24.6.4 USB TRANSCEIVER CURRENT
CONSUMPTION
The USB transceiver consumes a variable amount of
current depending on the characteristic impedance of
the USB cable, the length of the cable, the V
USB3V3
supply voltage and the actual data patterns moving
across the USB cable. Longer cables have larger
capacitances and consume more total energy when
switching output states.
Data patterns that consist of “IN” traffic consume far
more current than “OUT” traffic. IN traffic requires the
PIC
®
device to drive the USB cable, whereas OUT
traffic requires that the host drive the USB cable.
The data that is sent across the USB cable is NRZI
encoded. In the NRZI encoding scheme, ‘0’ bits cause
a toggling of the output state of the transceiver (either
from a “J” state to a “K” state, or vise versa). With the
exception of the effects of bit-stuffing, NRZI encoded ‘1’
bits do not cause the output state of the transceiver to
change. Therefore, IN traffic consisting of data bits of
value, ‘0’, cause the most current consumption, as the
transceiver must charge/discharge the USB cable in
order to change states.
More details about NRZI encoding and bit-stuffing can
be found in the USB 2.0 specification’s section 7.1,
although knowledge of such details is not required to
make USB applications using the PIC18F2X/45K50 of
microcontrollers. Among other things, the SIE handles
bit-stuffing/unstuffing, NRZI encoding/decoding and
CRC generation/checking in hardware.
The total transceiver current consumption will be
application-specific. However, to help estimate how
much current actually may be required in full-speed
applications, Equation 24-1 can be used.
Example 24-2 shows how this equation can be used for
a theoretical application.
Note: Users should keep in mind the limits for
devices drawing power from the USB.
According to USB Specification 2.0, this
cannot exceed 100 mA per low-power
device or 500 mA per high-power device.
VDD
VUSB
VSS
VBUS
VSELF
~5V
~5V
100 k