I/O Port Control Register
The I/O port has its own control register known as PAC~PFC, to control the input/output
configuration. With this control register, each CMOS output or input can be reconfigured dynamically
under software control. Each pin of the I/O port is directly mapped to a bit in its associated port control
register. For the I/O pin to function as an input, the corresponding bit of the control register must be
written as a
²
1
²
. This will then allow the logic state of the input pin to be directly read by instructions.
When the corresponding bit of the control register is written as a
²
0
²
, the I/O pin will be setup as a
CMOS output. If the pin is currently setup as an output, instructions can still be used to read the output
register. However, it should be noted that the program will in fact only read the status of the output data
latch and not the actual logic status of the output pin.
PAC Register
Bit
7
6
5
4
3
2
1
0
Name
¾
¾
¾
D4
D3
D2
D1
D0
R/W
¾
¾
¾
R/W
R/W
R/W
R/W
R/W
POR
¾
¾
¾
1
1
1
1
1
Bit 7~5
unimplemented, read as
²
0
²
Bit 4~0
I/O port bit 4~bit 0 input/output control
0: output
1: input
PBC Register
Bit
7
6
5
4
3
2
1
0
Name
D7
D6
D5
D4
D3
D2
D1
D0
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
POR
1
1
1
1
1
1
1
1
Bit 7~0
I/O port bit 7 ~ bit 0 input/output control
0: output
1: input
Rev. 1.50
64
April 28, 2020
BS83B08-3/B12-3/B16-3/B16G-3/C24-3
8-Bit Touch Key Flash MCU