Holtek HT45F23A Manual page 88

Tinypower flash mcu with opa & comparators
Table of Contents

Advertisement

Example: using the interrupt method to detect the end of conversion
clr EADI
mov a,01H
mov ACSR,a
mov a,FFh
mov ADPCR,a
mov a,00h
mov ADCR,a
Start_conversion:
clr START
set START
clr START
clr ADF
set EADI
set EMFI
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
Clr ADF
reti
Rev. 1.40
TinyPower
Flash MCU with OPA & Comparators
TM
; disable ADC interrupt
; select f
/8 as A/D clock
SYS
; select VDD as ADC reference voltage and turn on ADONB bit
; setup ADPCR to configure pins AN0~AN7
; 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 Multi-function 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
; clear ADC interrupt request flag
88
HT45F23A/HT45F24A
March 29, 2019

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the HT45F23A and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Ht45f24a

Table of Contents