Real Time Clock & Calendar Module RTC DS1302 w/ Battery Backup
- Was RM10.00
-
RM5.00
- Product Code: DS1302
- Availability: In Stock
DS1302 real time clock module
A real-time clock / calendar and 31 bytes of static RAM, via a simple serial interface to communicate with the microcontroller. Real-time clock / calendar circuit provides seconds, minutes, hours, days, weeks, months, years of information, the number of days per month and new year automatically adjusted the number of days. Clock operation by AM / PM indicator decided to use 24 or 12-hour format.
DS1302 between the microcontroller can simply adopt the way synchronous serial communication port only used three lines:
DS1302 Features:
Real-time clock with energy calculations before 2100 seconds, minutes, hours, day, week, month, year capacity, as well as the ability to leap year adjustment
serial I / O ports such a way that a minimum number of pins. Order to work to maintain low power consumption less than 1mW.
Specification:
Note:
1. VCC and GND not to reverse or it will burn the chip
2. C51 MCU P0 port requires pull-up resistor, if your device does not have a pull-up resistor can be connected to other ports data lines
For most applications this code is very long and not very easy to understand, so the staff Virtuabotix adapted this code and created a library called virtuabotixRTC ( click here to download the library). It is very easy to work the DS1302 along with other Arduino functions.
#include <virtuabotixRTC.h> // // Creation of the Real Time Clock Object //SCLK -> 6, I/O -> 7, CE -> 8 virtuabotixRTC myRTC(6, 7, 8); void setup() { Serial.begin(9600); // Set the current date, and time in the following format: // seconds, minutes, hours, day of the week, day of the month, month, year myRTC.setDS1302Time(00, 59, 23, 6, 10, 1, 2014); } void loop() { // This allows for the update of variables for time or accessing the individual elements. myRTC.updateTime(); // Start printing elements as individuals Serial.print("Current Date / Time: "); Serial.print(myRTC.dayofmonth); Serial.print("/"); Serial.print(myRTC.month); Serial.print("/"); Serial.print(myRTC.year); Serial.print(" "); Serial.print(myRTC.hours); Serial.print(":"); Serial.print(myRTC.minutes); Serial.print(":"); Serial.println(myRTC.seconds); // Delay so the program doesn't print non-stop delay( 5000); }
This Real Time Clock (RTC) Module could be used for a plethora of projects. The RTC can be interfaced to the micro controllers in order to control timed events. This is especially helpful when timing is critical to the project.
Tags: RTC