HT56R22/HT56R23/HT56R24/HT56R25/HT56R26
Input/Output Ports
Holtek microcontrollers offer considerable flexibility on
their I/O ports. Most pins can have either an input or out-
put designation under user program control. Addi-
tionally, as there are pull-high resistors and wake-up
software configurations, the user is provided with an I/O
structure to meet the needs of a wide range of applica-
tion possibilities.
For input operation, these ports are non-latching, which
means the inputs must be ready at the T2 rising edge of
instruction ²MOV A,[m]², where m denotes the port ad-
dress. For output operation, all the data is latched and
remains unchanged until the output latch is rewritten.
Pull-high Resistors
Many product applications require pull-high resistors for
their switch inputs usually requiring the use of an external
resistor. To eliminate the need for these external resis-
tors, when configured as an input have the capability of
being connected to an internal pull-high resistor. These
pull-high resistors are selectable via a register known as
PAPU, PBPU, PCPU, PDPU, PEPU, PFPU and PGPU
located in the Data Memory. The pull-high resistors are
implemented using weak PMOS transistors. Note that pin
PC7 does not have a pull-high resistor selection.
Port A Wake-up
If the HALT instruction is executed, the device will enter
the Idle/Sleep Mode, where the system clock will stop
resulting in power being conserved, a feature that is im-
portant for battery and other low-power applications.
Various methods exist to wake-up the microcontroller,
one of which is to change the logic condition on one of
the PA0~PA7 pins from high to low. After a HALT instruc-
tion forces the microcontroller into entering the
Idle/Sleep Mode, the processor will remain idle or in a
low-power state until the logic condition of the selected
wake-up pin on Port A changes from high to low. This
function is especially suitable for applications that can
be woken up via external switches. Note that pins PA0 to
PA7 can be selected individually to have this wake-up
feature using an internal register known as PAWK, lo-
cated in the Data Memory.
· PAWK, PAC, PAPU, PBC, PBPU, PCC, PCPU, PDC, PDPU Register
¨ HT56R22
Register
Name
PAWK
PAC
PAPU
POR
00H
FFH
00H
7
PAWK7
PAC7
PAPU7
6
PAWK6
PAC6
PAPU6
5
PAWK5
PAC5
PAPU5
Bit
4
3
PAWK4 PAWK3
PAC4 PAC3
PAPU4 PAPU3
2
PAWK2
PAC2
PAPU2
1
PAWK1
PAC1
PAPU1
0
PAWK0
PAC0
PAPU0
PBC
3FH
¾
PBPU
00H
¾
¾
PBC5 PBC4 PBC3 PBC2 PBC1 PBC0
¾
PBPU5 PBPU4 PBPU3 PBPU2 PBPU1 PBPU0
PCC
8FH
PCC7
¾
¾
¾
PCC3 PCC2 PCC1 PCC0
PCPU
00H
¾
¾
¾
¾
PCPU3 PCPU2 PCPU1 PCPU0
PDC
07H
¾
¾
¾
¾
¾
PDC2 PDC1 PDC0
PDPU
00H
¾
¾
¾
¾
¾
PDPU2 PDPU1 PDPU0
²¾² Unimplemented, read as ²0²
PAWKn: PA wake-up function enable
0: disable
1: enable
PACn/PBCn/PCCn/PDCn: I/O type selection
0: output
1: input
PAPUn/PBPUn/PCPUn/PDPUn: Pull-high function enable
0: disable
1: enable
Rev. 1.30
41
December 26, 2014