RTC design, half 1: Actual-time clocks nonetheless matter in automation, IoT purposes

by admin

Actual-time clocks (RTCs) had been by no means eye-catching elements in programs. Certainly, many engineers don’t perceive why an RTC is required. They may assume it’s a quite simple gadget that simply retains monitor of the time; plus, most microcontrollers these days have a built-in RTC peripheral.

So, why would system engineers spend extra cash and waste extra PCB house for an RTC?  Why haven’t standalone RTCs grow to be out of date? This text will spotlight the significance of an RTC in several purposes, and description essential RTC specs and associated design challenges.

Again within the previous days, earlier than the Web turned pervasive, a highly-accurate RTC was important for numerous purposes resembling private computer systems, digital watches, camcorders, and autos. An RTC retains monitor of the time even when the primary energy provide is turned off. With out an RTC, the consumer would want to set the time and date each time the gadget is turned on.

Right now’s digital gadgets have entry to the Web or GPS. As soon as the gadget has linked, it could possibly very simply purchase the correct time. For these gadgets which have the luxurious of fixed Web connection, a highly-accurate RTC could have actually grow to be pointless, however this profit comes on the expense of excessive energy consumption.

Why RTC now

Over the previous decade, as all forms of automation purposes—for instance, house, agricultural, and industrial—have taken off, billions of gadgets are actually Web-enabled. On a regular basis objects like safety cameras, lights, leisure programs, and home equipment can now connect with the Web; these gadgets are a part of the Web of issues (IoT) bandwagon. Nevertheless, whereas battery-powered IoT gadgets are driving a considerable quantity of IoT market development, gadgets which are consistently linked to an influence supply are more likely to preserve a continuing Web connection as nicely.

So, is that this the top of the RTC? Probably not; increasingly more RTCs are literally utilized in many automation and IoT purposes. Many distant IoT sensors, like climate stations, are largely battery operated and take measurements or full a set of duties on preset schedules. These gadgets can’t afford to constantly allow the wi-fi transceiver as a result of that can drain the battery in a short time.

Certainly, engineers put a number of thought into methods to lengthen the battery life. More often than not, these battery-operated gadgets are operating in a deep-sleep mode—even their microcontrollers—to reduce energy consumption when there isn’t a job to carry out. These purposes profit from a particularly low-power RTC to wake the system up occasionally to work on assigned duties.

Whereas microcontrollers often have a built-in RTC, the timekeeping present is often within the microamps. The standalone RTC, however, consumes simply nanoamps of present whereas working. One standalone gadget in the marketplace, for instance, consumes solely 150 nA in timekeeping mode, and supplies two alarm settings and two interrupt pins that can be utilized to get up the system.

Don’t belittle the distinction between a number of micro amps and 150 nA. When designing IoT purposes for lengthy battery life, each micro ampere of present counts. Moreover IoT purposes, many medical gadgets additionally require nano-power RTCs; wearable ECG gadgets, listening to aids, and medical child tags are some examples.

Most battery-operated gadgets are very small by design for portability or simple set up. For the reason that standalone RTC is exterior to the microcontroller, an RTC with a smaller package deal is most popular. Higher but, engineers can choose an RTC with an built-in resonator if the board house is restricted. At the moment, the smallest RTC with built-in resonator within the business is out there in a 2.1×2.Three mm, 8-pin WLP package deal.

Moreover low energy and small package deal dimension, some purposes additionally require excessive timekeeping accuracy over a large temperature vary. For instance, this is a crucial consideration for a sensor that’s put in within the subject, the place the temperature can fluctuate lots by the day. For these purposes, a extra preferable alternative is an RTC with temperature-compensation functionality, which can be mentioned partly 2 of this text collection.

RTC with exterior crystal resonator

A value-efficient RTC often requires an exterior resonator, and essentially the most generally used resonator for an RTC is a 32.768 kHz tuning fork quartz crystal. Why 32.768 kHz? First, 32768 is an influence of two. When this sign connects to a 15-stage flip-flop, the output is a exact 1 Hz sign. The RTC makes use of this 1 Hz sign to drive the timekeeping logic. However why 32.768 kHz as an alternative of 131.072 kHz or 1.024 kHz? To reply this query, we have to perceive the trade-off between frequency and energy consumption. Typically, present consumption will increase as crystal frequency will get increased. Therefore, for a low-power RTC, the crystal frequency can’t be too excessive, nor too low. The dimensions of the crystal is inversely proportional to the frequency.

This implies the decrease frequency crystal is bodily bigger and takes up extra board house. So, 32.768 kHz is chosen as one of the best compromise between energy and dimension. Moreover, an individual’s audible vary is from 20 Hz to 20 kHz. Folks can really hear the crystal vibration if the frequency is decrease than 20 kHz. And 32.768 kHz is the primary energy of two quantity that’s past the audible vary.

Quartz crystals are calibrated within the manufacturing unit to oscillate on the focused frequency by including a small quantity of gold to the information of the tuning fork to finely modify the vibration pace. The ensuing clock accuracy is often inside ±20 ppm at room temperature with specified capacitor load. The unit ppm is an abbreviation for elements per million, and is the unit sometimes used for clock accuracy measurement.

A ±20 ppm-accurate RTC on this case might be off by as much as 10.5 minutes per 12 months, assuming the ambient temperature is a 25°C fixed all year long. The calculation is just:

If temperature fluctuates, the gathered error could enhance. If the customer is keen to pay additional, the provider can present a higher-accuracy crystal by a display screen course of. Nevertheless, irrespective of how correct these crystals are at room temperature, the frequency can nonetheless be affected by the next three components:

  • temperature fluctuation
  • frequency-pulling with load capacitors
  • growing old

Temperature fluctuation

Tuning fork crystal frequency is a operate of temperature and might be approximated by a second-order equation:

equation to approximate tuning fork crystal frequency

The place:

f0 is the nominal frequency (32.768 kHz)

T0 is the turnover temperature (25°C)

okay is a parabolic coefficient for the tuning fork crystal (0.04 ppm/°C2 typical)

T is the ambient temperature

As proven within the frequency error versus temperature plot (Determine 1), frequency turns into slower as temperature deviates away from room temperature (25°C).

frequency error versus temperature plotDetermine 1 This graph exhibits how frequency turns into slower after temperature deviates away from room temperature. Supply: Maxim Integrated

To ensure optimum accuracy efficiency, ambient temperature have to be regulated at round 25°C. Many indoor battery-powered gadgets could use this RTC with an exterior crystal resolution, and that gives the price financial savings and low-power advantages.

Frequency pulling

A crystal’s frequency might be affected by its load capacitors. A Pierce oscillator is essentially the most generally used crystal oscillator circuit inside an RTC (Determine 2). It sometimes consists of a crystal, an inverter, and cargo capacitors.

diagram of an oscillator circuit incorporated inside the RTC

Determine 2 An oscillator circuit is included contained in the RTC. Supply: Maxim Built-in

An equal circuit comprising the crystal and the load capacitors is introduced in Determine 3.

two diagram of the equivalent circuitDetermine 3 The equal circuit is predicated on crystal and cargo capacitors. Supply: Maxim Built-in

Within the circuit proven in Determine 3, the RCL collection circuit resonates in parallel with C0 and CL. The oscillation frequency method is as follows:

oscillation frequency equation

The place:

R1, C1, and L1 are motional parameters of the crystal

C0 is the capacitance between the terminals of the crystal

FL is the oscillation frequency with whole efficient capacitance

CT is the general efficient capacitance, C1 in collection with (CL+C0)

overall effective capacitance equation

FS is the collection resonance frequency of the crystal

series resonance frequency equation

As C0+CL is far higher than C1, the FL method might be approximated by

equation to approximate oscillation frequency

The by-product of FL with respect to CL represents the frequency modifications in Hz with respect to the modifications of the load capacitance. Divide it by the collection frequency to calculate the change ratio of the frequency per unit capacitance. This method exhibits the frequency sensitivity with varied loading capacitor worth, CL:

frequency sensitivity equation

This method is an effective approximation solely when CL is near the desired load capacitance worth. If the load capacitor deviates from the desired worth an excessive amount of, the oscillator could fail to function utterly as a result of the crystal and capacitors can’t produce 180 levels section shift again into the enter of the inverter.

To cut back the price and board house occupancy, many RTCs have built-in load capacitors which are manufacturing unit trimmed. They need to match very nicely with the crystal’s specified load capacitance. The frequency error needs to be very small at room temperature if the format is nicely designed. The PCB traces from the crystal to the pad of the RTC can contribute extra stray capacitance to the CL. In a single RTC in the marketplace, the load capacitors are trimmed to yield the optimum clock accuracy based mostly on the analysis package PCB format. In different phrases, the stray capacitance within the analysis package has been included as a part of CL.

Growing older

Growing older refers back to the change of the resonance frequency of a crystal over time. Growing older is brought on by the change of mass of the crystal over time due to the contamination contained in the crystal package deal. Usually, a crystal’s frequency modifications a number of ppm per 12 months, with many of the modifications occurring within the first two years.

Exposing the crystal in a high-temperature surroundings can pace up the growing old price. Sadly, there’s little or no engineers can do concerning the growing old impact moreover calibrating the crystal occasionally. Some RTCs present an growing old offset register for the consumer to manually modify the clock frequency.

Editor’s Be aware: Half 2 of this collection will present an in depth therapy of RTC’s temperature compensation capabilities.

Gordon Lee is principal member of the technical workers, Functions, Core Merchandise Group at Maxim Built-in.

Associated articles:

Related Posts

Leave a Comment