数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

ADE5166 数据表(PDF) 112 Page - Analog Devices

部件名 ADE5166
功能描述  Single-Phase Energy Measurement IC with 8052 MCU, RTC, and LCD Driver
PDF  148 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  AD [Analog Devices]
网页  http://www.analog.com
标志 AD - Analog Devices

ADE5166 数据表(HTML) 112 Page - Analog Devices

Back Button ADE5166 Datasheet HTML 108Page - Analog Devices ADE5166 Datasheet HTML 109Page - Analog Devices ADE5166 Datasheet HTML 110Page - Analog Devices ADE5166 Datasheet HTML 111Page - Analog Devices ADE5166 Datasheet HTML 112Page - Analog Devices ADE5166 Datasheet HTML 113Page - Analog Devices ADE5166 Datasheet HTML 114Page - Analog Devices ADE5166 Datasheet HTML 115Page - Analog Devices ADE5166 Datasheet HTML 116Page - Analog Devices Next Button
Zoom Inzoom in Zoom Outzoom out
 112 / 148 page
background image
ADE5166/ADE5169/ADE5566/ADE5569
Preliminary Technical Data
Rev. PrB | Page 112 of 148
RTC—REAL-TIME CLOCK
The ADE5166/ADE5169/ADE5566/ADE5569 have an embed-
ded real-time clock (RTC); see Figure 81. The external 32.768
kHz crystal is used as the clock source for the RTC. Calibration
is provided to compensate the nominal crystal frequency and
for variations in the external crystal frequency over temperature.
By default, the RTC is active in all the power saving modes.
The RTC counters retain their values through watchdog resets
and external resets and are only reset during a power on reset.
The ADE5166/ADE5169/ADE5566/ADE5569 provide two
ways to access the RTC data: direct access through SFRs for
configuration and indirect access through address and data SFR
registers for the timekeeping registers and some other configura-
tion. The address and data registers act as pointers to the RTC
internal registers.
ACCESS TO RTC SFR
Access to the RTC SFRs is achieved by reading or writing to the
SFR addresses detailed in the Access to Internal RTC Registers
section. Writing to the indirect registers is protected by a key,
as explained in the following section, while reading is not
protected.
ACCESS TO INTERNAL RTC REGISTERS
Access to the internal RTC measurement registers is achieved
by writing to the RTC pointer address SFR (RTCPTR, 0xA3).
The RTCPTR register selects the RTC register to be accessed
and determines if a read or a write is performed (see Table 121).
Writing to Internal RTC registers
The RTC circuitry runs off a 32.768 kHz clock. The timekeeping
registers, HTHSEC, SEC, MIN, HOUR, DAY, DATE, MONTH,
and YEAR are updated with a 32.768 kHz clock. However, the
TIMECON, TIMECON2 and INTVAL registers are updated
with a 128Hz clock. It takes up to two 128 Hz clock cycles from
when the MCU writes the TIMECON, TIMECON2, or
INTVAL register until it is successfully updated in the RTC.
When Bit 7 of RTCPTR SFR is set, the content of the RTCDAT
SFR is transferred to the internal RTC register designated by the
address in the RTCPTR SFR. To protect the RTC timekeeping
registers from runaway code, a key must be written to the
KYREG register to obtain write access to any of the RTC
indirect registers. The KYREG should be set to 0xEA to unlock
the timekeeping registers and is reset to zero after a timekeeping
register is written. The RTC registers can be written using the
following 8052 assembly code:
MOV
RTCKey, #0EAh
CALL
UpdateRTC
UpdateRTC:
MOV
KYREG, RTCKey
MOV
RTCDAT, #30
MOV
RTCPTR, #82h
MOV
KYREG, RTCKey
MOV
RTCDAT, #05
MOV
RTCPTR, #83h
MOV
KYREG, RTCKey
MOV
RTCDAT, #04
MOV
RTCPTR, #84h
MOV
RTCKey, #00h
RET
Reading Internal Energy Measurement Registers
When Bit 7 of the RTCPTR SFR is cleared, the content of the
internal RTC data register designated by the address in
RTCPTR is transferred to the RTCDAT SFR. The RTC cannot
be stopped to read the current time because stopping the RTC
would introduce an error in its timekeeping. Therefore, the
RTC is read on-the-fly and the counter registers must be
checked for overflow. This can be accomplished through the
following 8052 assembly code:
ReadAgain:
MOV
RTCPTR #01
; Read HTHSEC using Bank
0
MOV
R0, RTCDAT
MOV
RTCPTR, #02
; Read SEC
MOV
R1, RTCDAT
MOV
RTCPTR, #03
; Read MIN
MOV
R2, RTCDAT
MOV
RTCPTR, #04
; Read HOUR
MOV
R3, RTCDAT
MOV
RTCPTR, #01
; Read HTHSEC
MOV
A, RTCDAT
CJNE
A, 00h, ReadAgain
; 00h is R0 in
Bank 0



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com