PSoC6 I2C busy stuck high

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

cross mob
DaKe_329326
Level 1
Level 1
5 sign-ins First solution authored First reply posted

I'm using an I2C master in PSoC Creator 4.4 on a PSoC6 microcontroller (CY8C6117BZI-F34).  I'm using the high-level API for writes and reads.  Occasionally, I find that the busy status (CY_SCB_I2C_MASTER_BUSY) returned by Cy_SCB_I2C_MasterGetStatus() never goes to 0 after a Cy_SCB_I2C_MasterWrite or Cy_SCB_I2C_MasterRead.  I can do thousands of accesses without a problem, but occasionally busy never goes to 0.  What can cause busy to not de-assert like this?  Are there hardware issues that I should look at?  Is there a way to get more details on why busy does not clear?

0 Likes
1 Solution
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @DaKe_329326 ,

The I2C bus busy flag is set whenever a start condition is detected on the bus. This flag is cleared on detecting a stop condition and it assumes that another master is sending the data. But due to noise, a false start condition may be detected on the I2C bus and the I2C bus can get stuck in a busy state.

Warm Regards,
Gautami J

View solution in original post

4 Replies
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @DaKe_329326 ,

Please check if you have enabled the interrupt in the NVIC.
If not please add: 
NVIC_EnableIRQ((IRQn_Type) I2CM_SCB_IRQ_cfg.intrSrc); 

Please refer to a similar thread​ .

Warm Regards,
Gautami J

0 Likes

That you for the suggesting.  I am doing the NVIC_EnableIRQ call.  It is included in the I2C_Master_Start() function I'm using from the "Generate_Source" directory of PSoC Creator.  Unfortunately, I did not find anything relevant in the thread you linked.  That thread is about I2C not working "wiggling pins" at all.  Mine works most of the time, but occasionally gets the busy status stuck high.

0 Likes
Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @DaKe_329326 ,

The I2C bus busy flag is set whenever a start condition is detected on the bus. This flag is cleared on detecting a stop condition and it assumes that another master is sending the data. But due to noise, a false start condition may be detected on the I2C bus and the I2C bus can get stuck in a busy state.

Warm Regards,
Gautami J

Gautami_12
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @DaKe_329326  ,

The thread was locked due to inactivity for a long time, you can continue the discussion on the topic by opening a new thread with reference to the locked one. The continuous discussion in an inactive thread may mostly be unattended by community users.

Thanks and Regards,
Gautami J
Cypress Semiconductor Corporation
An Infineon Technologies Company

0 Likes