Interpreting Real-Time Clock Register-Interpreting Real-Ti

Abstract: This applicaTIon note describes the format used for Maxim Real-TIme Clock (RTC) TIme and date registers.

Maxim RTCs (real-TIme clocks) provide both current clock and calendar information to the end user. Many of these RTCs have a time / date alarm function that can be programmed for periodic timed alarms or for a specific one-time calendar alarm. This application note is intended to ease the implementation of Maxim RTCs through detailed discussions and examples of how to properly configure and use the clock, calendar, and alarm functions. Discussions of Timekeeping or Alarm Register contents will reference decimal equivalents of time / date data contained within , unless otherwise specified. RTC Clock and Calendar Functions Maxim RTCs provide both clock and calendar functions. Illogical settings will not produce predictable results. The RTC algorithms for clock and calendar counter functions are based on valid data being entered into the respective registers. The old engineering saying of "garbage in, garbage out" holds true here. From both cost and size perspectives, there are no extensive che cks and balances for the data entered into any of the Timekeeping Registers used to generate clock and calendar data. It is left to the user's discretion to enter only valid clock and calendar information into the RTC Timekeeping Registers.

Table 1. Typical RTC Timekeeping Registers
Register Address / Command Register Definition
FUNCTION
A7 A6 A5 A4 A3 A2 A1 A0 VALUE D7 D6 D5 D4 D3 D2 D1 D0
CLOCK
SEC 1 0 0 0 0 0 0 RD 00-59 0 10SEC 1SEC
/ W * POR STATE 0 0 0 0 0 0 0 0
MIN 1 0 0 0 0 0 1 RD 00-59 0 10MIN 1MIN
/ W * POR STATE 0 0 0 0 0 0 0 0
HR 1 0 0 0 0 1 0 RD 01-12 12/24 0 10R 10HR 1HR
/ W 00-23 1/0 A / P 0/1
* POR STATE 0 0 0 0 0 0 0 0
DATE 1 0 0 0 0 1 1 RD 01-28 / 29
01-30
01-31
0 0 10 DATE 1 DATE
/ W * POR STATE 0 0 0 0 0 0 0 1
MONTH 1 0 0 0 1 0 0 RD 01-12 0 0 0 10 M 1 MONTH
/ W * POR STATE 0 0 0 0 0 0 0 1
DAY 1 0 0 0 1 0 1 RD 01-07 0 0 0 0 0 WEEKDAY
/ W * POR STATE 0 0 0 0 0 0 0 1
YEAR 1 0 0 0 1 1 0 RD 00-99 10 YEAR 1 YEAR
/ W * POR STATE 0 1 1 1 0 0 0 0
CONTROL 1 0 0 0 1 1 1 RD WP 0 0 0 0 0 0 0
/ W * POR STATE 0 0 0 0 0 0 0 0
TRICKLE
CHARGER
1 0 0 1 0 0 0 RD TCS TCS TCS TCS DS DS RS RS
/ W * POR STATE 0 0 0 0 0 0 0 0
CENTURY 1 0 0 1 0 0 1 RD 0-99 1000 YEAR 100 YEAR
/ W * POR STATE 0 0 0 1 1 0 0 1
ALARM
CONFIG
1 0 0 1 0 1 0 RD 0 YEAR DAY MONTH DATE HR MIN SEC
/ W * POR STATE 0 0 0 0 0 0 0 0
TEST
CONFIG
1 0 0 1 0 1 1 RD 0 0 0 0 0 1 1 1
/ W * POR STATE 0 0 0 0 0 1 1 1

Note: * POR STATE defines the Power-On Reset state of register content.

Seconds RegisterThe Timekeeping Seconds Register contains the current time count from the seconds counter. The seconds-counter output ranges from 00 to 59 seconds and carries over to 00 on the next 1-second count following a previous count of 59. Seconds data is contained in D6 through D0, and BCD format applies to those data bits. D7 is used in some RTCs for a status or control bit. In those RTCs, reads to and writes from the Seconds Register must mask D7 and interpret only D6 through D0 as seconds data , as shown below.

Table 2. Timekeeping Seconds Register
Seconds Register D7 D6 D5 D4 D3 D2 D1 D0
0 10SEC (BCD 0-5) (Decimal 0-5) 1SEC (BCD 0-9) (Decimal 0-9)
Min Binary Count 0 0 0 0 0 0 0 0
Max Binary Count 0 1 0 1 1 0 0 1
POR STATE 0 0 0 0 0 0 0 0

Note: Valid seconds data = 00 to 59

The Minutes RegisterThe Timekeeping Minutes Register contains the current time count from the minutes counter. The minutes-counter output ranges from 00 to 59 minutes and carries over to 00 on the next 1-minute count following a previous count of 59. Minutes data is contained in D6 through D0, and BCD format applies to those data bits. D7 is used in some RTCs for a status or control bit. In those RTCs, reads to and writes from the Minutes Register must mask D7 and interpret only D6 through D0 as minutes data , as shown below.

Table 3. Timekeeping Minutes Register
Minutes Register D7 D6 D5 D4 D3 D2 D1 D0
0 10MIN (BCD 0-5) (Decimal 0-5) 1MIN (BCD 0-9) (Decimal 0-9)
Min Binary Count 0 0 0 0 0 0 0 0
Max Binary Count 0 1 0 1 1 0 0 1
POR STATE 0 0 0 0 0 0 0 0

Note: Valid minutes data = 00 to 59

Hours RegisterThe Timekeeping Hours Register contains the current time count from the hours counter. There are two operating modes for the Hours Register: 12-hour format and 24-hour format. The interpretation of D5 depends on the hour format selected in D7.

Table 4. Timekeeping Hours Register
Hours Register D7 D6 D5 D4 D3 D2 D1 D0
12/24 0 10HR 10HR 1HR
1/0 A / P 0/1
POR STATE 0 0 0 0 0 0 0 0

D7, the 12/24 format bit set to a 0, configures the hours counter for 24-hour format. D5 is used as the upper bit in the 10-hour BCD format. Hours data in the 24-hour format is contained in D5 through D0, and BCD format applies to those data bits. In this mode, the hours-counter output ranges from 00 to 23 hours and carries over to 00 on the next 1-hour count following a previous count of 23.

Table 5. Timekeeping Hours Resister: 24-Hour Format
Hours Register (24HR Format) D7 D6 D5 D4 D3 D2 D1 D0
0 (24HR) 0 10HR (BCD 0-2) (Decimal 0-2) 1HR (BCD 0-3) (Decimal 0-3)
Min Binary Count 0 0 0 0 0 0 0 0
Max Binary Count 0 0 1 0 0 0 1 1

Note: Valid hour data (24-hour format) = 00 to 23

D7, the 12/24 format bit set to a 1, configures the hours counter for 12-hour format. D5 is used as the AM / PM indicator with 1 = PM and 0 = AM. Hours data in the 12-hour AM format or in the 12-hour PM format is contained in D4 through D0, and BCD format applies to those data bits. In this mode, the hours-counter output ranges from 01 to 12 hours and carries over to 01 on the next 1-hour count following a previous count of 12. In addition, the AM / PM bit changes on the hour increment from 11 PM (D5 = 0) to 12 AM (D5 = 1) and from 11 AM (D5 = 1) to 12 PM ( D5 = 0).

Table 6. Timekeeping Hours Register: 12-Hour AM Format
Hours Register (12HR AM Format) D7 D6 D5 D4 D3 D2 D1 D0
1 (12HR) 0 0 (AM) 10HR (BCD 0-1) (Decimal 0-1) 1HR (BCD 1-2) (Decimal 1-2)
Min Binary Count 1 0 0 0 0 0 0 1
Max Binary Count 1 0 0 1 0 0 1 0

Note: Valid hour data (12-hour format) = 01 to 12

Table 7. Timekeeping Hours Register: 12-Hour PM Format
Hours Register (12HR PM Format) D7 D6 D5 D4 D3 D2 D1 D0
1 (12HR) 0 1 (PM) 10HR (BCD 0-1) (Decimal 0-1) 1HR (BCD 1-2) (Decimal 1-2)
Min Binary Count 1 0 0 0 0 0 0 1
Max Binary Count 1 0 0 1 0 0 1 0

Note: Valid hour data (12-hour format) = 01 to 12

Date RegisterThe Timekeeping Date Register contains the current calendar day of the month from the date counter. The counter-output range is dependent on the current value of the Month Register, Year Register, and Century Register. The date-counter range is 01 to 28 , 01 to 29, 01 to 30, or 01 to 31. At maximum count, the date counter carries back to 01 on the next day increment computed from the Hours Register. Date data is contained in D5 through D0, and BCD format applies to those data bits. If D6 and D7 are always 0, which is the case for most Maxim RTCs, then BCD format applies for the entire Date Register.

Table 8. Timekeeping Date Register
Date Register D7 D6 D5 D4 D3 D2 D1 D0
0 0 10 DATE (BCD 0-3) (Decimal 0-3) 1 DATE (BCD 1-9) (Decimal 1-9)
Min Binary Count 0 0 0 0 0 0 0 1
Max Binary Count 0 0 1 1 0 0 0 1
POR STATE 0 0 0 0 0 0 0 1

Note: Valid date data = 01 to 31, 01 to 30, 01 to 29, 01 to 28

Table 9. Counting Range of Date Counter
Range Carry Month Register
(BCD)
Year and Century
Register
01 to 31 01 (January)
03 (March)
05 (May)
07 (July)
08 (August)
10 (October)
12 (December)
N / A
01 to 30 04 (April)
06 (June)
09 (September)
11 (November)
N / A
01 to 29 02 (February) Divide by 4 with no remainder
01 to 28 02 (February) Divide by 4 with remainder

Month RegisterThe Timekeeping Month Register contains the current time count from the month counter. The month-counter output ranges from 01 to 12 months and carries over to 01 on the next 1-month count following a previous count of 12. Month data is contained in D4 through D0, and BCD format applies to those data bits. If D7, D6, and D5 are always 0, which is the case for most Maxim RTCs, then BCD format applies for the entire Date Register.

Table 10. Timekeeping Month Register
Month Register D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 10 M (BCD 0-1)
(Decimal 0-1)
1 MONTH (BCD 0-9) (Decimal 0-9)
Min Binary Count 0 0 0 0 0 0 0 1
Max Binary Count 0 0 0 1 0 0 1 0
POR STATE 0 0 0 0 0 0 0 1

Note: Valid month data = 01 to 12

Table 11. Month Register (BCD)
Month Register
(BCD)
Month
01 January
02 February
03 March
04 April
05 May
06 June
07 July
08 August
09 September
10 October
11 November
12 December

Day RegisterThe Timekeeping Day Register (day of the week) contains the current weekday count from the day counter. The day-counter output ranges from 01 to 07 days and carries over to 01 on the next 1-day count following a previous count of 07 . Weekday data is contained in D4 through D0, and BCD format applies to those data bits. If D7 through D3 are always 0, which is the case for most Maxim RTCs, then BCD format applies for the entire Day Register.

Table 12. Timekeeping Day Register
Day Register D7 D6 D5 D4 D3 D2 D1 D0
0 0 0 0 0 WEEKDAY (BCD 1-7) (Decimal 1-7)
Min Binary Count 0 0 0 0 0 0 0 1
Max Binary Count 0 0 0 0 0 1 1 1
POR STATE 0 0 0 0 0 0 0 1

Note: Valid day data = 01 to 07

Year RegisterThe Timekeeping Year Register contains the current units and 10's count for the year counter. The year-counter output ranges from 00 to 99 and carries over to 00 on the next 1-year count following a previous count of 99. The current year units 'count is contained in D3 through D0 in BCD format. The current year 10's count is contained in D7 through D4 in BCD format.

Table 13. Timekeeping Year Register
Year Register D7 D6 D5 D4 D3 D2 D1 D0
10 YEAR (BCD 0-9) (Decimal) 1 YEAR (BCD 0-9) (Decimal 0-9)
Min Binary Count 0 0 0 0 0 0 0 0
Max Binary Count 1 0 0 1 1 0 0 1
POR STATE 0 1 1 1 0 0 0 0

Note: Valid year data = 00 to 99

Century RegisterThe Timekeeping Century Register contains the current thousand's and hundred's count for the century counter. The century-counter output ranges from 00 to 99 and carries over to 00 on the next 1-century count following a previous count of 99. The current year thousand's count is contained in D7 through D4 in BCD format. The current year hundred's count is contained in D3 through D0 in BCD format.

Table 14. Timekeeping Century Register
Century Register D7 D6 D5 D4 D3 D2 D1 D0
1000 YEAR 100 YEAR
Min Binary Count 0 0 0 0 0 0 0 0
Max Binary Count 1 0 0 1 1 0 0 1
POR STATE 0 0 0 1 1 0 0 1

Note: Valid century data = 00 to 99

Time / Date ExampleTable 15. Register Contents for March 26, 2001; Monday; 11:24:36 PM (23:24:36 hours)
Hex Data BCD
Data
Decimal Timekeeping
Contents
Register /
Binary Data
D7 D6 D5 D4 D3 D2 D1 D0
Seconds Seconds Seconds Seconds 0 10SEC 1SEC
36h 36 36 Binary 0 0 1 1 0 1 1 0
Minutes Minutes Minutes Minutes 0 10MIN 1MIN
24h twenty four twenty four Binary 0 0 1 0 0 1 0 0
Hour (24HR Format) Hour (24HR Format) Hour (24HR Format) Hour (24HR Format) 12/24 (0/1) 0 10
HR
10
HR
1HR
A3h A3 twenty three Binary 1 0 1 0 0 0 1 1
Hour (12HR Format) Hour (12HR Format) Hour (12HR Format) Hour (12HR Format) 12/24 (0/1) 0 A / P (0/1) 10
HR
1HR
31h 31 11 PM Binary 0 0 1 1 0 0 0 1
Date Date Date Date 0 0 10 DATE 1 DATE
26h 26 26 Binary 0 0 1 0 0 1 1 0
Month Month Month Month 0 0 0 10 M 1 MONTH
03h 03 3 (March) Binary 0 0 0 0 0 0 1 1
Day Day Day Day 0 0 0 0 0 WEEKDAY
02h 02 2 (Monday) Binary 0 0 0 0 0 0 1 0
Year Year Year Year 10 YEAR 1 YEAR
01h 01 01 Binary 0 0 0 0 0 0 0 1
Century Century Century Century 1000 YEAR 100 YEAR
20h 20 20 Binary 0 0 1 0 0 0 0 0
RTC Alarm FunctionFor Maxim RTCs that provide an alarm function, there are a variety of possible configurations for the alarm settings. Illogical settings will not produce predictable results. From both cost and size perspectives, there are no extensive checks and balances for the data entered into the Alarm Configuration or Alarm Threshold Registers. It is left to the user's discretion to enter only valid clock and calendar information into the RTC Alarm Registers.

The RTC Alarm Configuration Register contains the bits for programming when a date / time alarm occurs.

Table 16. Alarm Configuration Register
Register Address / Command Register Definition
FUNCTION A7 A6 A5 A4 A3 A2 A1 A0 VALUE D7 D6 D5 D4 D3 D2 D1 D0
CLOCK
ALARM CONFIG 1 0 0 1 0 1 0 RD 0 YEAR DAY MONTH DATE HR MIN SEC
/ W * POR STATE 0 0 0 0 0 0 0 0

Note: * POR STATE defines the Power-On Reset state of register content.

A logic 0 in any bit does not enable a comparison of the respective Alarm Threshold Register with the associated timekeeping-counter output for that respective time unit. A logic 1 enables the comparison. Each bit set to a logic 1 in the Alarm Configuration Register must have conditions satisfied for the alarm to occur. For example, if D0, seconds bit, is set to 1 and D1, minutes bit, is set to 1, then the alarm will occur every time the timekeeping counter matches both the count stored in the Seconds Threshold Register and the count stored in the Minutes Threshold Register.

When the Alarm Threshold Registers, which have been selected by the Alarm Configuration Register, match their respective timekeeping-counter outputs, the alarm will trigger with a typical 3mS delay. Once the alarm is triggered, it can be cleared by writing or reading to any Alarm Threshold Register or by reading or writing to the Alarm Configuration Register.

Because the alarm-trigger function is an edge-triggered logic, the alarm only occurs once each time the respective counter reaches the count that matches the respective Alarm Threshold Register setting. For example, set the Alarm Configuration Register to only minutes by setting D1 to logic 1 and all other data bits to zero. Now, in the Alarm Threshold Minutes Register, set its LSB to 1 and all other bits to zero. This configures the RTC alarm logic to trigger every time the minutes counter transitions from 00 to 01. The first transition of the minutes counter from 00 to 01 sets the alarm. If the alarm is now cleared by reading or writing to the Alarm Configuration Register or any of the Alarm Threshold Registers, it will not be reset again until the next edge transition of the minutes counter from 00 to 01, regardless of whether or not the output of the minutes counter is still at 01.

Typical RTC Alarm Threshold Registers are shown below. The Alarm Threshold Registers (Year, Day, Month, Date, Hours, Minutes, Seconds) have the same data configuration as their respective Timekeeping Register counterparts, described in detail earlier.

Table 17. Typical RTC Alarm Registers
Register / Address Command Register Definition
FUNCTION A7 A6 A5 A4 A3 A2 A1 A0 VALUE D7 D6 D5 D4 D3 D2 D1 D0
ALARM THRESHOLDS
SEC 1 0 0 1 1 0 0 RD 00-59 0 10SEC 1SEC
/ W * POR STATE 0 1 1 1 1 1 1 1
MIN 1 0 0 1 1 0 1 RD 00-59 0 10MIN 1MIN
/ W * POR STATE 0 1 1 1 1 1 1 1
HR 1 0 0 1 1 1 0 RD 01-12 12/24 0 10
HR
10
HR
1HR
/ W 00-23 1/0 A / P 0/1
* POR STATE 1 0 1 1 1 1 1 1
DATE 1 0 0 1 1 1 1 RD 01-28 / 29
01-30
01-31
0 0 10 DATE 1 DATE
/ W * POR STATE 0 0 1 1 1 1 1 1
MONTH 1 0 1 0 0 0 0 RD 01-12 0 0 0 10 M 1 MONTH
/ W * POR STATE 0 0 0 1 1 1 1 1
DAY 1 0 1 0 0 0 1 RD 01-07 0 0 0 0 0 WEEKDAY
/ W * POR STATE 0 0 0 0 0 1 1 1
YEAR 1 0 1 0 0 1 0 RD 00-99 10 YEAR 1 YEAR
/ W * POR STATE 1 1 1 1 1 1 1 1
CLOCK BU / RST 1 0 1 1 1 1 1 RD
/ W
RAM (VBATT Backed Up)
RAM 0
1 1 0 0 0 0 0 RD RAM DATA 0 x x x x x x x x
/ W
RAM 30 1 1 1 1 1 1 0 RD RAM DATA 30 x x x x x x x x
/ W
RAM BU / RST 1 1 1 1 1 1 1 RD
/ W

Note: * POR STATE defines the Power-On Reset state of register contents.

There are 128 possible alarm settings using the Alarm Configuration Register. Not all of these possible combinations are logical or cause the desired effect for triggering the alarm (for example, setting an alarm to trigger every April 31). A few common examples are presented in detail below as guidance in correctly configuring the Alarm Configuration Register and the Alarm Threshold Registers.

Table 18. Summary of Common Examples
Alarm Configuration Register
Example D7 D6 Year D5 Day D4 Month D3 Date D2 Hours D1 Minutes D0 Seconds Alarm Occurrence (when threshold-register contents match respective timekeeping-counter output)
1 0 0 0 0 0 0 0 1 Once every Seconds match (eg, once a minute @ 30 seconds count)
2 0 0 0 0 0 0 1 0 Once every Minutes match (eg, once an hour @ 45 minutes count)
3 0 0 0 0 0 1 0 0 Once every Hours * match (eg, once a day-every 24 hours @ 11 PM)
4 0 0 0 0 0 1 1 1 Once every Hours *, Minutes, and Seconds match (eg, once a day-every 24 hours @ specific time of day)
5 0 0 0 0 1 0 0 0 Once every Date match (eg, once a month)
6 0 0 1 0 0 0 0 0 Once every Day match (eg, once a week-every Monday)
7 0 0 0 1 0 0 0 0 Once every Month match (eg, once / year-every March 1 @ 12 AM)
8 0 0 0 1 1 1 1 1 Once every Time, Date, and Month (Month, Date, Hours *, Minutes, Seconds) match (eg, once a year-specific month, date, time of day *)
9 0 1 0 1 1 1 1 1 Once every Time, Date, Month, and Year match (eg, one-time alarm set-specific month, date, year, time of day *)

Note: * The Alarm Threshold Register must use the same hour format (12-hour or 24-hour) as the Timekeeping Register, otherwise the alarm function will not operate properly.

Alarm Example 1: Triggering the Alarm Once Every Minute @ 30-Seconds Count

Once every Seconds match. Only the Alarm Threshold Seconds Register is set, and all other Alarm Threshold Registers (Year, Day, Month, Date, Hours, Minutes) have their internal bits set to logic 0.

Set the alarm to trigger once every minute at the 30-seconds count.

Table 19. Register Contents for the Alarm Trigger Every Minute @ 30-Seconds Count
Hex Data BCD Data Decimal Timekeeping Contents Register / Binary Data D7 D6 D5 D4 D3 D2 D1 D0
Seconds Seconds Seconds Seconds 0 10SEC 1SEC
30h 30 30 Binary 0 0 1 1 0 0 0 0

Alarm Example 2: Triggering the Alarm Once Every Hour @ 45-Minutes Count

Once every Minutes match. Only the Alarm Threshold Minutes Register is set, and all other Alarm Threshold Registers (Year, Day,

Industrial Plug And Socket

Industrial plugs, sockets and couplers are mainly divided into four categories: plugs, sockets, connectors and appliance input sockets, which are generally collectively referred to as industrial plugs. Its main features are as follows:

1. Safe and reliable

â‘ This kind of product uses the color of the shell to indicate the rated voltage, such as: 40V-45V is purple, 110V-130V is yellow, 200V-250V is blue, 230V-415V is red, and 500V is black. It is easy to distinguish, and you can't get it wrong.

â‘¡Different specifications have different diameters, pole numbers, and grounding contact positions. Only the same specifications can be plugged in to prevent misplugging.

â‘¢There is protection against electric shock. The grounding pole insert sleeve in the socket is longer than the phase pole and neutral pole insert sleeve, so as to ensure that the grounding pole is connected before the phase pole is connected when the plug is inserted, and the grounding pole is finally separated when the plug is pulled out. It is very safe to use.

â‘£Holding devices are provided to clamp the plugs and sockets to prevent them from falling off after being inserted, which improves the reliability.

⑤High protection level. There are IP44 splash-proof type, IP67 anti-immersion type and so on. Not only the human body cannot touch the live parts, but it can also be used under different environmental conditions to ensure safety.

â‘¥An elastic band is added to the insert sleeve. Ensure close contact, good conductivity and long service life after the plug is inserted.

⑦There is a cable clamping device, which can clamp the cable sheath, so that it will not be pulled off, and it is safe to use.



2. Durable

â‘ Good mechanical properties. The product shell is made of high-quality engineering plastic, which has high strength, impact resistance and is not afraid of falling. The rubber and plastic used have anti-aging properties and can be used not only indoors but also outdoors, and are durable.

②Heat resistance and flame resistance. The shell and internal insulating parts have heat resistance, the temperature can reach (100±5)℃, and the important parts can withstand (125±5)℃; and it is flame retardant.

â‘¢More resistant to plug and use. For example, for a product with a rated current of 16A, the number of normal plug-in operation cycles is more than 5000 times.

â‘£The temperature rise test of conductive contact parts shall not exceed 50K, which is suitable for long-term use.

3. Strong versatility

The products adopt the standards of GB/T 11918~11919-2001, which are equivalent to IEC 60309-1 and 2 standards, and are fully in line with international standards. Therefore, such products can be used both domestically and internationally. At the same time, it has a wide variety of specifications, which can meet various occasions and uses.

These characteristics of industrial plugs and sockets give it high safety, reliability and international versatility. Therefore, it has gradually received attention in the country. Through continuous promotion and application, industrial plugs and sockets have gradually entered various industries, such as electricity, ports, machinery industries and large-scale buildings. With the development of science and technology, industrial plugs and sockets are constantly innovating. Various quick installation technologies have been gradually applied to plugs and sockets, making it more convenient to use.

IP44 Plug,IP67 Plug,IP67 Socket,IP44 Socket

Ningbo Bond Industrial Electric Co., Ltd. , https://www.bondelectro.com

Posted on