set pd.0
; PD.0=1; enable pin
²
PD0/PWM0
²
to be the PWM channel 0
mov a,64h
; PWM0=100D=64H
mov pwm0,a
set pd.1
; PD.1=1; enable pin
²
PD1/PWM1
²
to be the PWM channel 1
mov a,65h
; PWM1=101D=65H
mov pwm1,a
set pd.2
; PD.2=1; enable pin
²
PD2/PWM2
²
to be the PWM channel 2
mov a,66h
; PWM2=102D=66H
mov pwm2,a
set pd.3
; PD.3=1; enable pin
²
PD3/PWM3
²
to be the PWM channel 3
mov a,67h
; PWM3=103D=67H
mov pwm3,a
clr pd.0
; disable PWM0 output
-
PD.0 will remain low
clr pd.1
; disable PWM1 output
-
PD.1 will remain low
clr pd.2
; disable PWM2 output
-
PD.2 will remain low
clr pd.3
; disable PWM3 output
-
PD.3 will remain low
Analog to Digital Converter
The need to interface to real world analog signals is a common requirement for many electronic
systems. However, to properly process these signals by a microcontroller, they must first be con-
verted into digital signals by A/D converters. By integrating the A/D conversion electronic circuitry
into the microcontroller, the need for external components is reduced significantly with the corre-
sponding follow-on benefits of lower costs and reduced component space requirements. Each of
the devices in the Holtek A/D series of microcontrollers contains either a 4-channel or 8-channel
analog to digital converter which can directly interface to external analog signals such as that from
sensors or other control signals and convert these signals directly into either a 9-bit or 10-bit digital
value.
Device
Input Channels
Conversion Bits
Input Pins
HT46R47/HT46C47
4
9
PB0~PB3
HT46R22/HT46C22
8
9
PB0~PB7
HT46R23/HT46C23
8
10
PB0~PB7
HT46R24/HT46C24
8
10
PB0~PB7
A/D Converter Data Registers
-
ADRL/ADRH
To store the actual 9-bit or 10-bit digital value, obtained after the completion of the conversion pro-
cess, a high byte register ADRH and low byte register ADRL are assigned. After the conversion
process takes place, these two registers can be directly read by the microcontroller to obtain the
digitized conversion value. Note that only the high byte register ADRH utilizes its full 8-bit con-
tents. The low byte register utilizes only 1 or 2 bits of its 8-bit contents as it contains only the lowest
one or two bits of the 9 or 10-bit converted value.
46
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...