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.

am335x tps65217 read AIN

Other Parts Discussed in Thread: AM3352

Hi,

I want check the battery charge status.

MUX_OUT  is connected to the AIN4.

It was calculated charge status as follows:

  # cat /sys/bus/iio/devices/iio\:device0/in_voltage4_raw
  3108

  # cat /sys/bus/iio/devices/iio\:device0/scan_elements/in_voltage4_type
  le:u12/16>>0

  Vin = 3108 * 1.8 / (2^12 - 1)

        = 1.36

  charge = 1.36 * 100 / 1.8

              = 75%

Is it correct?

Battery is fully charged.
So it is normal that come to 100%.

My environment :

am3352

tps65217

linux-3.14.26-g2489c02

  • Ahn,

    Let's confirm a few things first:
    Did you change the register 0x9h bits <2:0> to 001 to monitor the battery voltage, by default the MUX is disabled , and the output is HiZ?

    VBAT and VSYS are divided down by a factor of 1:3 to be compatible with input voltage range of the ADC that resides on the system host
    side. Did you divide down by 1:3?

    Janice
  • Hi,

    register 0x09 bits <2:0> is 001

    How to setting the divide factor?

     
    Here is my i2c setting & schematic:
    # i2cdump -f -y -r 0x00-0x1e 0 0x24 b
               0    1     2    3     4    5     6    7     8    9     a    b    c    d     e    f
    00:  e2  3f   00  08  b1  80  b2  01  00  01  08  00  7f   0c  18  02
    10:  09  06  09  38  26  3f   7f   00  03  15  5f   32  40  20  00