S32K1XX I2C FIFO

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

S32K1XX I2C FIFO

Jump to solution
439 Views
Embedded_novice
Contributor I

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 Kudos
1 Solution
409 Views
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!

View solution in original post

0 Kudos
4 Replies
425 Views
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 Kudos
419 Views
Embedded_novice
Contributor I

@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 Kudos
410 Views
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 Kudos
423 Views
Embedded_novice
Contributor I

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 Kudos