Shop OBEX P1 Docs P2 Docs Learn Events
DS1302 queation on start up with no power — Parallax Forums

DS1302 queation on start up with no power

gregpgregp Posts: 3
edited 2010-06-27 02:54 in Accessories
When I power up my bs2 the time on the ds1302 is 01/01/00 00:00:80. How can I make code that if the basic stamp starts up with this time It set the time to a default date and time for the clock to start running.

Comments

  • Ron CzapalaRon Czapala Posts: 2,418
    edited 2010-06-26 22:54
    I use a DS1307 but do something similar - check the seconds value for 128 (hex 80)

    Main:
    GOSUB Get_Clock············· ' read DS1307
    IF secs = 128 THEN GOTO SetClock··· 'clock not set
  • gregpgregp Posts: 3
    edited 2010-06-27 02:54
    thank you, work's all the time.

    greg
Sign In or Register to comment.