2 Replies Latest reply on Jun 12, 2018 12:45 AM by gani

    How to put CY8CMBR3116 in DEEP-SLEEP state?

    samuele_3355726

      Hi,

      we're thinking about using the CY8CMBR3116 to control some capacitive buttons on one of our product.

      The CY8CMBR3116 will be controlled via I2C from another MCU and I have the need to put the CY8CMBR3116 in DEEP-SLEEP state (our board is battery-powered).

      To test the CY8CMBR3116 we are currently using the Cypress CY8CMBR3116 development board connected to our MCU through the compatible Arduino pinouts.

       

      We have setup the Cypress CY8CMBR3116 development board using the EZ-Click software - we have loaded one of the default configuration files where the board is using the proximity loop and the 4 touch buttons.

       

      As a first test, I've managed to read the whole register configuration of the CY8CMBR3116 using our MCU (the register configuration written from the EZ-Click sotware).

       

      Then, to test the DEEP-SLEEP functionality I've coded a small firmware for my MCU that executes only these operations at boot:

       

      #define CY8CMBR3116_ADDR  0x37
      #define REG_CTRL_CMD      0x86
      
      int main (void)
      {
          unsigned char ctrl_cmd;
      
          // read the CTRL_CMD register
          ctrl_cmd = I2C_READ(CY8CMBR3116_ADDR, REG_CTRL_CMD);
      
          // As there is written on the CapSense 'Express Controllers Registers TRM'
          // The host may write this register at any time that its value is 0. 
          // If the host writes to this register while its value is non-zero, 
          // device response to the newly requested command is undefined.
      
          if (ctrl_cmd == 0)
          {
              printf("ctrl_cmd = %d [enter in deep-sleep]\n", ctrl_cmd);
              // write the command to CTRL_CMD
              I2C_WRITE(CY8CMBR3116_ADDR, REG_CTRL_CMD, 0x07);
          }
          else
          {
              printf("ctrl_cmd = %d [NOT enter in deep-sleep]\n", ctrl_cmd);
          }
      
          while (1)
          {
          }
      }
      

       

      and the log I obtain in the debug output console is:

       

      ctrl_cmd = 0 [enter in deep-sleep]
      

       

      but then if I click on the buttons on the development board, the buttons still flash the leds and the buzzer beeps... so it seems that the controller is not entering in the DEEP-SLEEP state.

       

      As I understand from the datasheet, I cannot read the CTRL_CMD_STATUS or the CTRL_CMD_ERR registers after sending the first command, because any other I2C transaction will wakeup the CY8CMBR3116 from the deep sleep state, so I don't execute any other I2C read write operration after the CTRL_CMD write.

       

      Another question: is it possible that there isn't any register on the CY8CMBR3116 to get the current controller state (i.e. Look-for-Touch / Look-for-Proximity... etc.)? How can I know if the CY8CMBR3116 is working correctly as expected from the configuration?

       

       

      Thanks for your support.

      Regards,

      Samuele.