VCT 38xxA
ADVANCE INFORMATION
128
Micronas
5.18.2.2. Universal Port Mode
Each port bit can be individually configured to several
port modes. The output driver of each pin has to be
enabled by setting the EN flag. Using the OUT flag the
output stage can be configured to either open drain or
push pull output. The MOD flag selects the source of
the output value.
The Special Input mode is always active. This allows
manipulating the input signal to the special hardware
through Normal Output operations by software.
As the Special Output mode allows reading the pin lev-
els, the output state of the special hardware may be
read by the CPU.
5.18.3.Universal Port Registers
Universal Port Data registers PxD contain input/output
data of the corresponding port. The “x” in PxD means
the number of the port. Thus PxD stands for P1D to
P3D.
D0
7
r:
w:
Universal Port Data Input/Output
Read pin level resp. data latch.
Write data to data latch.
To use a port pin as software output, the appropriate
driver must be activated by setting the EN flag and the
MOD flag must be programmed to Normal mode.
OUT0
7
w1:
w0:
Output Flag
Output driver is open drain
Output driver is push pull
MOD0
7
w1:
w0:
Normal/Special Mode Flag
Special Output Mode
Normal Output Mode
The MOD flag defines from which source the pin is
driven if the EN flag is true.
EN0
7
w1:
w0:
Enable Flag
Output driver is enabled
Output driver is disabled
Table 5–25:
Port mode register settings
Mode
MOD
EN
D
Function
Normal
Input
x
0
x
READ of register
PxD returns port
pin input levels to
data bus.
Normal
Output
0
1
Data
WRITE to register
PxD changes level
of port pin output
drivers.
READ of register
PxD returns the
PxD register set-
ting to the data
bus.
Special
Input
x
x
x
Port pin input level
is presented to
special hardware.
Special
Output
1
1
x
Special hardware
drives port pin.
READ of register
PxD returns port
pin input levels to
data bus.
286:
1F90
287:
P1D
288:
Port 1 Data Register
289:
1F94
290:
P2D
291:
Port 2 Data Register
292:
1F98
293:
P3D
294:
Port 3 Data Register
bit
7
6
5
4
3
2
1
0
r/w
D7
D6
D5
D4
D3
D2
D1
D0
reset
0
0
0
0
0
0
0
0
295:
1F91
296:
P1O
297:
Port 1 Output Register
298:
1F95
299:
P2O
300:
Port 2 Output Register
301:
1F99
302:
P3O
303:
Port 3 Output Register
bit
7
6
5
4
3
2
1
0
w
OUT7
OUT6
OUT5
OUT4
OUT3
OUT2
OUT1
OUT0
reset
0
0
0
0
0
0
0
0
304:
1F92
305:
P1M
306:
Port 1 Mode Register
307:
1F96
308:
P2M
309:
Port 2 Mode Register
310:
1F9A
311:
P3M
312:
Port 3 Mode Register
bit
7
6
5
4
3
2
1
0
w
MOD7
MOD6
MOD5
MOD4
MOD3
MOD2
MOD1
MOD0
reset
0
0
0
0
0
0
0
0
313:
1F93
314:
P1E
315:
Port 1 Enable Register
316:
1F97
317:
P2E
318:
Port 2 Enable Register
319:
1F9B
320:
P3E
321:
Port 3 Enable Register
bit
7
6
5
4
3
2
1
0
w
EN7
EN6
EN5
EN4
EN3
EN2
EN1
EN0
reset
0
0
0
0
0
0
0
0