Example: using the interrupt method to detect the end of conversion
clr ADE
mov a,03H
mov ADCR1,a
Clr ADOFF
mov a,0Fh
mov ACERL,a
mov a,00h
mov ADCR0,a
Start_conversion:
clr START
set START
clr START
clr ADF
set ADE
set EMI
:
:
ADC_ISR:
mov acc_stack,a
mov a,STATUS
mov status_stack,a
:
:
mov a,ADRL
mov adrl_buffer,a
mov a,ADRH
mov adrh_buffer,a
:
:
EXIT_INT_ISR:
mov a,status_stack
mov STATUS,a
mov a,acc_stack
reti
Rev. 1.21
A/D Flash MCU with EEPROM
; disable ADC interrupt
; select f
/8 as A/D clock and switch off V
SYS
; setup ACERL to configure pins AN0~AN3
; enable and connect AN0 channel to A/D converter
; high pulse on START bit to initiate conversion
; reset A/D
; start A/D
; clear ADC interrupt request flag
; enable ADC interrupt
; enable global interrupt
; ADC interrupt service routine
; save ACC to user defined memory
; save STATUS to user defined memory
; read low byte conversion result value
; save result to user defined register
; read high byte conversion result value
; save result to user defined register
; restore STATUS from user defined memory
; restore ACC from user defined memory
114
HT66F488/HT66F489
BG
�ove��e� ��� 2�1�
Need help?
Do you have a question about the HT66F488 and is the answer not in the manual?
Questions and answers