这个是我写的程序:AD_RS0: MOV R1,#10 ;读1549 SETB AD_CS CLR AD_CLK CALL RST_DOG AD_RS1: SETB AD_CLK NOP NOP CLR AD_CLK DJNZ R1,AD_RS1 CLR AD_CS NOP NOP CALL DELAY SETB AD_CS CALL DELAY MOV A,#0 ;CLR EA ;stop break CLR AD_CS NOP NOP SETB AD_CLK CLR C ;读取高2位 MOV C,AD_DAT ;get first MSB RLC A CLR AD_CLK NOP CLR C SETB AD_CLK MOV C,AD_DAT ;get secondary MSB RLC A MOV AD_DATH,A ;get two MSB CLR AD_CLK MOV R1,#8 ;读取低8位 MOV A,#0 AD_RS2: SETB AD_CLK CLR C MOV C,AD_DAT RLC A CLR AD_CLK DJNZ R1,AD_RS2 MOV AD_DATL,A ;gain last eight bit RET |