我们公司做了一块5509开发板,板上有AIC23音频接口,用到了I2C,还接了一个时钟芯片。
型号是ISL12026,也是I2C接口的。
现在音频模块调好了,可以正常工作。
时钟程序运行时,用示波器测,SDA和SCL上都没有波形。
请高手指教,如何解决?谢谢!
附程序:
/* This next struct shows how to use the I2C API */
/* Create and initialize an I2C initialization structure */
I2C_Setup I2Cinit = {
0, /* 7 bit address mode */
0, /* own address - don't care if master */
84, /* clkout value (Mhz) */
50, /* a number between 10 and 400*/
0, /* number of bits/byte to be received or transmitted (8)*/
0, /* DLB mode on*/
1 /* FREE mode of operation on*/
};
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
/*I2C is undet reset*/
I2C_RSET(I2CMDR,0);
/*设置预分频寄存器,I2C的mode clock is 10MHz*/
delay(100);
I2C_RSET(I2CSAR,0x001A);
I2C_RSET(I2CMDR,0x0620);
I2C_FSET(I2CSTR,BB,0x1); /* Writing a 1 to BB Bus busy bit is supposed to clear it*/
I2C_setup(&I2Cinit);
//myI2C_setup(&I2Cinit);
/*设置I2C的Mater clock*/
I2C_RSET(I2CCLKL,100);
I2C_RSET(I2CCLKH,100);
I2C_getConfig(&testI2C);
/*初始化McBSP0*/
hMcbsp = MCBSP_open(MCBSP_PORT0,MCBSP_OPEN_RESET);
/*设置McBSP0*/
MCBSP_config(hMcbsp,&Mcbsp1Config);
/*启动McBSP0*/
MCBSP_start(hMcbsp,
MCBSP_RCV_START | MCBSP_XMIT_START,
0);
MCBSP_getConfig(hMcbsp,&Mcbsptest);
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
buffer1[0]=0x55;
i2c_status = I2C_write( buffer1, //pointer to data array
1, //length of data to be transmitted
1, //master or slaver
Y2K, //slave address to transmit to
1, //transfer mode of operation
30000 //time out for bus busy
);
//temp=I2C_read ( buffer2, 1, 1,PWR, 1, 30000, checkbus);
for(i=0;i<3000;i++);
|