;************************************************************************* ; adcin subroutine ; Return ACC with the 8 bit A/D conversion from the channel selected by ACC ; ;************************************************************************* $NOMOD51 ; omit assembler micro definitions $Include(reg515.inc) ; define 515 micro Name adcin PUBLIC adcin EXTRN DATA(ADDSAVE1, ADDSAVE2) EXTRN CODE(DLAYZ) anal_conv SEGMENT CODE RSEG anal_conv ; switch to this code segment USING 0 ; use register_bank 0 ADCIN: MOTOR1: MOV DPH,#70H MOV DPL,#00H MOVX A,@DPTR ADD A,#10 MOV ADDSAVE1,A ;SAVE VALUE FROM AD FUNCTION ;LCALL DLAYZ ;LCALL DLAYZ MOTOR2: MOV DPH,#71H MOV DPL,#00H MOVX A,@DPTR MOV ADDSAVE2,A ;SAVE VALUE FROM AD FUNCTION RET END