	INCLUDE	68HC11F1.DEF	
	INCLUDE	AS11.MAC	
	INCLUDE	MAP.ASM	
			
	CODE		
	VECTOR_RESET		
RESET	EQU	*	
	INCLUDE	INIT.ASM	
MLOOP	EQU	*	;main loop start
	TST	T4MS0	
	BEQ	M10	
	BRA	M20	
M10	LDAA	#5	;restart timer
	STAA	T4MS0	
M20	JSR     READ_ADC
        TST     QSCI    ;nothing to do
        BEQ     MLOOP
        CLR     QSCI
        LDAA    SCIRB   
        CMPA    #'A'    ;see if valid interrogation
        BNE     MLOOP
        JSR     CONVERT ;convert AN0 to 2 ascii characters in SCIXB
        JSR     SEND    ;send converted value as 2 bytes
        JMP	MLOOP	
* main loop ends here
        INCLUDE TIMER.ASM
        INCLUDE ANALOG.ASM
        INCLUDE SCI.ASM
        INCLUDE GENLIB.ASM

	END		
