HT45R22E Holtek Semiconductor, HT45R22E Datasheet - Page 31

no-image

HT45R22E

Manufacturer Part Number
HT45R22E
Description
Remote Type 8-bit OTP MCU
Manufacturer
Holtek Semiconductor
Datasheet
I/O Port Control Registers
Each Port has its own control register, known as PAC,
PBC and PCC which controls the input/output configu-
ration. With this control register, each I/O pin with or
without pull-high resistors can be reconfigured dynami-
cally under software control. 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 out-
put. 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.
Pin-shared Functions
The flexibility of the microcontroller range is greatly en-
hanced by the use of pins that have more than one func-
tion. Limited numbers of pins can force serious design
constraints on designers but by supplying pins with
multi-functions, many of these difficulties can be over-
come. For some pins, the chosen function of the
multi-function I/O pins is set by configuration options
while for others the function is set by application pro-
gram control.
Rev. 1.00
External Interrupt Input
The external interrupt pin, INT, is pin-shared with an
I/O pin. To use the pin as an external interrupt input
the correct bits in the INTC0 register must be pro-
grammed. The pin must also be setup as an input by
setting the PAC3 bit in the Port Control Register. A
pull-high resistor can also be selected via the appro-
priate port pull-high resistor register. Note that even if
the pin is setup as an external interrupt input the I/O
function still remains.
External Timer/Event Counter Input
The Timer/Event Counter pins, TC0 and TC1 are
pin-shared with I/O pins. For these shared pins to be
used as Timer/Event Counter inputs, the Timer/Event
Counter must be configured to be in the Event Coun-
ter or Pulse Width Capture Mode. This is achieved by
setting the appropriate bits in the Timer/Event Counter
Control Register. The pins must also be setup as in-
puts by setting the appropriate bit in the Port Control
Register. Pull-high resistor options can also be se-
lected using the port pull-high resistor registers. Note
that even if the pin is setup as an external timer input
the I/O function still remains.
31
I/O Pin Structures
The diagrams illustrate the I/O pin internal structures. As
the exact logical construction of the I/O pin may differ
from these drawings, they are supplied as a guide only
to assist with the functional understanding of the I/O
pins.
PFD Output
The device contains a PFD function which single or
dual outputs which are pin-shared with I/O pins. The
output function of these pins are chosen using the
CTRL0 register. Note that the corresponding bit of the
port control register, must setup the pin as an output to
enable the PFD and PFD outputs. If the port control
register has setup these pins as inputs, then these
pins will function as normal logic inputs with the usual
pull-high selection, even if the PFD function has been
selected.
SCOM Driver Pins
Pins PB0~PB3 on Port B can be used as LCD COM
driver pins. This function is controlled using the
SCOMC register which will generate the necessary
1/2 bias signals on these four pins.
Comparator Input/Outputs
The device has two comparator inputs and a single
comparator output, pin-shared with PC0, PC1 and
PC7. Software options determine if these pins have
I/O or comparator functions via bits in the COPA2C
and COPA3C registers. The comparator function to-
gether with the comparator interrupt transition type is
selected via bits in the CMP0C and CMP1C registers.
If used as I/O pins then full pull-high resistor selec-
tions remain, however if used as comparator inputs
then any pull-high resistor selections will be automati-
cally disconnected.
OPA0 and OPA1 input/outputs
There are two OPAs in this device. These pins PA4,
PA3 and PA2 are pin-shared with the non-inverting in-
put pin A0P, the inverting input pin A0N and the output
pin A0X of the 1st OPA, respectively. Pins PC6, PA0
and PA1 are pin-shared with the non-inverting input
pin A1P, the inverting input pin A1N and the output pin
A1X of the 2nd OPA, respectively. Software options
determine these pins have I/O or analog OPA func-
tions via bits in the COPA3C resister. Once selected
as analog functions, the I/O functions and pull-high re-
sistors are disabled automatically.
HT45R22E
March 17, 2010
www.DataSheet4U.com

Related parts for HT45R22E