How to check the readiness of I2C before asking CPU to Deep sleep mode?

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

cross mob
Jiabin
Level 4
Level 4
100 sign-ins 25 replies posted First solution authored

Hi,

  I am using a CY8CKIT-062-BLE board that is communicating with a sensor evaluation board.

  The communication between CY8CKIT-062-BLE and the sensor is using I2C.

  I am trying to put PSoC into deepsleep when it is in an Idle state.

  However, I did the following two experiments and observed the difference in power consumption. I am very confused:

  • If I only call "Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT)" in the for(;;) loop both in CM0 and CM4, the power consumption I measured from J8 pin can be as low as 0.5 mA.
  • If I call the "I2C_Start()" function, and then call "Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT)" in the for(;;) loop both in CM0 and CM4, the power consumption I measured from J8 pin is about 0.7 mA. Does it seem that the PSoC did not enter system deepsleep mode?

  I am wondering if the reason is there is any resource to prevent the system into deepsleep mode after the initialization of the I2C. And what should I do before calling the "Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT)"?

  The above experiments are simple tests. Indeed, I am using FreeRTOS in this project, and configuring the tickless idle to put the system into deepsleep.

According to the example code, there is a function "bool IsSystemReadyForTicklessIdle(void)" for checking whether it is ready to set the tickless idle. Inside this function,  "Task_Debug_Tickless_Idle_Readiness()" is called for checking whether the UART is ready or not, using "((UART_GetNumInTxFifo() == 0u)&& (Cy_SCB_GetTxSrValid(UART_SCB__HW)== 0u))". I am wondering is there any similar API for checking whether I2C is ready or not.

 Thank you for your patience in reading my question. I have been stuck on this problem for a long time and still can not solve it.

Really appreciate your explanations or suggestions for helping me out!!

Sincerely!!

 

0 Likes
2 Replies
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @Jiabin ,

Can you let us know how is the current measurement being done? 

Please refer to the following thread and let us know it helps you : https://community.infineon.com/t5/PSoC-6/Project-CE219521-Deep-sleep-current-is-about-2-4-mA/td-p/33...

 

Regards,
Nikhil

0 Likes
Jiabin
Level 4
Level 4
100 sign-ins 25 replies posted First solution authored

Hi, @ncbs 

  Really appreciate your kind help!

  I am measuring the current flow through J8 pin in the board, using a multimeter.

  Unfortunately, I could not find the answer in the thread you provided.

Best regards,

Jiabin

0 Likes