In addition, on entering an interrupt sequence or executing 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 subroutine can corrupt the status register, precautions must be taken to correctly save it.
Interrupt Control Registers
-
INTC, INTC0, INTC1
These 8-bit registers known as INTC, INTC0 and INTC1, control the operation of the various exter-
nal and internal interrupt functions. By setting various bits within these registers using standard bit
manipulation instructions, the enable/disable function of each of the interrupts can be independ-
ently controlled. The various interrupt functions include those used by the internal timers, the ana-
log to digital converter and the I
2
C bus in addition to the external interrupt pin INT. For the
HT46R47/HT46C47 devices, only one 8-bit interrupt control register, known as INTC, is required
to control all its interrupt functions, while the additional features of the other devices require two in-
terrupt control registers, INTC0 and INTC1. A master interrupt bit within the INTC or INTC0 regis-
ter, the EMI bit, acts like a global enable/disable and is used to set all of the interrupt bits either on
or off. This bit is cleared when an interrupt routine is entered to disable all further interrupts and is
set by executing the
²
RETI
²
instruction.
Note
In situations where other interrupts may require servicing within present interrupt service routines,
the EMI bit can be manually set by the program after the present interrupt service routine has been
entered.
Timer/Event Counter Registers
Depending upon which device is selected, all devices contain one or two integrated Timer/Event
Counters of either 8-bit or 16-bit size. For devices with a single timer counter, an associated regis-
ter, known as TMR, is the location where the timer value is located. An associated control register,
known as TMRC, contains the setup information for the TMR register. For the HT46R24/HT46C24
devices which have two 16-bit timers, the individual timers are known as TMR0 and TMR1 with
their respective control registers known as TMR0C and TMR1C. In the case of 16-bit timers, the
actual value stored in the timer requires two bytes, a high byte and a low byte. These register pairs
are known as TMRL/TMRH or TMR0L/TMR0H and TMR1L/TMR1H. Note that the timer registers
can be directly written to in order to preload their contents with fixed data to allow different time in-
tervals to be setup.
Input/Output Ports and Control Registers
Within the area of Special Function Registers, the I/O registers and their associated control regis-
ters play a prominent role. All I/O ports have a designated register correspondingly labeled as PA,
PB, PC, etc. These labeled I/O registers are mapped to specific addresses within the Data Mem-
ory as shown in the Data Memory table which are used to transfer the appropriate output or input
data on that port. With each I/O port there is an associated control register labeled PAC, PBC,
PCC, etc. 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 register must be set high, for an output it must be set low. Dur-
ing program initialization, 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 registers is the ability to directly program single bits using the
²
SET [m].i
²
and
28
A/D Type MCU
Содержание HT46R22
Страница 7: ...vi A D Type MCU...
Страница 9: ...viii A D Type MCU...
Страница 10: ...P a r t I Microcontroller Profile Part I Microcontroller Profile 1...
Страница 11: ...2 A D Type MCU...
Страница 90: ...P a r t I I Programming Language Part II Programming Language 81...
Страница 91: ...82 A D Type MCU...
Страница 97: ...88 A D Type MCU...
Страница 128: ...P a r t I I I Development Tools Part III Development Tools 119...
Страница 129: ...120 A D Type MCU...
Страница 140: ...Appendix Appendix 131...
Страница 141: ...132 A D Type MCU...
Страница 151: ...142 A D Type MCU...
Страница 152: ...A p p e n d i x B Package Information Appendix B Package Information 143 B...
Страница 161: ...A D Type MCU...
Страница 162: ...Amendments...