anybody explain RTC for me?

Status
Not open for further replies.

hustyw

Newbie level 6
Joined
Jun 11, 2006
Messages
13
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,374
I'm a new comer here, don't understand what RTC for ?Thx a lot!
 


https://www.webopedia.com/TERM/R/real_time_clock.html

Regards,
IanP
 

So,RTC is a peripheral module which can keep track of time even when power off.
Am I right?
Thank you very much!
 

hustyw said:
So,RTC is a peripheral module which can keep track of time even when power off.
Am I right?

Correct, but only as long as the RTC itself still has power. This
is normally accomplished by using a small backup battery, such
as the kind you might find in a watch, or on a PC motherboard.

The DS1307, for instance, will keep time on a 3v cell and draw
as little as 500 nA in backup mode.
 

Real time clock can be software-based or simply a piece of dedicated hardware. For software, it is possible to use incremental clock tick of the mcu for time count. Say, we have a PIC running at 4Mhz external crystal, the machine cycle is 1us. 1usx1000=1ms; 1000x1ms = 1sec; 60sec=1 min and so on....Need a piece of software module for counting date, time, leap year etc. A good reference is "Complete and Ready to Use Embedded C Module" written by Jean J. Labrosse. Search in amazon will find this one. A very good book, my favorite. Or, search in CCS forum. I saw some source code there in CCS C.

There are mcus having dedicated RTC backup power pin (for backup batteries) like ARM (LPC2103...), or TI's mcu (MSP430 series) so the clock is preserved even on removal of mcu Vdd power.

Else, use a 32.786kHz crystal, connect it to RC0 and RC1 pins of a PIC mcu (say), and use Timer 1 for external clock input. 32.768khz is used because There are exactly 65536 oscillations required when we are using 32.768kHz external crystal, and 65536 is exactly a 16bit couting result. Therefore when Timer1 of 16bit overflows, it is 2 seconds.

Book on this: Embedded C Programming and the Microchip PIC written by Dr. Richard Barnett. Again, it is my favorite. I like reading!

Or, use dedicated hardware like Dallas DS1203, or PCF 8563. An article here with source code. Written by myself (if you don't mind it)

John
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…