DSPRelated.com
Forums

problem about I2C Module In tms320C6713

Started by zhao...@126.com November 13, 2005
Hello everyone,
I met a problem when configing I2C in TMS320C6713.I wang to config I2C0 as Master-Transmitor.When I2C0 transmits dates,there is
START signal on SDA,while there pule on SCL.After START has been sent,the SCL is LOW,and the SDA is HEIGH.SDA and SCL has been
pull-up.Can someone tell me where the error is.Thanks.

I2c_XmtCfg.i2coar=0x00000007; /* I2COAR - Must be used as slave */
I2c_XmtCfg.i2cimr=0x00000000; /* I2CIER - Disable interrupts, use polling */
I2c_XmtCfg.i2cclkl; /* I2CCLKL - Low period for 100KHz operation */
I2c_XmtCfg.i2cclkh; /* I2CCLKH - High period for 100KHz operation */
I2c_XmtCfg.i2ccnt=0x00000001;/* I2CCNT - Data words per transmission */
I2c_XmtCfg.i2csar=0x00000050; /* I2CSAR - Slave address */
I2c_XmtCfg.i2cmdr=0x000026a0; /* I2CMDR - Mode */
I2c_XmtCfg.i2cpsc=0x00000001; /* I2CPSC - Prescale 20MHz to 10MHz */

I2cXmtHandle=I2C_open(I2C_PORT0,I2C_OPEN_RESET);//open port
*(volatile unsigned int *)I2CMDR0&=~0x20;//reset
*(volatile unsigned int *)I2CPSC0=0x00;//Prescale
I2C_config(I2cXmtHandle,&I2c_XmtCfg);//config port

while (I2C_bb(I2cXmtHandle))//is easy/
{
I2C_RSET(I2CSTR0,_I2C_I2CSTR_BB_MASK);
}

while(!I2C_xrdy(I2cXmtHandle));
I2C_start(I2cXmtHandle);//there is output
while(!I2C_xrdy(I2cXmtHandle));
I2C_writeByte(I2cXmtHandle,0xff);//there is not output