Mikroelektronika MikroE Development Kits MIKROE-997 Data Sheet

Product codes
MIKROE-997
Page of 480
PIC18F87J50 FAMILY
DS39775C-page 332
 
© 2009 Microchip Technology Inc.
22.6.3
DUAL POWER WITH SELF-POWER 
DOMINANCE
Some applications may require a dual power option.
This allows the application to use internal power prima-
rily, but switch to power from the USB when no internal
power is available. Figure 22-11 shows a simple Dual
Power with Self-Power Dominance mode example,
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
Only” anSection 22.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 22-11:
DUAL POWER EXAMPLE
22.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
USB
 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 PIC18F87J10 family
of microcontrollers. Among other things, the SIE han-
dles 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 22-1 can be used.
Example 22-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. 
V
DD
V
USB
I/O pin
V
SS
Attach Sense
V
BUS
V
SELF
100 k
Ω
~3.3V
~5V
100 k
Ω
3.3V
Low I
Q
Regulator