Alternate Function Output
OE
Alternate Function Output
OE
Pin
reg
Pin
reg
OUT
OUT
PINS
PINS
PORTCFG=0 (port)
PORTCFG=1 (alternate function)
Figure 4-2. Alternate Function is an OUTPUT
Referring to Figure 4-2, when PORTCFG=0, the IO port is selected. In this case the alter-
nate function (shaded) is disconnected and the pin functions exactly as shown in
Figure 4-1. When PORTCFG=1, the alternate function is connected to the IO pin and the
output register and buffer are disconnected. Note that the 8051 can still read the state of
the pin, and thus the alternate function value.
Alternate Function Input
OE
Alternate Function Input
OE
Pin
reg
Pin
reg
OUT
OUT
PINS
PINS
PORTCFG=0 (port)
PORTCFG=1 (alternate function)
Figure 4-3. Alternate Function is an INPUT
Referring to Figure 4-3, when PORTCFG=0, the IO port is selected. This is the general
IO port shown in Figure 4-1 with one important difference—the alternate function is
always listening. Whether the port pin is set for output or input, the pin signal also drives
the alternate function. 8051 firmware should ensure that if the alternate function is not
used (if the pin is GPIO only), the alternate input function is disabled.
For example, suppose the PB4/INT4 pin is configured for PB4. The pin signal is also
routed to INT4. If INT4 is not used by the application, it should not be enabled. Alterna-
tively, enabling INT4 could be useful, allowing IO bit PB4 to trigger an interrupt.
When PORTxCFG=1, the alternate function is selected. The output register and buffer are
disconnected. The PINS bit can still read the pin, and thus the input to the alternate func-
tion.
Page 4-4
Chapter 4. EZ-USB CPU
EZ-USB TRM v1.9