*12456789012345678901245678901234567890124567890123456789 #INCLUDE 'A:\VAR_DEF.ASM' * Define program variables ORG DATA VAL1 RMB 1 ; 1st capture VAL2 RMB 1 ; 2nd capture VAL3 RMB 1 ; 3rd capture VAL4 RMB 1 ; 4th capture * Main program ORG PROGRAM START LDX #REGBAS * switch on A/D converter BSET OPTION,X,%10000000 * Perform a scanned A/D conversion on PE1 ADC LDAA #%00100001 ; SCAN=1, MULT=0, CA=1 STAA ADCTL,X * Store the four consecutive conversion values LABEL2 LDAA ADR1,X STAA VAL1 LDAA ADR2,X STAA VAL2 LDAA ADR3,X STAA VAL3 LDAA ADR4,X STAA VAL4 BRA LABEL2 ; back to the top SWI ORG RESET ; reset vector FDB START ; set to start of program