求助:为什么5509a的iic设置后没有SCL没有信号?

2019-07-30 17:44发布

今天调试iic,按照csl库的例程,设置了IIC,但在示波器上看不到SCL信号,当然也就访问不了外部IIC设备了。会是什么原因呢?设置如下:
/*锁相环的设置*/
PLL_Config  myConfig      = {
  0,    //IAI: the PLL locks using the same process that was underway
                //before the idle mode was entered
  1,    //IOB: If the PLL indicates a break in the phase lock,
                //it switches to its bypass mode and restarts the PLL phase-locking
                //sequence
  12,    //PLL multiply value; multiply 12 times
  1             //Divide by 2 PLL divide value; it can be either PLL divide value
                //(when PLL is enabled), or Bypass-mode divide value
                //(PLL in bypass mode, if PLL multiply value is set to 1)
};
/* Create and initialize an I2C initialization structure */
I2C_Setup iicInit = {
        0,              /* 7 bit address mode */
        0,         /* own address - don't care if master */
        120,            /* clkout value (Mhz)  */
        20,            /* 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*/
};
void main(void)
{
   Uint16 iicBuf[3];
               
    CSL_init();

    PLL_config(&myConfig);
                    
   I2C_setup(&iicInit);
   
    /* Write a data byte to I2C */
    //x=I2C_write(databyte1,1,1,0x70,1,30000);
    for(i = 0; i < 100; i++)
    {
    /* Read data byte from I2C */
    count=I2C_read(iicBuf,3,1,0x70,1,30000,0);
    }
}
在读IIC的时候,通过示波器观察SCL脚,并没有脉冲信号。读一次就会拉低。
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
12条回答
lishong
2019-07-31 13:20
本帖最后由 lishong 于 2015-3-6 16:37 编辑

今天反复测试了,还是没找到问题。如果加上总线检测,则会函数返回提示为总线忙,直接就写地址的时候,只有start信号,地址都不能写了。count=I2C_read(iicBuf,3,1,0x70,1,30000,1);----返回为1.硬件电路上没发现什么问题,简单的电路连接,目前IIC总线上就只挂了一IIC设备(其他IIC设备还没焊接),sda,scl都有接上拉。EEPROM跟换过也没效果。搞不懂啥问题的了。

一周热门 更多>