mov a,ADRH
; read conversion result from the high byte
; ADRH register
mov adrh_buffer,a
; save result to user defined register
mov a,ADRL
; read conversion result from the low byte ADRL
; register
mov adrl_buffer,a
; save result to user defined register
:
:
jmp start_conversion
; start next A/D conversion
Example: using Interrupt method to detect end of conversion
set INTC0.0
; interrupt global enable
set INTC0.3
; enable A/D interrupt in interrupt control
; register
mov a,00100000B
mov ADCR,a
; setup ADCR register to configure Port PB0~PB3
; as A/D inputs and select AN0 to be connected
; to the A/D converter
mov a,00000001B
mov ACSR,a
; setup the ACSR register to select f
SYS
/8 as
; the A/D clock
start_conversion:
clr ADCR.7
set ADCR.7
; reset A/D
clr ADCR.7
; start A/D
:
:
; interrupt service routine
EOC_service routine:
mov a_buffer,a
; save ACC to user defined register
mov a,ADRH
; read conversion result from the high byte
; ADRH register
mov adrh_buffer,a
; save result to user defined register
mov a,ADRL
; read conversion result from the low byte ADRL
; register
mov adrl_buffer,a
; save result to user defined register
clr ADCR.7
set ADCR.7
; reset A/D
clr ADCR.7
; start A/D
mov a,a_buffer
; restore ACC from temporary storage
reti
A/D Transfer Function
As the HT46R47/HT46C47 and HT46R22/HT46C22 devices each contain a 9-bit A/D converter,
their full-scale converted digitized value is equal to 1FFH. Since the full-scale analog input value is
equal to the VDD voltage, this gives a single bit analog input value of V
DD
/512. In the case of the
HT46R23/HT46C23 and HT46R24/HT46C24 devices, which each contain a 10-bit A/D converter,
their full-scale converted digitized value is equal to 3FFH, giving a single bit analog input value of
V
DD
/1024. The following graphs show the ideal transfer function between the analog input value
and the digitized output value for both the 9-bit and 10-bit A/D converters.
52
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...