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

X  

ADE7166 数据表(PDF) 119 Page - Analog Devices

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

ADE7166 数据表(HTML) 119 Page - Analog Devices

Back Button ADE7166 Datasheet HTML 115Page - Analog Devices ADE7166 Datasheet HTML 116Page - Analog Devices ADE7166 Datasheet HTML 117Page - Analog Devices ADE7166 Datasheet HTML 118Page - Analog Devices ADE7166 Datasheet HTML 119Page - Analog Devices ADE7166 Datasheet HTML 120Page - Analog Devices ADE7166 Datasheet HTML 121Page - Analog Devices ADE7166 Datasheet HTML 122Page - Analog Devices ADE7166 Datasheet HTML 123Page - Analog Devices Next Button
Zoom Inzoom in Zoom Outzoom out
 119 / 144 page
background image
ADE7566/ADE7569/ADE7166/ADE7169
Rev. A | Page 119 of 144
READ AND WRITE OPERATIONS
Writing to the RTC Registers
The RTC circuitry runs off a 32.768 kHz clock. The timekeeping
registers, Hundredths of a Second Counter SFR (HTHSEC, 0xA2),
Seconds Counter SFR (SEC, 0xA3), Minutes Counter SFR (MIN,
0xA4), and Hours Counter SFR (HOUR, 0xA5), are updated
with a 32.768 kHz clock. However, the RTC Configuration SFR
(TIMECON, 0xA1) and Alarm Interval SFR (INTVAL, 0xA6)
are updated with a 128 Hz clock. It takes up to two 128 Hz clock
cycles from when the MCU writes to the TIMECON SFR or
INTVAL SFR until there is a successful update in the RTC.
To protect the RTC timekeeping registers from runaway code, a
key must be written to the Key SFR (KYREG, 0xC1), which is
described in Table 116, to obtain write access to the HTHSEC,
SEC, MIN and HOUR SFRs. KYREG should be set to 0xEA to
unlock the timekeeping registers and reset to 0 after a timekeeping
register is written to. The RTC registers can be written to using
the following 8052 assembly code:
MOV
RTCKey,#0EAh
CALL
UpdateRTC
UpdateRTC:
MOV
KYREG,RTCKey
MOV
SEC,#30
MOV
KYREG,RTCKey
MOV
MIN,#05
MOV
KYREG,RTCKey
MOV
HOUR,#04
MOV
KYREG,#00h
RET
Reading the RTC Counter SFRs
The RTC cannot be stopped to read the current time because
stopping the RTC introduces 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
R0,HTHSEC
; using Bank 0
MOV
R1,SEC
MOV
R2,MIN
MOV
R3,HOUR
MOV
A,HTHSEC
CJNE A, 00h, ReadAgain ; 00h is R0 in
Bank 0
RTC MODES
The RTC can be configured in a 24-hour mode or a 256-hour
mode. A midnight event is generated when the RTC hour
counter rolls over from 23 to 0 or 255 to 0, depending on
whether the TFH bit is set in the RTC Configuration SFR
(TIMECON, 0xA1). The midnight event sets the MIDNIGHT
flag in the TIMECON SFR, and a pending RTC interrupt is
created. The RTC midnight event wakes the 8052 MCU core if
the MCU is asleep in PSM2 when the midnight event occurs.
In the 24-hour mode, the midnight event is generated once a
day at midnight. The 24-hour mode is useful for updating a
software calendar to keep track of the current day. The 256-hour
mode results in power savings during extended operation in
PSM2 because the MCU core wakes up less frequently.
RTC INTERRUPTS
The RTC midnight interrupt and alarm interrupt are enabled by
setting the ETI bit in the Interrupt Enable and Priority 2 SFR
(IEIP2, 0xA9). When a midnight or alarm event occurs, a
pending RTC interrupt is generated. If the RTC interrupt is
enabled, the program vectors to the RTC interrupt address and
the pending interrupt is cleared. If the RTC interrupt is
disabled, the RTC interrupt remains pending until the RTC
interrupt is enabled. The program then vectors to the RTC
interrupt address.
The MIDNIGHT flag and ALARM flag are set when the
midnight event and alarm event occur, respectively. The user
should manage these flags to keep track of which event caused
an RTC interrupt by servicing the event and clearing the
appropriate flag in the RTC interrupt servicing routine.
Note that if the ADE7566/ADE7569/ADE7166/ADE7169 are
awakened by an RTC event, either by the MIDNIGHT event or
ALARM event, the pending RTC interrupt must be serviced
before the device can go back to sleep again. The ADE7566/
ADE7569/ADE7166/ADE7169 keep waking up until this
interrupt has been serviced.
Interval Timer Alarm
The RTC can be used as an interval timer. When the interval
timer is enabled by setting the ITEN bit in the RTC Configuration
SFR (TIMECON, 0xA1), the interval timer clock source selected
by the ITS1 and ITS0 bits is passed through an 8-bit counter.
This counter increments on every interval timer clock pulse
until it is equal to the value in the Alarm Interval SFR (INTVAL,
0xA6). Then, an alarm event is generated, setting the ALARM
flag and creating a pending RTC interrupt. If the SIT bit in the
RTC Configuration SFR (TIMECON, 0xA1) is cleared, the 8-bit
counter is also cleared and starts counting again. If the SIT bit is
set, the 8-bit counter is held in reset after the alarm occurs.



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