English
Language : 

MC68HC812A4 Datasheet, PDF (304/342 Pages) Motorola, Inc – 16-bit device composed of standard on-chip peripheral modules connected by an intermodule bus. Modules include
Analog-to-Digital Converter (ATD)
; ----------------------------------------------
;
Subroutine CONVERT:
;
; ----------------------------------------------
; Set-up ATD, make single conversion and store the result to a memory location.
; Configure and start A/D conversion
; Analog Input Signal: On PORT AD6
; Convert: using single channel, non-continuous
; The result will be located in ADR2H
CONVERT:
LDAA
;
STAA
;
#$06
ATDCTL5
; Initializes ATD SCAN=0,MULT=0, PAD6,
; Write Clears Flag
; 4 conversions on a Single Conversion
; sequence,
WTCONV: BRCLR ATDSTATH,#$80,WTCONV ; Wait for Sequence Complete Flag
LDD
ADR2H
;
; Loads conversion result(ADR2H)
; into Accumulator
BRA
CONVERT
; Continuously updates results
RTS
; Return from subroutine
;* -------------------------------
;* Subroutine DELAY 100 uS *
;* -------------------------------
; Delay Required for ATD converter to Stabilize (100 uSec)
DELAY:
LDAA
DECA
BNE
RTS
#$C8
DELAY
; Load Accumulator with "100 uSec delay value"
; Decrement ACC
; Branch if not equal to Zero
; Return from subroutine
END
; End of program
MC68HC812A4 — Rev. 3.0
304
Analog-to-Digital Converter (ATD)
Advance Information
MOTOROLA