Using RTC with LPC1788 under uClinux Print


This application note explains how to use the RTC device with LPC1788 under uClinux.

Hardware Platform

The hardware platform is Embedded Artists' LPC1788-DEV-KIT board.

The demo documented in this application note assumes that the RTC battery is inslalled on your board.

Installing the Demo

The procedure described here explains how to install the bootable Linux image (rtctest.uImage) to the target.

Here is how you can build and install the bootable Linux image from the project sources (rtctest.tgz), having installed them on top of the Emcraft Systems LPC1788 uClinux distribution.

Note: The Linux image and the sample project have been built and validated in context of the Emcraft Systems Release 1.10.0. If you are using a different release, some porting changes may be needed.

Setting the Hardware Clock (RTC)

  1. Set the system time:
  2. ~ # date -s "2012-08-07 12:34:56"

  3. Set the hardware clock to the current system time:
  4. ~ # hwclock -w

  5. Power the board off and wait for some time. Then power it on again and verify that the date is correct:
  6. ~ # date
    Tue Aug 7 12:35:05 UTC 2012