1 Reply Latest reply on Mar 25, 2020 7:54 AM by RajathB_01

    CYPD3171-PB application VBUS divider confusion

    AnGa_4482271

      Hello,

       

      There's this function in power_bank.c, in the CYPD3171_pb example code:

       

      static uint16_t pb_get_battery_voltage(void)
      {
          /* Measure voltage on VBATT_MON GPIO. */
          uint8_t level;
          uint16_t vbatt;
      
          hsiom_set_config (VBATT_MON_GPIO, HSIOM_MODE_AMUXA);
      
          /* Take ADC sample. */
          level = pd_adc_sample (0, PD_ADC_ID_1, PD_ADC_INPUT_AMUX_A);
      
          /* Convert level to VBUS using 1/11 divider. */
          vbatt = pd_adc_level_to_volt (0, PD_ADC_ID_1, level);
          hsiom_set_config (VBATT_MON_GPIO, HSIOM_MODE_GPIO);
          /* TODO: Value on kits board is not 1/11 but around 1/12. */
          return (vbatt * 12);
      }
      

       

      What does that line mean "Value on kits board is not 1/11 but around 1/12"?

       

      I checked the schematics for CY4532 EVK board, and ratio is 49.9k*(499k+49.9k) = 1/11. I see no obvious reason to multiply the obtained value with 12.

      vbat.PNG

      Can you help me figuring out what's going on here?

       

      Thanks.

       

      EDIT: I measured the voltages on EVK: with exact 12V on top of R4, VBAT_VDC_MON is 1.088V, which corresponds to a ratio of 1/11.