English
Language : 

AN939 Datasheet, PDF (7/18 Pages) Microchip Technology – Designing Energy Meters with the PIC16F873A
FIGURE 4:
ENERGY METER FIRMWARE (MAIN PROGRAM LOOP AND
CALIBRATION ROUTINE)
AN939
Main Loop
B
N
Is kWh flag true?
Y
Increment kWh
Counter and Store
in EEPROM
Display Next
Parameter on LCD
N Has display
counter
elapsed?
Y
N
Has
demand timer
elapsed?
Y
Compute Maximum
Demand and Store
in Data EEPROM
Calibration routine
A
Initialize USART
Send Calibration
Request to GUI
Receive Calibration
Data from GUI
Store Calibration
in Data EEPROM
All data
N
received?
Y
Disable USART
RETURN
© 2005 Microchip Technology Inc.
DS00939A-page 7