All Forums
 Embedded Linux
 Linux FAQ
 How to set the RTC (Real Time Clock)
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

rwhaley

628 Posts

Posted - 23 Aug 2002 :  16:47:25  Show Profile  Email Poster
How do I set the RTC on my board?

Some boards (including the Bitsy+ and the the later revs of the Graphics Client+) have a battery backed Real Time Clock. These clocks will keep accurate time even when the board is powered off (if battery power is provided to the board continuously).

When it boots the board will read the time from the RTC and load the time into Linux. Linux uses the timer interrupt to keep time while it is running.

To update the time and then save it into the RTC use the standard Linux commands date and hwclock like this:

date 091310152002
hwclock --systohc

The first command will set the time to 10:15AM 9/13/2002. The second command will copy the time into the RTC.

To view the time in the RTC just enter the command:

hwclock

To copy the time from the RTC to the Linux clock use the command:

hwclock --hctosys
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000