HT82A520R HOLTEK [Holtek Semiconductor Inc], HT82A520R Datasheet - Page 15
![no-image](/images/no-image-200.jpg)
HT82A520R
Manufacturer Part Number
HT82A520R
Description
Full Speed USB 8-Bit OTP MCU with SPI
Manufacturer
HOLTEK [Holtek Semiconductor Inc]
Datasheet
1.HT82A520R.pdf
(72 pages)
In addition, on entering an interrupt sequence or execut-
ing a subroutine call, the status register will not be
pushed onto the stack automatically. If the contents of
the status registers are important and if the interrupt rou-
tine can change the status register, precautions must be
taken to correctly save it.
Interrupt Control Registers - INTC0, INTC1
The microcontrollers provide one external interrupts,
one internal timer/event counter overflow interrupt, one
SPI interrupt and one USB interrupt. By setting various
bits within these registers using standard bit manipula-
tion instructions, the enable/disable function of each in-
terrupt can be independently controlled. A master
interrupt bit within this register, the EMI bit, acts like a
global enable/disable and is used to set all of the inter-
rupt enable bits on or off. This bit is cleared when an in-
terrupt routine is entered to disable further interrupt and
is set by executing the RETI instruction.
Timer/Event Counter Registers -
TMRH, TMRL, TMRC
All devices possess one internal 16-bit count-up timer. An
associated register pair known as TMRL/TMRH are the
locations where the timer 16-bit values are located.
These registers can also be preloaded with fixed data to
allow different time intervals to be setup. Associated con-
trol registers, known as TMRC, contains the setup infor-
mation for the timers, which determines in what mode the
timer is to be used as well as containing the timer on/off
control function.
Input/Output Ports and Control Registers
Within the area of Special Function Registers, the I/O
registers and their associated control registers play a
prominent role. All I/O ports have a designated register
correspondingly labeled as PA, PB, PC. These labeled
Rev.1.00
Generic Input/Output Ports
15
I/O registers are mapped to specific addresses within
the Data Memory as shown in the Data Memory table,
which are used to transfer the appropriate output or in-
put data on that port. With each I/O port there is an asso-
ciated control register labeled PAC, PBC, PCC, also
mapped to specific addresses with the Data Memory.
The control register specifies which pins of that port are
set as inputs and which are set as outputs. To setup a
pin as an input, the corresponding bit of the control reg-
ister must be set high, for an output it must be set low.
During program initialisation, it is important to first setup
the control registers to specify which pins are outputs
and which are inputs before reading data from or writing
data to the I/O ports. One flexible feature of these regis-
ters is the ability to directly program single bits using the
change I/O pins from output to input and vice versa by
manipulating specific bits of the I/O control registers dur-
ing normal program operation is a useful feature of
these devices.
Input/Output Ports
Holtek microcontrollers offer considerable flexibility on
their I/O ports. With the input or output designation of ev-
ery pin fully under user program control, pull-high op-
tions for all ports and wake-up options on certain pins,
the user is provided with an I/O structure to meet the
needs of a wide range of application possibilities.
Depending upon which package is chosen, the
microcontroller provides up to 24 bidirectional input/out-
put lines labeled with port names PA, PB, PC.
This register is mapped to the Data Memory with an ad-
dresses as shown in the Special Purpose Data Memory
table. Seven of these I/O lines can be used for input and
output operations and one line as an input only. For in-
put operation, these ports are non-latching, which
SET [m].i and CLR [m].i instructions. The ability to
HT82A520R/HT82A620R
October 23, 2009