MC56F8037 I2C automatic stop condition makes the Write-Read operation impossible

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MC56F8037 I2C automatic stop condition makes the Write-Read operation impossible

680 Views
qingfengxiaosha
Contributor I

I was trying to read the register of a 3-axis accelerometer using I2C module. The required read protocol is shown fig.1 shows. As we can see, To read the registers, the master sends a start condition, followed by the I2C address and a write bit, and then the register address that is going to be read. Upon receiving the ACK, the master transmits a start signal followed by the slave address and read bit. However, since 8037 has the feature of automatic stop condition, after calling the sendblock() function to send the I2C address and register address, the automatically sent stop condition will terminate the communication with the salve. Then even if I send the I2C address again, no data will be sent back. The feature of automatic stop condition can’t be removed in process expert, just as figure.2 shows.

My questions are: is it possible for 8037 to complete the protocol shown in fig.1? Can I send the stop condition manually by operating the internal registers of 8037 directly? How to generate a repeated start condition, instead of the stop condition, after sending the register address of the slave.

Thank you very much!

17766_17766.pngw.png

17767_17767.pngw1.png

Fig.1

17768_17768.pngw3.png

Fig.2

Labels (1)
0 Kudos
1 Reply

499 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Dear XingLong

I think the IIC of MC56F8037 can implement the timing as you required. Firstly, you can set up the IIC in master and Repeated Start Enable mode by setting the SLV_DIS, MST_EN and RST_EN bits in IIC control register. secondly, I suggest you enable FIFO for both receiver/transmitter by setting the TXFT register in non-zero value.

You can write the data register in the following order:

1)write the slave address to  DATA register with the CMD=WRITE.

2)write the register address of 3-axis acceleromete to DATA register with CMD=READ

3)write the slave address to DATA register with CMD=READ

4)read data register

.....

BR

XiangJun Rong

0 Kudos