|
;*****************************************************************
;Write command rountine
;*****************************************************************
Write_Command:
JB Busy_F,Write_Command_End
JB Data_Ready_F,Write_Command_End
JB Command_Ready_F,Write_Command_End
MOV A,#10011011b ;001 TO MEASURE Y-POSITION
MOV R0,#8
CLR DIN
CLR DCLK
SETB CS
CLR CS
Input_Loop:
MOV C,ACC.7
MOV DIN,C
CLR DCLK
SETB DCLK
RL A
DJNZ R0,Input_Loop
Input_Loop_End:
MOV Command_Buffer,A
SETB Command_Ready_F
SETB Busy_F
CLR Data_Ready_F
Write_Command_End:
RET
我按照上面的,把command寫進7846.
送控制字 10010000 即用差分方式读X坐标.
之後我可以看到y+有一個5v,同時y-是0v.
那我想問下,這個7846用不用等他一會,再讀dout?
因為我看到很多的都不等一等他,就像這個:http://www.gwdq.com/hy/dianzi/danpianji/C51/149320.html
ps.我是用仿真器做的,結是有command寫進,沒有東東出,dout一直是0v??:L
|
|