![Sino Wealth SH69K55A Скачать руководство пользователя страница 18](http://html1.mh-extra.com/html/sino-wealth/sh69k55a/sh69k55a_manual_1283061018.webp)
SH69P55A/K55A
18
6. I/O Port
The SH69P55A/69K55A provides 42 bi-directional I/O ports including one open-drain output. The PORT data is put in register
$08 - $0D and $38E - $392. The PORT control register ($18 - $1D and $393 - $397) controls the PORT as input or output.
Each I/O port (excluding those open drain output ports) contains pull-high resistor, which is controlled by the value of the
corresponding bit in the port pull-high control register ($398 - $3A2), independently.
When the port is selected as an input port, write “1” to the relevant bit in the port pull-high control register ($398 - $3A2)
could turn on the pull high resistor and write “0” could turn off the pull high resistor.
When the port is selected as output port, the pull high resistor will be turned off automatically, regardless the value of the
corresponding bit in the port pull high control register ($398 - $3A2).
When PORTB and PORTC are selected as the digital input direction, they can active port interrupt by falling edge (if port
interrupt is enabled).
System Register $08 - $0D, $38E - $392:
Port Data Register (PDR)
Address
Bit3 Bit2 Bit1 Bit0
R/W
Remarks
$08 PA.3 PA.2 PA.1 PA.0
R/W
PORTA
data
register
$09 PB.3 PB.2 PB.1 PB.0
R/W
PORTB
data
register
$0A PC.3 PC.2 PC.1 PC.0
R/W
PORTC
data
register
$0B PD.3 PD.2 PD.1 PD.0
R/W
PORTD
data
register
$0C PE.3 PE.2 PE.1 PE.0
R/W
PORTE
data
register
$0D PF.3 PF.2 PF.1 PF.0
R/W
PORTF
data
register
$38E PG.3 PG.2 PG.1 PG.0
R/W
PORTG
data
register
$38F PH.3 PH.2 PH.1 PH.0
R/W
PORTH
data
register
$390 PI.3 PI.2 PI.1 PI.0
R/W
PORTI
data
register
$391 PJ.3 PJ.2 PJ.1 PJ.0
R/W
PORTJ
data
register
$392
-
-
PK.1
PK.0
R/W
PORTK data register
System Register $18 - $1D, $393 - $397
: Port Control Register (PCR)
Address
Bit3 Bit2 Bit1 Bit0
R/W
Remarks
$18 PACR.3 PACR.2 PACR.1 PACR.0
R/W
PORTA input/output control register
$19
PBCR.3
PBCR.2
PBCR.1
PBCR.0
R/W
PORTB input/output control register
$1A PCCR.3 PCCR.2 PCCR.1 PCCR.0
R/W
PORTC
input/output
control
register
$1B PDCR.3 PDCR.2 PDCR.1 PDCR.0
R/W
PORTD
input/output
control
register
$1C
PECR.3
PECR.2
PECR.1
PECR.0
R/W
PORTE input/output control register
$1D PFCR.3 PFCR.2 PFCR.1 PFCR.0
R/W
PORTF input/output control register
$393 PGCR.3 PGCR.2 PGCR.1 PGCR.0
R/W
PORTG input/output control register
$394 PHCR.3 PHCR.2 PHCR.1 PHCR.0
R/W
PORTH input/output control register
$395 PICR.3 PICR.2 PICR.1 PICR.0
R/W
PORTI input/output control register
$396 PJCR.3 PJCR.2 PJCR.1 PJCR.0
R/W
PORTJ input/output control register
$397
-
-
PKCR.1
PKCR.0
R/W
PORTK input/output control register
PA (/B/C/D/E/F/G/H/I/J) PCR.n, (n = 0, 1, 2, 3), PKPCR.n (n = 0, 1)
0: Set I/O as an input direction. (Power on initial)
1: Set I/O as an output direction.