Skip to main content
ckim.2390
Associate II
March 27, 2023
Question

STPM32 example, about energy factor in metrology library

  • March 27, 2023
  • 0 replies
  • 798 views

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.

0693W00000aJk62QAC.png 

The LSB_E formula from the datasheet is shown below.

0693W00000aJk6HQAS.png 

How does 0x4000000 (2^26) come out in define FACTOR_POWER_ON_ENERGY?

    This topic has been closed for replies.