Questions tagged [rtc]

Questions regarding Real Time Clocks (RTCs) which can be a timekeeper IC used by microcontrollers, or using a microcontroller as an accurate timekeeper. Some have calendar, alarm, interrupt or heartbeat features, while some simply keep track of time since last programmed (Epoch timers are similar).

RTCs can be external to the microcontroller, or integrated on the same die. RTCs typically run off a 32.768kHz tuning fork crystal and are low-power, typically less than 1\$\mu\$A. On the microcontroller integrated RTCs have their own power supply, independent of the rest of the microcontroller.

RTCs have a set of date/time registers which are kept by the crystal oscillator and are readable by the microcontroller, most often via a serial interface when in a separate IC. Other features are heartbeat interrupts and alarm interrupts at settable times. RTC IC often have a small amount of battery backup RAM.

Further reading
Real-time clocks/calendars plus literature list at NXP

263 questions
41
votes
7 answers

What happens if I omit the pullup resistors on I2C lines?

Just now I realized that the I2C data and clock lines (SDA and SCL) must have pullup resistors. Well, I've built a couple of clocks using the DS1307 RTC (see datasheet) according to the schematic below. Notice that I have omitted both pullup…
Ricardo
  • 6,134
  • 19
  • 52
  • 85
18
votes
3 answers

Is case grounding compulsory in typical 32.768kHz crystal for Real Time Clock?

Pictures shown below is a typical 32.768kHz crystal, commonly use in Real Time Clock circuit (e.g: DS1307 & DS1337) Referring to an earlier question posted here, it is a good practice that ground planes should be beneath the crystal. But is it…
Dennis
  • 1,401
  • 3
  • 17
  • 17
15
votes
6 answers

Why do real-time clock chips use BCD

I have seen dozens of different real-time clock chips on the market, as well as a number of processors with a built-in separately-powered real-time clock module. Nearly all of them not only store time as year-month-day-hours-minutes-seconds, but…
supercat
  • 45,939
  • 2
  • 84
  • 143
13
votes
4 answers

supercap-powered RTC?

I'm designing a ATmega-based microcontroller test board. One of the features I want to include is a Real Time Clock with a Maxim DS1307 IC. Instead of including a traditional coin cell battery backup, however, I want to use a really small…
mr_schlomo
  • 513
  • 3
  • 8
  • 15
12
votes
1 answer

How long will a DS1307 RTC run on a CR2032 coin cell battery?

I have a homemade clock based on an atmega328 and a DS1307 Real Time Clock. When off, the DS1307 is powered by a 3V CR2032 coin cell, as usual. If I leave the clock off most of the time, how long should I expect the coin cell to last? I'm aware of…
Ricardo
  • 6,134
  • 19
  • 52
  • 85
11
votes
7 answers

Is a Real-Time Clock (RTC) necessary for real-time systems?

Assuming that we are working on a real-time Linux system and hardware which consists of high resolution timers, does having an RTC affect the real-timeliness of the system? Here it says that it reduces CPU and memory usage, but is there a way to…
www
  • 281
  • 2
  • 9
11
votes
4 answers

How often should I query a RTC?

I've not yet used a RTC so I'm not completely sure of the "normal" way to read a real time clock. There's a few different approaches I've thought of but was hoping for some advice on it. Here are the ways I've thought of reading and using the time…
user9993
  • 575
  • 2
  • 6
  • 15
10
votes
3 answers

How do you Calibrate 32.768kHz crystal for PIC24 RTCC

I'm trying to figure out the best method for PIC24 RTCC crystal calibration. Their application note states two methods: using a lookup table and using a reference system clock. According to them the reference system clock method is best, but they…
TiOLUWA
  • 783
  • 1
  • 9
  • 23
10
votes
3 answers

Using the ST-LINK Utility to configure the RTC to current time

What I was doing I am using a STM32 microcontroller and for my project I need to be able to send data at specific times of the day (say, at 11am and 2pm). The microcontroller needs to know what time it is before I can achieve this. Unfortunately, I…
jvpernis
  • 313
  • 1
  • 10
9
votes
1 answer

Is there any real time clock (RTC) which provides time resolution in microseconds?

I've been searching for high precision RTCs on Google but almost all RTCs like DS12C887, DS1307 provide time resolution in seconds which is ok for general use. Are there any RTC ICs which can provide finer resolution like in milliseconds and…
Osaid
  • 569
  • 6
  • 17
8
votes
4 answers

How to calculate day of the week for RTC?

I am using MCP7940 RTC from microchip it requires to enter the day of the week as part of updating RTC with date. So how should I calculate day of the week based on the date provided by the user?
Jimit
  • 423
  • 5
  • 14
7
votes
4 answers

DS1307 power failure problem

The DS1307 has two power sources: the main VCC source and the backup battery. The latter will power the DS1307 when the main power goes down so the clock can keep ticking. I am facing a problem with the RTC DS1307 when the main power suddenly goes…
alone
  • 217
  • 1
  • 3
  • 11
6
votes
1 answer

Sanity check: Using the DS3231 as a clock source for uC

The DS3231 is an RTC chip with an onboard temperature compensated oscillator and 32kHz output. I want to use this chip in a small clock project I'm designing because I've got a couple lying around. Since it's got the the 32kHz output, I want to use…
BB ON
  • 2,296
  • 20
  • 26
6
votes
4 answers

I'd like to request a review/bashing of this circuit for a high precision soil moisture sensing and analysis device. Where did I go wrong?

Below you will find a buffet of questions and the schematic for my device. (Click on it and you will get the full-size image.) Please tear this up. I'm a self-taught novice putting together a high-precision device. Can you help me validate the…
Tim Cerka
  • 109
  • 7
6
votes
2 answers

Symbol identification (J?)

I am looking into a part from a application guide titled How to Calculate UNIX ® Time Using a PIC18 Microcontroller and the MCP795W20 SPI RTCC. And there is a part that I'm not sure what it's suppose to represent. I have no idea what exactly J1 and…
HFOrangefish
  • 839
  • 3
  • 14
1
2 3
17 18