Power supply and battery status on the portenta H7

How can we know the portenta h7 power supply and battery status?
I can't find any documentation about how to read battery voltage and eventually check if the type c cable is connected.
I'm using a Portenta H7 with the 3.7 battery (and a 18650 battery) as described in the tutorial.

A very good but potentially "complicated" question:
As I think: the battery is connected via this PMIC chip (Power Management Integrated Circuit). It is an external power supply chip.
It is connected via I2C to MCU: so, MCU can control the power system on board, including to enable the battery charger, to check the voltage of the battery etc.

Maybe, there are some mbed, Portenta H7 LIB functions which use the I2C in order to check the status of the battery. But no idea how they are called (and what needed to make use of it).

When I check the schematics: the battery connections (on J4) go just to this PMIC chip (U10). So. you had to do via PMIC chip register reads.

Using the breakout board: there is also a "LICELL": it is this coin battery. It is connected directly to the high density connectors at the bottom of the MCU module. But at the end: it goes also to the PMIC chip.

There is nothing directly, e.g. an analog pin input on MCU, where you could read the battery voltage. You had to use the PMIC chip to do so. But if there are functions for I2C PMIC chip - no idea.

1 Like

There is one file I could find (via grepWin) in Arduino install LIB path:
"STM32H747_System.cpp"
It has the PMIC I2C slave address and two functions to readReg and writeReg registers in PMIC via I2C.
But you would need the PMIC datasheet to understand which registers give you information about the external battery connected (e.g. charging state).

Instead of wasting my time to "browse" the entire Portenta H7 files, a GIT repository - (for me) the fastest way is: enable/setup I2C (it should be done already) for the board/system I2C. Try to read registers in PMIC chip and find there to get the battery state, the charger info.
But you had to read and understand the PMIC chip as well as a bit the board schematics.

Portenta H7 can be "painful" when it comes to using all its features.

1 Like

Thank You for Your Support, l'll try to manage this in the next days

is there any update for battery status in arduino H7?

For battery status, I think, you have two options:
a) you can initialize ADC and read (internal) channel to get battery voltage (just the right channel and do the "calibration")
b) or you go to the PMIC chip (via I2C) and maybe (! not sure) - you will find status info in this chip telling you anything about the battery (e.g. if is is charging, which voltage threshold to start charging battery...)

The easiest way is to figure out how to read battery voltage via ADC (and internal channel).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.