²
CLR [m].i
²
instructions. The ability to change I/O pins from output to input and vice-versa by ma-
nipulating specific bits of the I/O control registers during normal program operation is a useful fea-
ture of these devices.
Pulse Width Modulator Registers
-
PWM, PWM0, PWM1, PWM2, PWM3
Each device in the A/D microcontroller range contains either 1, 2 or 4 integrated Pulse Width Modu-
lators or PWM. Each one has its own independent control register. For devices which contain a sin-
gle PWM, the control register is known as PWM, for devices with two PWMs, the control registers
are known as PWM0 and PWM1 while for devices with 4 PWMs, the control registers are known
as PWM0~PWM3. The 8-bit contents of each of these registers define the duty cycle value for the
modulation cycle of the corresponding pulse width modulator.
I
2
C Bus Registers
-
HADR, HCR, HSR, HDR
With the exception of the HT46R47/HT46C47, all devices contain an integrated I
2
C bus which in-
terfaces to the external shared pins SDA and SCL on the microcontroller. The correct setup and
data transfer operation of this 2-line bidirectional bus utilizes 4 special function registers. The
HADR register sets the slave address of the device while the HCR is the control register that en-
ables or disables the device as well as defines whether it is in transmit or receive mode. The HSR
register is the status register while the HDR register is the input/output data register.
A/D Converter Registers
-
ADRL, ADRH, ADCR, ADSR
Each device in the A/D microcontroller range contains either a 4 or 8-channel A/D converter. The
correct operation of the A/D requires the use of 4 registers. The high byte data register ADRH and
low byte data register ADRL, are the two locations where the digital value is placed after the com-
pletion of an analog to digital conversion cycle. The channel selection and configuration of the A/D
converter is setup via the control register ADCR while the A/D clock frequency is defined by the
clock source register, ADSR.
Input/Output Ports
Holtek microcontrollers offer considerable flexibility on their I/O ports. With the input or output des-
ignation of every pin fully under user program control, pull-high options for all pins and wake up op-
tions 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 device or package is chosen, the microcontroller range provides from 13
to 40 bidirectional input/output lines labeled with port names PA, PB, PC, etc. These I/O ports are
mapped to the Data Memory with specific addresses as shown in the Special Purpose Data
Memory table. All of these I/O ports can be used for input and output operations. For input opera-
tion, these ports are non-latching, which means the inputs must be ready at the T2 rising edge of in-
struction
²
MOV A,[m]
²
, where m denotes the port address. For output operation, all the data is
latched and remains unchanged until the output latch is rewritten.
Chapter 1 Hardware Structure
29
Содержание 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...