English
Language : 

TMP88CS42NG Datasheet, PDF (59/216 Pages) Toshiba Semiconductor – 8 Bit Microcontroller
TMP88CS42NG
5.5 Port P4 (P47 to P40)
Port P4 is an 8-bit input/output port shared with serial interface input/output. This port is switched between input
and output modes using the P4 port input/output control register (P4CR). When reset, the P4CR register is initialized
to 0, with the P4 port set for input mode. Also, the output latch (P4DR) is initialized to 0 when reset.
The P4 port contains bitwise programmable open-drain control. The P4 port open-drain control register (P4ODE)
is used to select open-drain or tri-state mode for the port. When reset, the P4ODE register is initialized to 0, with tri-
state mode selected for the port.
P4CRi
Data input
Data output
Control output
Control input
DQ
Output latch
CR
01
Exteinrpnuatl
0
1
0
1
0
0
P4i
Note: i = 7 to 0
Convtarlouleinsput
Figure 5-6 Port P4
P4 Port Input/Output Registers
7
6
5
4
3
2
1
0
P4DR
P47
P46
P45
P44
P43
P42
P41
P40
(00004H)
CTC
PPG2
SO
SI
SCK
PDU1 PDV1 PDW1 (Initial value: 0000 0000)
TXD1 RXD1
P4CR
7
6
5
4
3
2
1
0
(01F8AH)
(Initial value: 0000 0000)
P4 port input/output control
0: Input mode
P4CR
R/W
(Specify bitwise)
1: Output mode
P4ODE
7
6
5
4
3
2
1
0
(01F84H)
(Initial value: 0000 0000)
P4 port open-drain control
0: Tri-state
P4ODE
R/W
(Specify bitwise)
1: Open drain
Note 1: Even when open-drain mode is selected, the protective diode remains connected. Therefore, do not apply voltages
exceeding VDD.
Note 2: Read-modify-write (RMW) operation executes at open-drain mode is selected, read out the output latch states.
When any other instruction is executed, external pin states is read out.
Note 3: When using the 16-bit timer (CTC) as an ordinary timer, set P47 (CTC) for output mode.
Page 49