Bidirectional Port Pin Configuration Example - Intel 8XC196K Series User Manual

Table of Contents

Advertisement

Table 6-8. Control Register Values for Each Configuration
Desired Pin Configuration
Standard I/O Signal
Complementary output, driving 0
Complementary output, driving 1
Open-drain output, strongly driving 0
Open-drain output, high-impedance
Input
Special-function signal
Complementary output, output value controlled by peripheral
Open-drain output, output value controlled by peripheral
Input
During reset and until the first write to P x _MODE, the pins are weakly held high.
6.3.3

Bidirectional Port Pin Configuration Example

Assume that you wish to configure the pins of a bidirectional port as shown in Table 6-9.
Port Pin(s)
P x .0, P x .1
high-impedance input
P x .2, P x .3
open-drain output
P x .4
open-drain output
P x .5, P x .6
complementary output
P x .7
complementary output
To do so, you could use the following example code segment. Table 6-10 shows the state of each
pin after reset and after execution of each line of the example code.
P x _DIR,#00011111B
LDB
P x _MODE,#00000000B
LDB
P x _REG,#10010011B
LDB
Table 6-9. Port Configuration Example
Configuration
Configuration Register Settings
P x _DIR
P x _MODE
0
0
0
0
1
0
1
0
1
0
P x _DIR
P x _MODE
0
1
1
1
1
1
Data
high-impedance
0
1 (assuming external pull-up)
0
1
I/O PORTS
P x _REG
0
1
0
1
1
P x _REG
X
X
1
6-11

Advertisement

Table of Contents
loading

Table of Contents