Recording Power Cycling Inform

Abstract: This applicaTIon note describes how to use the DS1602 or DS1603 Elapsed TIme Counters to record power cycling informaTIon.

Pin Assignment
DescripTIonThe DS1602 and DS1603 from Dallas Semiconductor offer a simplified hardware solution for keeping time as well as tracking powered up time of a system. The DS1602 and DS1603 can be read and written directly by a microprocessor or microcontroller using simple software; however, a more creative software algorithm can be used to track years, months, days, day of week, time of day, etc. In addition, power-up time and number of power-up cycles can also be tracked using the DS1602 / DS1603 with appropriate software.

The continuous counter and power-on counter in the DS1602 / DS1603 are 32-bit counters which count in seconds and can be read and written through the DS1602 / DS1603 3-wire serial interface. For the most basic implementation:

The continuous counter will be set once and left to increment until it reaches its maximum value; The powered up counter will be initially cleared once, and left to increment until it reaches its maximum value. With these two assumptions, each counter has the ability to count up to a maximum value of (232 -1) seconds, or 4.29 x 109 seconds (about 136 years).

For a system that needs 100+ years of continuous timekeeping ability, the entire 32-bit counters may be required; but for users where the maximum continuous counter time required could be about 5 years, the unused counter bits space can be put to better use as memory bits for storing power-up cycling information.

As seen in Figure 1, DS1602 / DS1603 can be partitioned to provide a continuous time counter and a power-up time counter with the capability to count up to 4.75 years, leaving the remaining higher bits of the counter available as a read / write nonvolatile memory.

The software implementation requires the use of three registers, so a third register must be mapped into the available two as in Figure 1.

An example of how the counters may be used to accomplish this task follows.

Figure 1. Mapping three registers onto two.
Figure 1. Mapping three registers onto two.

Continuous Counter MapBits 1-24: Remain as continuous time base measurement, up to 16.7 x 106 seconds or 0.53 years.

Bit 25: Buffer or overflow bit; for when the continuous time counter reaches its maximum value and has not been read and reset by the processor. This bit also serves to separate the counter part of the register from the part which will be used as memory bits.

Bits 26-28: Number of years continuous time has been running x 0.53.

Bits 29-32: Number of power cycles x 128. These four bits serve as a register which is incremented once for each full count reached in bits 26-32 of the power-up counter.

Powered Up Counter MapBits 1-24: Remain as nonvolatile seconds measurement of powered up seconds, storing up to 16.7 x 106 seconds, or 0.53 years.

Bit 25: Buffer or overflow bit; for when the power-up counter reaches its maximum value and has not been read and reset by the processor. This bit also serves to separate the counter part of the register from the part which will be used as memory bits.

Bits 26-32: The high 7 bits of the power-up counter are the 1-127 count storage area for the number of power-up cycles the DS1602 or DS1603 has seen.

With this discipline and the proper software algorithms in place, power-on time and continuous time are maintained by the DS1602 / DS1603's self-contained counters while the number of power-up cycles and years of elapsed time x 0.53 is maintained in the higher order bits of the counters which are used as memory.

This implementation requires that a microcontroller must be prepared to read / write the DS1602 or DS1603 at least once every year.

For Continuous Time TrackingWhen the lower 24 bits of the continuous counter have exceeded 0.53 years and set bit 25 to 1, the controller must read the continuous counter, determine the status of bit 25, and if 1, clear the bit and increment the value in bits 26-28 by one half-year. If bit 25 is not set, the lower 24 bits of the register have yet to reach 0.53 years and can continue counting.

Once the value in bits 26-28 has reached 111, or 7 x 0.53 years, the continuous time counter can continue to count up to 1.06 years in the lower 24 bits plus the overflow of 0.53 in bit 25 for a maximum value of 9 x 0.53 years.

Figure 2. For continuous time tracking.
Figure 2. For continuous time tracking.

For Power-up Time TrackingWhen the lower 24 bits of the power-up counter have exceeded 0.53 years and set bit 25 of the counter to 1, the controller must read the power-up counter, determine the status of bit 25, and if 1 , clear the bit and store the value in external memory so that the power-up counter can continue to count. The maximum power-up time that can be stored in this way is 2 x 0.53 years within the DS1602 / DS1603.

Figure 3. For power-up time tracking.
Figure 3. For power-up time tracking. For Number of Power-up Cycles Tracking Performing this function with the DS1603 or DS1602 is primarily a software task. When originally written with a start value or cleared, bits 25-32 of the power-up counter must be set to 0. Upon each power-up thereafter, the controller or processor connected to the DS1603 must read the power-up counter and examine the value stored in the high 7 bits. If the value is less than 1111111, then the controller must increment the value and write it back to the 7 higher order bits. If the value in the higher order bits is 1111111, the controller must set the value of 0000000, read the value in the high 4 bits of the continuous time counter, increment it by 1, and write the new value back to the high 4 bits. Using this software algorithm, the DS1603 or DS1602 can be used to record and store up to 2,047 power cycles.

Figure 4. For number of power-up cycles tracking.
Figure 4. For number of power-up cycles tracking.

The Advent of Dituo Bluetooth Music Aromatherapy Diffuser

    Bustling in the hustle and bustle of the city, busy with heavy work, people began to pursue ways to relieve stress, and Bluetooth Diffuser as a device to relieve stress, is gradually entering the people's field of vision. In recent years, the development of aromatherapy machines has shown a thriving trend, and Dituo intelligent Bluetooth Aroma Diffuser has been widely concerned and loved by consumers with its innovative design and rich functions.


    Why is Dituo's smart music aromatherapy diffuser supported by so many people?


    If you experience this Bluetooth Oil Diffuser, you will find that their success is not due to luck, but that they have created a product that combines practicality, design and technology, whether it is design, production or material selection. And the appearance, all reveal the creative attitude of the Shenzhen Dituo Electronic Co.,Ltd. and the thinking of the product. Dituo uses high-frequency vibration generated by ultrasonic vibration equipment to convert water into fine mist at a frequency of 2.4MHz. After being used with different essential oils, it is distributed in the surrounding air to make the air full of fragrance. When there are guests visiting at home, Or when there is an odor in the room, the fragrance emitted by Dituo can make the air instantly fragrant. The faint aroma not only makes you immerse yourself in the beautiful atmosphere of aromatherapy, but also refreshes your mind. Imagine that when you end your busy day and want to relax your body and mind, the fragrance that dituo brings will make you You feel relaxed and comfortable. 


    The pleasing music has a calming effect on modern people who are under stress all day. Aroma Diffuser can play music through the Bluetooth connection. When the music meets the aroma, and the romantic atmosphere created by the gradient breathing makes people feel like walking in the space of the cloud, the refreshing atmosphere adds a pleasant atmosphere. If you are accompanied by mild symptoms of insomnia, when you are doing aromatherapy in the bedroom, you can add the essential oil of lavender, and the fresh and elegant aroma can accompany you to dream.

Bluetooth Diffuser

Bluetooth Diffuser,Portable Diffuser,Bluetooth Oil Diffuser,Bluetooth Aroma Diffuser

Shenzhen Dituo Electronic Co.,Ltd. , https://www.sz-dituo.com