The number of clocks I2C Read.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

When SCB is used by I2C and it is work at Msster in Creator 4.0, SCB_I2CMastrSendStart() send 17 clocks with read sequence. Although this should be 9 clocks, why does this read send 17 clocks?

By the way, when SCB_I2CMastrSendStart() is used by Write, the write send 9 clocks correctly.

This is worked in PSoC4200 BLE.

0 Likes
1 Solution

Hi,

The following is the expected behavior of SCB I2C Master in PSoCs:

Write mode-

SCB_I2CMasterSendStart() sends out 8 clocks (Slave address + write bit) + 1 clock (For acknowledge from slave)

SCB_I2CMasterWriteByte() sends out 8 clocks (Byte to be written to slave) + 1 clock (For acknowledge from slave)

When the write operation is completed, send stop condition from master

Read mode-

SCB_I2CMasterSendStart() sends out 8 clocks (Slave address + read bit) + 1 clock (For acknowledge from slave) + 8 clocks (to read the first byte from slave)

SCB_I2CMasterReadByte (SCB_I2C_ACK_DATA) sends out 8 clocks (to read the next byte from slave) + 1 clock (Master ACKs the current byte)

SCB_I2CMasterReadByte (SCB_I2C_NAK_DATA) sends out 1 clock (Master NACKs the current byte), to stop the read transfer; followed by a stop condition sent out from master

Regards,
Shanmathi

View solution in original post

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Did you configure the I2C component for byte mode?

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

No, I do not use "Byte mode".

I checked API behavior for SCB_I2CMastrSendStart() and SCB_I2CMasterReadByte().

When I use SCB_I2CMastrSendStart() at Read sequence, this API generate Slave address and clocks for read data.

And when I use SCB_I2CMasterReadByte(SCB_I2C_NAK_DATA) for generating Negative Acknowledge, the API does not generate any clocks and return the read data. Whereas using  SCB_I2CMasterReadByte(SCB_I2C_ACK_DATA) for Acknowledge, the API generate clocks to read Slave data and return the read data by having read by former clocks of SCB_I2CMastrSendStart().

But the behavior is different form SCB datasheet.

Best regards,

0 Likes

Hi,

The following is the expected behavior of SCB I2C Master in PSoCs:

Write mode-

SCB_I2CMasterSendStart() sends out 8 clocks (Slave address + write bit) + 1 clock (For acknowledge from slave)

SCB_I2CMasterWriteByte() sends out 8 clocks (Byte to be written to slave) + 1 clock (For acknowledge from slave)

When the write operation is completed, send stop condition from master

Read mode-

SCB_I2CMasterSendStart() sends out 8 clocks (Slave address + read bit) + 1 clock (For acknowledge from slave) + 8 clocks (to read the first byte from slave)

SCB_I2CMasterReadByte (SCB_I2C_ACK_DATA) sends out 8 clocks (to read the next byte from slave) + 1 clock (Master ACKs the current byte)

SCB_I2CMasterReadByte (SCB_I2C_NAK_DATA) sends out 1 clock (Master NACKs the current byte), to stop the read transfer; followed by a stop condition sent out from master

Regards,
Shanmathi

0 Likes