Why You Should Follow These Best Practices In Real Time Clocks Design

Created: August 21, 2017
Updated: December 31, 2020
Why You Should Follow These Best Practices In Real Time Clock Design

Have you ever been late for school because your alarm clock decided to stop at 3.15 AM? In high school, my alarm clock wasn’t very pleasant sounding, but the sound of my mom shouting at me was worse. I knew that my clock had stopped because its battery was dead. However, had I paid closer attention, I would have noticed that my clock ran slower as the battery drained off. That way I could have changed it in time and avoided rising to my mom’s shrill voice. Nowadays we have our electronic devices where the time is tracked via a ntp server! There are even apps that begin tracking your sleep schedules and wake you up when it's best for your sleep cycle.

Now that I’m all grown up, I’m more focused on Real-Time Clocks (RTC) and electronic circuit design, instead of school day alarm clocks. RTCs are usually integrated circuits (IC) that keep track of the current time against a set standard. Real-time clocks PCB are also generally designed to continue running after the main system is powered down and consumes minimal power. If your system’s RTC fails, the consequences are higher than a harsh scolding from your mom. Let’s look at why they are important, what best practices for real-time clocks can keep you out of detention, and the advantages of real-time clock PCB.

Why Real-Time Clocks are important in embedded systems

Hand using keycard to open digital lock
Your HR Will Hate It When The Time Got Messed Up

Almost any data-driven and time-sensitive embedded system clock features a time clock. They rely on the accuracy of the date and time to perform specific actions. For example, a door security system may activate different access priorities based on the time configured. A fault in the RTC can result in doors that refuse to open when activated at the right time zone.

Besides that, real-time clocks are critical in embedded systems that record events and alarms that are intended to be a reliable audit trail. For example, an attendance management system where HR departments track the employees on their reported date and time, or a fire alarm system that needs to keep a record of alarm events.

Failing to implement good practices in RTC electronic circuit design can be expensive, especially if the controllers have been deployed in the field. In one of my previous job, a batch of standalone payment controllers for a parking system developed a problem with their clock software. It gradually ran slower than the actual time. This led to angry customers who had received the wrong parking rates.

Real-Time Clocks Design Mistakes You Should Avoid

Designing real-time clock PCB circuitry may seem like a simple task since it usually involves 5 components. You’ll have a dedicated RTC chip or a built-in RTC on a microcontroller, a crystal, a couple of capacitors, and a coin cell battery. I’ve made it a best practice for all employees to follow these design guidelines:

1. Keep the crystal as close as possible to the RTC and keep the trace as short as you can. It will reduce the possibility of noise coupling.

2. Do not route any other trace in between or under the trace between RTC and the crystal. This will prevent unwanted interference from being coupled to the clocking signal.

3. Do not route any high-speed signals within the vicinity of real-time clocks circuitry. It is recommended to keep a distance of 200 mils in between.

4. Place a ground plane beneath and surrounding the RTC circuitry and keep it isolated from other ground planes for at least 40 mils.

5. Make sure that you are using the correct value for the crystal load capacitors as specified in the datasheet for the crystal.

Why Some RTC Design Mistakes Escape Lab Testing

Making mistakes in RTC design can result in symptoms like the time ticking slower or faster than the actual time. In some cases, the symptoms are very obvious in the design stage and can be immediately fixed in the prototype. But sometimes these problems escape lab testing and only show up in the live application.

This was the case with the payment controllers. While they functioned well in our lab, when we were woken up by the shouts of angry customers, we did some troubleshooting on the devices. In our lab, we have close to an ideal electrical environment, and at sites, it is to have a noisy power network. This can be electrical noises coupled with other equipment or improper grounding on the building itself. Once our controllers were deployed, this noise was channeled through a lesser grade power supply, through a voltage trace on the Printed Boards that runs between the traces connecting the crystal to the RTC, and into the RTC clocking signal. This signal is typically a square wave that oscillates at 32.768 kHz, and a disruption to it will skew the accuracy of the RTC, which is exactly what we saw.

PCB being repaired
You wouldn’t want to go through manual rework for hundreds of PCBs.

What Can You Do If You Have Post-Deployment Real-Time clocks Problems

Unfortunately, there are no elegant quick fixes when you have messed up your real-time clock design, and the products are already deployed on the field. In some cases, you can design a small RTC module and manually rewire the controller to the new working module.

In situations where your devices are tightly fitted into enclosures or are mass-produced consumer products. These reworks are impossible to perform. In this case, you will have to produce a new batch of replacement units that have functional real-time clocks.

Systems with RTC designs and layouts don't have to be complicated when you use the world-class PCB design and layout features in Altium Designer®. Users can enjoy the advantages of real-time clock, a single integrated design platform with circuit design and PCB layout features for creating manufacturable circuit boards. When you’ve finished your design, and you want to release files to your manufacturer, the Altium 365 platform makes it easy to collaborate and share your projects.

We have only scratched the surface of what’s possible with Altium Designer on Altium 365. Start your free trial of Altium Designer + Altium 365 today.

Check out Altium Designer® in action...

Powerful PCB Design

Related Resources

Related Technical Documentation

Back to Home
Thank you, you are now subscribed to updates.