Whadda DS1302 User Manual

Whadda DS1302 User Manual

Real-time clock module

Advertisement

Quick Links

USER MANUAL
EN
DS1302 real-time clock module
WPI301
whadda.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DS1302 and is the answer not in the manual?

Questions and answers

Summary of Contents for Whadda DS1302

  • Page 1 USER MANUAL DS1302 real-time clock module WPI301 whadda.com...
  • Page 2: Safety Instructions

    If in doubt, contact your local waste disposal authorities. Thank you for choosing Whadda! Please read the manual thoroughly before bringing this device into service. If the device was damaged in transit, do not install or use it and contact your dealer.
  • Page 3: What Is Arduino

    Product Overview The DS1302 trickle-charge timekeeping chip contains a real-time clock/calendar and 31 bytes of static RAM. It communicates with a microprocessor via a simple serial interface. The real-time clock/calendar provides seconds, minutes, hours, day, date, month, and year information.
  • Page 4: Pin Layout

    Connection Arduino® WPI301 SCLK Pin Layout Input. The CE signal must be asserted high during a read or a write. This pin has an internal 40 kΩ (typ) pulldown resistor to ground. Note: Previous data sheet revisions referred to CE as RST. The functionality of the pin has not changed. Input/push-pull output.
  • Page 5 Before being able to use the sample program, an additional library needs to be installed. Go to Sketch > Include Library > Manage Libraries... Put "DS1302" in the search bar and install the RTC library by Makuna (should be the first result).
  • Page 6 Whadda WPI301 DS1302 Real-time clock module example This demo sets the time on the DS1302 RTC module to the compiled time of the sketch. After this is configured the time returned by the DS1302 module is periodically printed on the serial monitor Check whadda.com for more information including a wiring diagram for this demo.
  • Page 7 Rtc.SetIsWriteProtected(false); if (!Rtc.GetIsRunning()) Serial.println("RTC was not actively running, starting now"); Rtc.SetIsRunning(true); RtcDateTime now = Rtc.GetDateTime(); if (now < compiled) Serial.println("RTC is older than compile time! (Updating DateTime)"); Rtc.SetDateTime(compiled); else if (now > compiled) Serial.println("RTC is newer than compile time. (this is expected)"); else if (now == compiled) Serial.println("RTC is the same as compile time! (not expected but all is fine)");...
  • Page 8 snprintf_P(datestring, countof(datestring), PSTR("%02u/%02u/%04u %02u:%02u:%02u"), dt.Month(), dt.Day(), dt.Year(), dt.Hour(), dt.Minute(), dt.Second() ); Serial.print(datestring);...
  • Page 9 Modifications and typographical errors reserved - © Velleman Group nv. WPI301_v01 Velleman Group nv, Legen Heirweg 33 - 9890 Gavere...

This manual is also suitable for:

Wpi301

Table of Contents