Author Topic: DS1307 updateing with Time Server  (Read 8355 times)

Offline robo

  • Newbie
  • *
  • Posts: 40
    • View Profile
DS1307 updateing with Time Server
« on: September 24, 2008, 03:36:07 PM »
Hi all,

I would like to update date and time in DS1307 RTC with Time Server once a day. Does anybody know how to do this??

Regards,
robo

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: DS1307 updateing with Time Server
« Reply #1 on: September 24, 2008, 08:53:39 PM »
Hi Robo

As you probably know, TIME SERVER is supported in the demo project by enabling USE_TIME_SERVER in config.h. This will fetch the time once after reset of the board.

The DS1307 RTC is supported as demo when I2C is enabled (IIC_INTERFACE in config.h) and the demo TEST_DS1307 in application.c. This will configure the DS1307 on start up (if not yet running) and read the present time and data. It programs an interrupt input which can be connected to the 1Hz output from the DS1307 (see the interrupt routine call back seconds_interrupt() in application.c).

If you would like to get the present time and data once a day you can use the interrupt to start the process when there is a roll-over of the 24 hour count (or at other time). Then you can use the routine fnSaveTime() to save to the RTC.

Regards

Mark