- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you configure the I2C component for byte mode?
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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