![ST UM2898 User Manual Download Page 12](http://html1.mh-extra.com/html/st/um2898/um2898_user-manual_1355734012.webp)
6.4
State machine
Figure 13.
STSW-EMETER1-FW state machine
INIT State
RUN State
Check for Neutral Missing
TAMPER State
SHUTDOWN State
Wake-Up using RTC
Capture Full wave,
Calculate Energy
and update EEPROM
Store Tampering Details
NO
YES
•
INIT State
:
–
initializes MCU and peripherals
•
Check for Neutral Missing
:
–
checks neutral missing occurs
–
if yes, it initializes MCU at lower frequency
–
if proper voltage is built at V
DD
, it reads and stores in the EEPROM
•
RUN State
:
–
refreshes metering data reading by reading
–
updates LCD
–
updates EEPROM
•
Tamper State
:
–
if any tamper is detected, stores the details in the EEPROM with the related time
•
Capture State in case of Neutral missing
:
–
captures one full wave and calculates energy
–
stores the value in the EEPROM
•
SHUTDOWN State
:
–
in case of Neutral Missing, shuts
and MCU down for some time (2 seconds in this case)
–
periodically wakes up using RTC
•
Wake up using RTC State
:
–
periodically wakes up using RTC
UM2898
State machine
UM2898
-
Rev 1
page 12/31