ade7169f16 Analog Devices, Inc., ade7169f16 Datasheet - Page 115

no-image

ade7169f16

Manufacturer Part Number
ade7169f16
Description
Single-phase Energy Measurement Ic With 8052 Mcu, Rtc And Lcd Driver
Manufacturer
Analog Devices, Inc.
Datasheet
Preliminary Technical Data
(TIMECON, 0xA1) to ensure that the RTC is stopped before
writing the counter registers. Then the RTC should be started
again by setting the RTCEN bit. Note that it takes up to two 32
kHz clock periods to update the RTC counter SFRs. This can be
accomplished using the following 8052 assembly code where
the current time is held in R0 through R3.
SetupRTC:
Timeout:
MOV
; wait at least one 32 kHz clock period (30.5us)
MOV
MOV
CLR
SETB
JNZ
MOV
MOV
MOV
MOV
MOV
TIMECON,#040h
TCON, #03h
TL0,#00h
TF0
TR0
TF0, Timeout
HTHSEC, R0
SEC, R1
MIN, R2
HOUR, R3
TIMECON, #041h ; start the RTC
; waits 62.5us at 4.096MHz
; clear overflow flag
; start Timer0
; TL0 is an 8-bit timer
; stop the RTC
; using Bank 0
Rev. PrD | Page 115 of 140
ADE7169F16

Related parts for ade7169f16