1 Reply Latest reply on Jun 27, 2018 4:59 AM by GaneshD_41

    CY8CMBR3116 Re-initialization problem

    mamata.nivalkar_3017621

      Hello,

       

      I am facing one issue with CY8CMBR3116. In my application, I am using 12 sensors instead of 16. Its working fine. Now as per my application need, I keep only 6 sensors enable during sleep mode of host controller by initializing CY8CMBR3116 and whenever host controller is wake up, I re-initialize the CY8CMBR3116 to enable 12 sensors. But it is observed that CY8CMBR3116 never get re-initialized. It keeps only 6 sensors enable and rest disable.

      So, can you please tell me why this is happening?

       

      The sequence I am following is as follows,

       

          • CYPRESS_CAPSENSE_DEVICE_ADD – 0x6E and All registers addresses are as mentioned in the “Capsense Controllers registers TRM” document ***

       

      Cypress_Module_Data[0] = 0x40;        /* Configure host interrupt pulse at SPO1 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, SPO_CFG_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = 0xFE;        /* CS2 to CS7 enable and CS0 - CS1 disable */

      Cypress_Module_Data[1] = 0x1F;        /* CS8 to CS13 enable and CS14 - CS15 disable */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, SENSOR_ENABLE_ADD, 1, Cypress_Module_Data, sizeof(Cypress_Module_Data), 4);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = 0xFE;        /* CS2 to CS7 FSS enable and CS0 - CS1 FSS disable */

      Cypress_Module_Data[1] = 0x1F;        /* CS8 to CS13 FSS enable and CS14 - CS15 FSS disable */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FSS_ENABLE_ADD, 1, Cypress_Module_Data, sizeof(Cypress_Module_Data), 4);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = 0;            /* Disable Automatic threshold setting */

      Cypress_Module_Data[1] = 0;

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, DEVICE_CFG2_ADD, 1,&Cypress_Module_Data[0], 1, 2);        // Disable AUtomatic threshold setting.

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_SENSITIVITY;  /* 0xFF */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, SENSITIVITY_0_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_SENSITIVITY; /* 0xFF */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, SENSITIVITY_1_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_SENSITIVITY ;/* 0xFF */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, SENSITIVITY_2_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_SENSITIVITY;/* 0xFF */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, SENSITIVITY_3_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD; /* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, BASE_THRESHOLD_0_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD; /* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, BASE_THRESHOLD_1_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_2_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_3_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_4_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_5_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_6_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_7_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_8_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_9_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_10_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_11_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_12_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = FINGER_THRESHOLD;/* 100 */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, FINGER_THRESHOLD_13_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = CYPRESS_REFRESH_INTERVAL;/* 3 - 60mS refresh interval */

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, REFRESH_CONTROL_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = 0x9E;        /* Write button hysteresis value and enable overwrite */

      Cypress_Module_Data[1] = 0x00;

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, BUTTON_HYS_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      /*Reset The Cypress Capsense IC */

      Cypress_Module_Data[0] = 0x03;        /* Send calculate CRC command */

      Cypress_Module_Data[1] = 0x00;

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, CNTRL_CMD_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = 0x00;        /* Read the calculated CRC value */

      Cypress_Module_Data[1] = 0x00;

      HAL_I2C_Mem_Read(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, CALC_CRC_ADD, 1, Cypress_Module_Data, 2, 4);

      HAL_Delay(5);/* Delay of 5mS */

       

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, CONFIG_CRC_ADD, 1, Cypress_Module_Data, 2, 4);//Write the CRC value to control register */

      HAL_Delay(5);/* Delay of 5mS */

       

      Cypress_Module_Data[0] = 0x02;        /* Save the configuration data to non-volatile memory */

      Cypress_Module_Data[1] = 0x00;

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, CNTRL_CMD_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(220);/* Delay of 220mS */

       

      Cypress_Module_Data[0] = 0x00;        /* Read the control command status register to check whether configuration is saved successfully */

      Cypress_Module_Data[1] = 0x00;

      HAL_I2C_Mem_Read(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, CNTRL_CMD_STATUS_ADD, 1, Cypress_Module_Data, 1, 2);

      HAL_Delay(10);/* Delay of 10mS */

       

      Cypress_Module_Data[0] = 0xFF;        /* Issue the reset command once the configuration data saved successfully */

      Cypress_Module_Data[1] = 0x00;

      HAL_I2C_Mem_Write(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, CNTRL_CMD_ADD, 1, &Cypress_Module_Data[0], 1, 2);

      HAL_Delay(300);/* Delay of 300mS */

      /* Read the values written to Cypress IC registers */

      Cypress_Module_Data[0] = 0x00;        /* Check written data is saved */

      Cypress_Module_Data[1] = 0x00;

      HAL_I2C_Mem_Read(&hi2c1, CYPRESS_CAPSENSE_DEVICE_ADD, BUTTON_HYS_ADD, 1, Cypress_Module_Data, 1, 2);

      HAL_Delay(10);/* Delay of 10mS */

       

      If any thing is missing in this sequence, please let me know.

       

      Thanks & Regards,

      Mamata Nivalkar