GMS81C7208/7216
FEB. 2005 Ver 1.04
xxiii
GOGET: CLRC ;UP8 LO8
LDA ADR ;ADTTL2|ADTTL0 = CH4 DATA
ADC ADTTL+X ;ADTTL3|ADTTL1 = CH5 DATA
STA ADTTL+X
LDA #0
ADC ADTTL+2+X
STA ADTTL+2+X
;
INC ADCNT+X
LDA ADCNT+X
IF A == #DIVISOR ;GET AVERAGE VALUE
LDA #0
STA ADCNT+X
LDY ADTTL+2+X
LDA ADTTL+X
PUSH X
LDX #DIVISOR ;DIVIDE BY DIVISOR
DIV
POP X
STA ADR_AVR+X
LDA #0 ;CLEAR SUM BUF.
STA ADTTL+X
STA ADTTL+2+X
LDA ADR_AVR+X
IF A < #65 ;IGNORE BELOW 65
LDA #65
ENDIF
IF A > #240 ;MAX. 240
LDA #240
ENDIF
CMP #181 ;MAKE SIGN
ROL SIGN+X ;COPY TO MINUS OR PLUS
SETC
SBC #65
TAY
LDA !ADTABLE1+Y
STA ONDO+X
ENDIF
NOT1 AD_CH
ADCQUIT: RET
;
;
ADTABLE DB 50H,49H,49H,48H,48H,47H ; 65~ 70 65->+50’C
DB 47H,46H,46H,45H,45H,44H,44H,43H,43H,42H ; 71~ 80
DB 41H,41H,40H,40H,40H,39H,39H,38H,38H,37H ; 81~ 90 83->+40'C
DB 37H,36H,36H,35H,35H,34H,34H,33H,33H,32H ; 91~100
DB 32H,31H,31H,30H,30H,30H,29H,29H,28H,28H ;101~110 105->+30'C
DB 27H,27H,26H,26H,25H,25H,24H,24H,24H,23H ;111~120
DB 23H,22H,22H,22H,21H,21H,20H,20H,20H,20H ;121~130 129->+20'C
DB 19H,19H,18H,18H,17H,17H,16H,16H,15H,15H ;131~140
DB 15H,14H,14H,14H,13H,13H,13H,12H,12H,12H ;141~150
DB 11H,11H,11H,10H,10H,10H,09H,09H,09H,08H ;151~160 154->+10'C
DB 08H,07H,07H,07H,06H,05H,05H,04H,04H,04H ;161~170
DB 03H,03H,02H,02H,01H,01H,00H,00H,00H,01H ;171~180 178-> 0'C
DB 01H,02H,02H,03H,03H,04H,04H,05H,05H,06H ;181~190
DB 06H,07H,07H,08H,08H,09H,09H,10H,10H,11H ;191~200 199->-10'C
DB 11H,12H,12H,13H,13H,14H,15H,15H,16H,17H ;201~210
DB 17H,18H,18H,19H,19H,20H,20H,21H,21H,22H ;211~220 217->-20'C
DB 23H,23H,24H,24H,25H,25H,26H,27H,28H,29H ;221~230
DB 30H,31H,32H,33H,34H,35H,36H,37H,38H,39H ;231~240 231->-30'C
DB 40H,41H,42H
ADTABLE1 DB 50H,50H,50H,49H,49H,48H ; 65~ 70 65->+50’C
DB 48H,47H,47H,46H,46H,45H,45H,44H,44H,43H ; 71~ 80
DB 43H,42H,41H,40H,39H,38H,37H,36H,35H,34H ; 81~ 90 83->+40'C
DB 35H,35H,34H,34H,33H,33H,32H,32H,31H,31H ; 91~100
DB 30H,30H,29H,29H,28H,28H,27H,27H,26H,26H ;101~110 105->+30'C
DB 26H,25H,25H,25H,24H,24H,24H,23H,23H,23H ;111~120
DB 22H,22H,22H,21H,21H,21H,20H,20H,20H,20H ;121~130 129->+20'C
DB 19H,18H,18H,18H,17H,17H,17H,16H,16H,16H ;131~140
DB 15H,15H,15H,14H,14H,14H,13H,13H,13H,12H ;141~150
DB 12H,11H,11H,10H,10H,09H,09H,09H,08H,08H ;151~160 154->+10'C
DB 07H,07H,06H,06H,05H,05H,04H,04H,04H,03H ;161~170
DB 03H,03H,02H,02H,02H,01H,01H,01H,00H,00H ;171~180 178-> 0'C
DB 01H,01h,02H,02H,03H,03H,04H,04H,05H,05H ;181~190
DB 06H,06H,07H,07H,08H,08H,09H,09H,10H,10H ;191~200 199->-10'C
DB 11H,11H,12H,12H,13H,13H,14H,15H,15H,16H ;201~210
DB 16H,16H,17H,18H,18H,19H,19H,20H,20H,21H ;211~220 217->-20'C