使用P89C668(带I2C口)(做主发送器),初始化AD公司的一片用于视频的模数转换的芯片AD9882(有I2C接口)(从接收器),可是AD9882没有响应. 程序如下: S1CON DATA 0D8H S1STA DATA 0D9H S1DAT DATA 0DAH S1ADR DATA 0DBH CR0 BIT 0D8H CR1 BIT 0D9H AA BIT 0DAH SI BIT 0DBH STO BIT 0DCH STA BIT 0DDH ENS1 BIT 0DEH SDA BIT 97H SCL BIT 96H SLA DATA 50H SUBA DATA 51H NUM DATA 52H ORG 0000H LJMP MAIN ORG 0190H ERR: SETB P2.0 CLR P2.0 RET ORG 0200H MAIN: MOV R4,#90H DJNZ R4,$ CLR SCL SETB SDA JNB SDA,ERR SETB SCL JNB SCL,ERR CLR P2.1 MOV S1CON,#0C5H SETB STA JNB SI,$ MOV SLA,#98H MOV DPTR,#ADDATA MOV R1,#0AH MOV A,SLA MOV S1DAT,A MOV S1CON,#0C5H JNB SI,$ MOV A,S1STA CJNE A,#18H,WEND MOV A,01H MOV S1DAT,A MOV S1CON,#0C5H JNB SI,$ MOV A,S1STA CJNE A,#28H,WEND L1: CLR A MOVC A,@A+DPTR MOV S1DAT,A MOV S1CON,#0C5H JNB SI,$ MOV A,S1STA CJNE A,#28H,WEND INC DPTR DJNZ R1,L1 SETB P2.1 WEND: MOV S1CON,#0D5H ADDATA:DB 53H,0F0H,68H,00H,40H,44H,20H,66H,66H,66H END |