S32K1XX I2C FIFO

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K1XX I2C FIFO

跳至解决方案
894 次查看
Embedded_novice
Contributor II

Recently, I have been using the I2C function of the S32K116 chip, and I would like to know how to obtain the FIFO size of I2C. I can only know my FIFO from the debug_ Count=1, FIFO_ Size=4. How can I determine the maximum number of bytes that I2C can transmit at once.Snipaste_2024-01-17_21-30-27.png

0 项奖励
回复
1 解答
864 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Embedded_novice,

The I2C bus specification (I2C-bus specification) defines the byte format by the following:

Every byte put on the SDA line must be eight bits long. The number of bytes that can be transmitted per transfer is unrestricted.

Hardware itself doesn't limit the read transfer size, but just requires the software to queue multiple read data commands. Currently, the driver can only receive 1-256 bytes of data (can also be configured to discard receive data and not store in receive FIFO).

I hope you find this useful!

在原帖中查看解决方案

0 项奖励
回复
4 回复数
880 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Embedded_novice,

The size of the TX & RX FIFO is 4 words, as described in the S32K1xRM:

Julin_AragnM_0-1705529486724.png

The default value is: RXFIFO = 0x02, TXFIFO = 0x02, that means the maximum number of words in the receive/transmit FIFO is 4(2^0x02).

Julin_AragnM_2-1705530066482.png

Best regards,
Julián

0 项奖励
回复
874 次查看
Embedded_novice
Contributor II

@Julián_AragónM 

When I was checking the source code, I found that there seems to be no limit on the maximum number of bytes sent, but the maximum number of bytes received is only 256 bytes.

I would like to ask if this means that the maximum number of bytes sent depends on the maximum number of bytes received. Another question is how is the maximum number of bytes received, 256 bytes, calculated?

0 项奖励
回复
865 次查看
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @Embedded_novice,

The I2C bus specification (I2C-bus specification) defines the byte format by the following:

Every byte put on the SDA line must be eight bits long. The number of bytes that can be transmitted per transfer is unrestricted.

Hardware itself doesn't limit the read transfer size, but just requires the software to queue multiple read data commands. Currently, the driver can only receive 1-256 bytes of data (can also be configured to discard receive data and not store in receive FIFO).

I hope you find this useful!

0 项奖励
回复
878 次查看
Embedded_novice
Contributor II

hello@Julián_AragónM 

  Does this mean that I can only transfer up to 8 bytes on the I2C bus at a time? When I try to call LPI2C_ DRV_ MasterSendDataBlocking(), I found that in the example program of S32DS, 64 bytes were transferred at once. I attempted to transfer more than 70 bytes once in my code, but was still able to transfer (I read and write EEPROM through I2C) and successfully read all incoming bytes.
  My question is, if I transfer more than the maximum depth of the FIFO at once, what will be done to the bytes that exceed the depth?Will it trigger a certain event or will it truncate the excess and retransmit it?

0 项奖励
回复