HT67F2350/HT67F2360
HT67F2370/HT67F2390
Advanced A/D Flash MCU with LCD & EEPROM
Example: using the interrupt method to detect the end of conversion
clr ADE
mov a,03H
mov SADC1,a
mov a,00H
mov SADC2,a
set ADCEN
mov a,02h
mov PCS0,a
mov a,00h
mov SADC0,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,SADOL
mov SADOL_buffer,a
mov a,SADOH
mov SADOH_buffer,a
:
EXIT_INT_ISR:
mov a,status_stack
mov STATUS,a
mov a,acc_stack
reti
Rev. 1.60
; disable ADC interrupt
; select f
/8 as A/D clock and A/D input
SYS
; signal comes from external channel
; select AV
as the A/D reference voltage source
DD
; setup PCS0 to configure pin AN0
; select AN0 as the A/D external channel input
; 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
179
May 16, 2019
Need help?
Do you have a question about the HT67F2350 and is the answer not in the manual?