216/317
7 - Debugger and PROM Programmer Tutorial for ST72251
DC.W intTim_A ; Timer A: ($FFF2)
DC.W 0
DC.W 0
DC.W 0
DC.W 0
DC.W 0
res:
DC.W reset ; vecteur de reset ($FFFE)
END
7.6.4.2 ADC source file(Acana.asm)
The analog to digital conversion handling is done in this short file:
ST7/
;=============================================================
;= Analog to digital conversion =
;=============================================================
; relocatable sub-routine to initialise the ADC and to run a
; conversion
; The program which calls this routine selects the channel to
; be converted by loading the accumulator with the channel number
#include "REGISTER.INC"
PUBLIC acana
EXTERN watch.b
SEGMENT 'rom'
WORDS
; ADC initialization
; ==================
acana: ; On entry, A contains the channel selector bit
add A, #$20 ; Make up the ADC control word : set ADON: A/D
converter on
ld adccsr, a ; Start the conversion
; Analog to digital conversion
; ======================
bclacana:
ld a, #watch ; Load the watchdog
ld wdgr, a
btjf adccsr,#COCO,bclacana ; wait for the acquisition
ret ; Conversion finished.
END