8XC196L
X SUPPLEMENT
5-4
impedance input, or open-drain output. The port direction and data output registers select the con-
figuration for each pin. Complementary output means that the microcontroller drives the signal
high or low. High-impedance input means that the microcontroller floats the signal. Open-drain
output means that the microcontroller drives the signal low or floats it. For I/O mode, the port
data output register determines whether the microcontroller drives the signal high, drives it low,
or floats it. For special-function mode, the on-chip peripheral or system function determines
whether the microcontroller drives the signal high or low for complementary outputs.
The pins for ports 1, 2, 5, and 6 are weakly pulled low during and after reset. Initializing the pins
by writing to the port mode register turns off the weak pull-downs. To ensure that the ports are
initialized correctly, follow this suggested initialization sequence:
1.
Write to Px_DIR to configure the individual pins. Clearing a bit configures a pin as a
complementary output. Setting a bit configures a pin as a high-impedance input or open-
drain output.
2.
Write to Px_MODE to select either I/O or special-function mode. Writing to Px_MODE
(regardless of the value written) turns off the weak pull-downs. Even if the entire port is to
be used as I/O (its default configuration after reset), you must write to Px_MODE to
ensure that the weak pull-downs are turned off.
3.
Write to Px_REG.
For complementary output configurations:
In I/O mode, write the data that is to be driven by the pins to the corresponding Px_REG
bits. In special-function mode, the value is immaterial because the on-chip peripheral or
system function controls the pin. However, you must still write to Px_REG to initialize the
pin.
For high-impedance input or open-drain output configurations:
In I/O mode, write to Px_REG to either float the pin, making it available as a high
impedance input, or pull it low. Setting the corresponding Px_REG bit floats the pin;
clearing the corresponding Px_REG bit pulls the pin low. In special-function mode, if the
on-chip peripheral uses the pin as an input signal, you must set the corresponding Px_REG
bit so that the pin can be driven externally. If the on-chip peripheral uses the pin as an
output signal, the value of the corresponding Px_REG bit is immaterial because the on-
chip peripheral or system function controls the pin. However, you must still write to
Px_REG to initialize the pin.
5.2.2
Special Bidirectional Port Considerations
This section outlines special consideration for using the pins of ports 1, 2, 5, and 6.
1.
After reset, your software must configure the device to match the external system. This
accomplished by writing appropriate configuration data into Px_MODE. Writing to
Px_MODE not only configures the pins but also turns off the transistor that weakly holds
the pins low. For this reason, even if your port is to be used as it is configured at reset, you
should still write data into Px_MODE.
2.
P2.6/TXJ1850 is the enable pin for ONCE mode. Because a high input during reset can
cause the device to enter ONCE mode or a reserved test mode, caution must be exercised
Summary of Contents for 87C196CA
Page 9: ...1 Guide to This Manual...
Page 10: ......
Page 13: ...2 Architectural Overview...
Page 14: ......
Page 22: ......
Page 23: ...3 Address Space...
Page 24: ......
Page 33: ...4 Standard and PTS Interrupts...
Page 34: ......
Page 43: ...5 I O Ports...
Page 44: ......
Page 51: ...6 Synchronous Serial I O Port...
Page 52: ......
Page 56: ......
Page 57: ...7 Event Processor Array...
Page 58: ......
Page 65: ...8 J1850 Communications Controller...
Page 66: ......
Page 89: ...9 Minimum Hardware Considerations...
Page 90: ......
Page 93: ...10 Special Operating Modes...
Page 94: ......
Page 98: ......
Page 99: ...11 Programming the Nonvolatile Memory...
Page 100: ......
Page 106: ......
Page 107: ...A Signal Descriptions...
Page 108: ......
Page 118: ......
Page 119: ...Glossary...
Page 120: ......
Page 133: ...Index...
Page 134: ......