This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C5535 SAR A/D Scale in Battery Measurement

Hello engineers,

I'm trying to measure a battery on my C5535 board, but I have trouble in calculating the GPAIN0 voltage from SAR A/D data.

The register settings are:
  SARCTRL    = 0x1400
  SARCLKCTRL = 0x007F
  SARPINCTRL = 0x3602
  SARGPOCTRL = 0x0000

The Reference Voltage is Bandgap 1V, and the Technical Reference Manual says that the SAR Channel 1 reads 1/8 * GPAIN0.
For example, if I apply 1.5V on the GPAIN0 pin, the A/D data (SARDATA::ADCDAT) should be
  ((1.5V / 8) / 1V) * 1024 = 192 (= 0x0C0)
Am I right?

In fact, when I apply 1.5V on GPAIN0, the A/D data reads approximately 880 (= 0x370).

I don't know how to calculate the battery voltage from the SAR A/D value, and in addition, I'm in a frightful hurry.

Any advice will be greatly appreciated.
Thank you!

  • Kaizu-San,

    Configuration looks to be fine. The voltage divider divides the value from channel 1 by a factor of 8, this is based on the resistor value of 280Kohms and 40 Kohms.

     Was calibration done ?  What was the offset value found ?  

     As mentioned in the TRM following procedure to be followed -  “Calibrate the  measurement  by sampling the voltage at SAR Channel 0 (setting CHAN to Channel 0).  Channel 0 should be tied to ground with GNDON set to 1. “

     Though I suspect the offset cannot be so large, but it’s good to find out the offset value and calibrate accordingly.

     Also, was there any other voltage applied to GPAIN 0 and what was the SAR readings.

    Please let us know your findings with the above mentioned data.

     

    Regards

     Vasanth

     

  • Vathansa,

    Thank you for your answer.

    The offset value is about 34 (= 0x22).

    When I apply 1.05V on GPAIN0, the A/D data reads 700 (= 0x2BC).
    The SAR reading reaches full-scale (= 1023 = 0x3FF) when I apply 1.75V.

  • I've found an error on my board.

    The GPAIN1-3 pins had been pulled up to 3.3V, which exceeds the absolute maximum rated voltage of 1.7V.

    I removed the pull-up resistors and confirmed the correct operation of SAR.

    Thank you for your help.

    With best regards,
    Yasuhiro Kaizu