What does I2C_NONFIFO_EN?
Posted: Wed Jul 04, 2018 1:12 am
Hi,
I am trying to understand the I2C data buffer concept. According to the Technical Reference Manual v.3.4, chapter 11, page 278, there is a 32 words buffer at REG_I2C_BASE + 0x100. Each byte received or transmitted is stored in the lower 8 bits of a buffer word, the upper 24 bits are unused.
Then: "Users need to set register I2C_NONFIFO_EN".
Q1: For what purpose? Use that buffer? Where is the I2C data stored or read from if I don't set that bit?
Another thing related to the data buffer: In chapter 11.3.4, I2C Cmd Structure, page 280, the "byte_num" field of a command word determines the number of bytes to be transfered in an READ or WRITE command. The bit field has a length of 8 bits and allows values between 1 and 255.
Further down at the bottom of page 281, the doc says "the I2C master can transmit up to (14*255-1) bytes of valid data, and the cmd unit is populated with RSTART + 14 WRITE + 1 STOP". So each WRITE command can transmit 255 bytes of payload data. Which fits to the size of the "byte_num" field.
Q2: How can I transfer 255 (256?) bytes with one command if the data buffer is only 32 * 4 = 128 bytes long? And even stranger, if only the lower 8 bits of a buffer word is used, giving a buffer capacity of 32 bytes if I2C_NONFINO_EN is set?
What am I missing here?
Thanks for your help!
Bass Mati
I am trying to understand the I2C data buffer concept. According to the Technical Reference Manual v.3.4, chapter 11, page 278, there is a 32 words buffer at REG_I2C_BASE + 0x100. Each byte received or transmitted is stored in the lower 8 bits of a buffer word, the upper 24 bits are unused.
Then: "Users need to set register I2C_NONFIFO_EN".
Q1: For what purpose? Use that buffer? Where is the I2C data stored or read from if I don't set that bit?
Another thing related to the data buffer: In chapter 11.3.4, I2C Cmd Structure, page 280, the "byte_num" field of a command word determines the number of bytes to be transfered in an READ or WRITE command. The bit field has a length of 8 bits and allows values between 1 and 255.
Further down at the bottom of page 281, the doc says "the I2C master can transmit up to (14*255-1) bytes of valid data, and the cmd unit is populated with RSTART + 14 WRITE + 1 STOP". So each WRITE command can transmit 255 bytes of payload data. Which fits to the size of the "byte_num" field.
Q2: How can I transfer 255 (256?) bytes with one command if the data buffer is only 32 * 4 = 128 bytes long? And even stranger, if only the lower 8 bits of a buffer word is used, giving a buffer capacity of 32 bytes if I2C_NONFINO_EN is set?
What am I missing here?
Thanks for your help!
Bass Mati