How to disable/remove clock stretching from SCB_I2C component?

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

cross mob
PaBr_4578176
Level 2
Level 2
First like given Welcome!

Hi,

Anyone tried to remove it from implementation? I know in EZI2C there is a checkbox, but in I2C I'm not sure what exactly I should remove from original implementation I2C to remove clock stretching.

I need this modification because my I2C Master (micro Renesas K0R) doesn't support these things. And when I tries send enter bootload command I get:

tek00009_LI.jpg

Any ideas? I kindly ask for help.

0 Likes
1 Solution
Ashish
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

Can you check the register SCBx_I2C_CTRL  register (x=0,1 .. depending on which peripheral is being used.). There is a bit S_NOT_READY_DATA_N ACK (bit 15), and S_NOT_READY_ADDR_ NACK (bit 14). They should be 1 if no clock streching is required.  I would suggest you to check the register TRM (https://www.cypress.com/file/285406/download ) page 449-450 for a detailed explanation.

Thanks,

Ashish

View solution in original post

2 Replies
Ashish
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

Can you check the register SCBx_I2C_CTRL  register (x=0,1 .. depending on which peripheral is being used.). There is a bit S_NOT_READY_DATA_N ACK (bit 15), and S_NOT_READY_ADDR_ NACK (bit 14). They should be 1 if no clock streching is required.  I would suggest you to check the register TRM (https://www.cypress.com/file/285406/download ) page 449-450 for a detailed explanation.

Thanks,

Ashish

Hi,

Thank you very much for your help! I've just added SCB_I2C_CTRL_REG |= 0xF800 line below  /* Configure I2C interface */ in SCB_I2CInit function and I see some progress. Now, write data are sending correctly, but sometimes I'm observing on the oscilloscope response data shifted by one bit. However, in the logs form I2C Master there are printed ACK'a so far. I will perform more tests but it looks promising.

Regards,

Pawel

0 Likes