Difference between revisions of "RTC"

From ArmadeusWiki
Jump to: navigation, search
(Configuration)
(Usage)
Line 31: Line 31:
  
 
* From U-Boot there is a command '''date''' to read, reset, update the RTC.
 
* From U-Boot there is a command '''date''' to read, reset, update the RTC.
  $ help date
+
  $ '''help date''' for more information
for more information
+
$ '''date reset''' to be done after battery exchange to remove message '''### Warning: RTC oscillator has stopped'''
* From linux use the commande '''hwclock''' to read, write, synchronize the RTC.
+
$ '''date 013122302007''' to set the date January 31th 2007 22h30.
  $ date --help  
+
 
for more information
+
* From linux use the commande '''hwclock''' to read, write, synchronize the RTC and '''date''' to read and update system date and time.
 +
  $ '''hwclock --help'''
 +
$ '''hwclock -r''' to read hardware clock and print result
 +
$ '''hwclock -s''' to set the system time from the hardware RTC clock
 +
$ '''hwclock -w''' to set the hardware RTC clock to the current system time
 +
 
 +
$ '''date --help''' for more information
 +
$ '''date -R''' to read hardware clock and print result
 +
$ '''date 013122302007''' to sets the system date january 31th 2007 22h30.
  
 
== Links ==
 
== Links ==
 
* maxim-ic ds1374 datasheete
 
* maxim-ic ds1374 datasheete
 
*
 
*

Revision as of 20:14, 28 January 2007

On this page, you will find usefull informations to use an external DS1374 Real Time Clock. This feature apply to the armadeus software release 2.0 and above.

Hardware

No permanent RTC is present on the APF9328 but it is not so complex to add a DS1374 (with quartz integrated) on the I2C bus. Do not forget to provide the power-supply.

Configuration

First be sure to use an armadeus 2.0 or higher. The RTC/DS1374 support is already present in U-BOOT and linux kernel 2.6.18.1 and higher. Therefore you have nothing to configure to use the RTC. Nevertheless these are the parameters to check to have the RTC supported:

$ make linux-menuconfig
  • check the i2c module drivers "I2C support", "I2C DEVICE", "I2C HARDWARE/bus on imx"
  • check the RTC module driver "RTC class", "set time from RTC" "RTC interface dev"
  • if you integrates these module statically in the kernel then the system date will be set at power-up.
$ make

and reload your kernel and/or rootfs

Installation

if you choose to compile rtc and i2c drivers as module then you have load them:

$ modprobe i2c-imx
$ modprobe rtc-ds1374
$ modprobe rtc-dev

Usage

  • From U-Boot there is a command date to read, reset, update the RTC.
$ help date for more information
$ date reset to be done after battery exchange to remove message ### Warning: RTC oscillator has stopped
$ date 013122302007 to set the date January 31th 2007 22h30.
  • From linux use the commande hwclock to read, write, synchronize the RTC and date to read and update system date and time.
$ hwclock --help
$ hwclock -r to read hardware clock and print result
$ hwclock -s to set the system time from the hardware RTC clock
$ hwclock -w to set the hardware RTC clock to the current system time
$ date --help for more information
$ date -R to read hardware clock and print result
$ date 013122302007 to sets the system date january 31th 2007 22h30.

Links

  • maxim-ic ds1374 datasheete