cancel
Showing results for 
Search instead for 
Did you mean: 

I2C problems

brj
Associate II
Posted on January 28, 2009 at 11:49

I2C problems

21 REPLIES 21
16-32micros
Associate III
Posted on May 17, 2011 at 12:30

Hi jj.sprague,

I'm not saying that This AN is solving issues of I2C, but It is an announcement of a new AN that extends the use of I2C cell in an advanced way with more practice examples and comes to enrich the already provided examples in the FW libraries.

For what regards the Library, we can refer to file ''version.txt'' where we can find all new improvements and evolution history of the Library and examples.

Hope that you have found what you are seeking for then you appreciate it.

Cheers,

STOne-32.

[ This message was edited by: STOne-32 on 24-09-2008 21:25 ]

crodoreda
Associate
Posted on May 17, 2011 at 12:30

Hi all,

In our application we have the same I2C Rx extra byte problem. The problem has been solved by disabling the ACK and sending the STOP before the last byte is received.

But now we have another problem. In our case all the communication routines have been implemented by using interrupts. In addition we allow nested interrupts and in the case of the I2C communication there is a SPI communication with higher priority.

The problem occurs when during the I2C Rx sequence a SPI interrupt is received. If the interrupt is received during the byte reception the extra byte problem appears again. And after the SPI ISR is finished we are not able to recover the I2C communication (SCL AND SDA low).

I attach an oscilloscope capture with this problem. The yellow signal is the SPI SCK, the blue signal is I2C SDA, the pink signal is I2C SCL and the green signal is a dummy signal that toggles when an I2C event interrupts. Therefore you can see that after the last green signal toggle (due a I2C_EVENT_MASTER_BYTE_RECEIVED event) 2 bytes are received and the second one is not due to an interrupt event.

The problem is solved by disabling the SPI interrut during I2C Rx commands but we would like to keep the SPI running during I2C communications as SPI received data needs to be read in real time.

Thanks in advance