2023-03-26 11:03 PM
hello.
If you look at lines 343~352 of the metrology.c file in the document STSW-STPM002 of STPM32, it is written that you do not need to calculate the "energy factor" if you have calculated the "power factor".
And define FACTOR_POWER_ON_ENERGY to 858.
The annotated formula is
(3600 * 16000000 / 0x4000000) = 858.3... .
//0x4000000 == 2^26
At line 227 of the metroTask.c file
Set the energy factor with Metro_Set_Hardware_Factors(,,power factor/858,,).
In other words, I think that LSB_E is the formula below.
The LSB_E formula from the datasheet is shown below.
How does 0x4000000 (2^26) come out in define FACTOR_POWER_ON_ENERGY?