HT56R66 Holtek Semiconductor Inc., HT56R66 Datasheet - Page 27

no-image

HT56R66

Manufacturer Part Number
HT56R66
Description
Tinypower Tm A/d Type With Lcd 8-bit Otp Mcu
Manufacturer
Holtek Semiconductor Inc.
Datasheet
I/O Port Control Registers
Each I/O port has its own control register known as PAC,
PBC and PDC, to control the input/output configuration.
With this control register, each CMOS output or input
with or without pull-high resistor structures can be re-
configured dynamically under software control. Each pin
of the I/O ports is directly mapped to a bit in its associ-
ated 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 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.10
External Interrupt Inputs
The external interrupt pins INT0, INT1 are pin-shared
with the I/O pins PD4, PD5. For applications not re-
quiring an external interrupt input, the pin-shared ex-
ternal interrupt pin can be used as a normal I/O pin,
however to do this, the external interrupt enable bits in
the INTC0 register must be disabled.
External Timer Clock Input
The external timer pins TMR0, TMR1, TMR2 and
TMR3 are pin-shared with I/O pins. To configure them
to operate as timer inputs, the corresponding control
bits in the timer control register must be correctly set
and the pin must also be setup as an input. Note that
the original I/O function will remain even if the pin is
setup to be used as an external timer input.
Pull-High Resistor Register - PAPU, PBPU, PCPU, PDPU
27
I/O Pin Structures
The accompanying diagrams illustrate the internal
structures of some I/O pin types. As the exact logical
construction of the I/O pin will differ from these draw-
ings, they are supplied as a guide only to assist with the
functional understanding of the I/O pins. The wide range
of pin-shared structures does not permit all types to be
shown.
PFD Output
The device contains a PFD function whose single out-
put is pin-shared with I/O pin PA3. The output function
of this pin is chosen via a configuration option and re-
mains fixed after the device is programmed. Note that
the corresponding bit of the port control register,
PAC.3, must setup the pin as an output to enable the
PFD output. If the PAC port control register has setup
the pin as an input, then the pin will function as a nor-
mal logic input with the usual pull-high selection, even
if the PFD configuration option has been selected.
PWM Outputs
The device contains several PWM outputs shared
with pins PD0~PD3. The PWM output functions are
chosen via registers. Note that the corresponding bit
of the port control register, PDC, must setup the pin as
an output to enable the PWM output. If the PDC port
control register has setup the pin as an input, then the
pin will function as a normal logic input with the usual
pull-high selection, even if the PWM registers have
enabled the PWM function.
A/D Inputs
The device contains a multi-channel A/D converter in-
puts. All of these analog inputs are pin-shared with I/O
pins on Port B. If these pins are to be used as A/D in-
puts and not as normal I/O pins then the corresponding
bits in the A/D Converter Control Register, ADCR, must
be properly set. There are no configuration options as-
sociated with the A/D function. If used as I/O pins, then
full pull-high resistor register remain, however if used
as A/D inputs then any pull-high resistor selections as-
sociated with these pins will be automatically discon-
nected.
HT56R66/HT56R666
September 8, 2009

Related parts for HT56R66