How to use evive’s Real-time Clock

About This Tutorial
This tutorial discusses what is a real-time clock, and how to use evive’s real-time clock to show time, date, and day with the help of an Arduino IDE sketch.
Tutorial Info

Components Required

ImageComponentQuantityAvailable in Kit
USB A-B Cable1


A real-time clock (RTC) is a clock IC that keeps track of current time and date. It is used in making of computer clocks, digital clocks, attendance systems etc. 

evive has an inbuilt RTC IC, PCF8563. The IC gets power from the internal battery of evive, so it can continue to update time while the external source of power is off or unavailable. 


The PCF8563 is a CMOS logic based Real-Time Clock and Calendar optimized for low power consumption. For the RTC available on evive we can set the starting date and time on it. The RTC IC is communicates with evive on I2C protocol(Two Wire Communication) .

It consists of a 32.768 kHz quartz crystal  that provides year, month, day, weekday, hours, minutes, and seconds. It also has a century flag, alarm and timer functions, integrated oscillator capacitor, and internal Power-On Reset.

Read/Write operations on RTC with evive

evive communicates with RTC via IIC-bus. Below is a list of few read write functions used for RTC  present in evive.h library:

initclock()Clears all the RTC registers.
setDate(day,weekDay,month,century,year);Used to set date on RTC. Numeric entries corresponding to day, weekDay,month,century,year are to be given.
setTime(h,m,s)Set the current hour,minutes,seconds for setting start time of RTC.
formatDate(byte style)This function returns date in mm/dd/yyyy or dd-mm-yyyy or yyyy-mm-dd format depending upon hex value of style variable written in it.
formatTime(byte style)Gives time in HH:MM or HH:MM:SS format depending on hex value of style variable written in it.
getWeekDay()returns a number depending upon which day of the week it is. For example this function will return 6 for Saturday.


Below is a sample Arduino IDE sketch demonstrating how to write and read time on RTC:

Share this Tutorial
Share on facebook
Share on twitter
Share on google
Share on pinterest
Share on reddit
Share on print
Related Projects & Tutorials
Interfacing GY-521 module with evive
In this tutorial we will interface the GY-521 module with evive. The GY-521 module contains a 3-axis accelerometer, a 3-axis gyroscope, a temperature sensor, and a digital motion processor. We will display the value of each sensor on the serial monitor.
How to interface Water Flow sensor with evive
In this tutorial, we will discuss how to interface water flow sensor with evive. How water flow rate, current water flowing and output water changes? The water flow rate in liters per hour, current water flowing and output water flowing data flowed since starting is displayed on the screen. All the answers are given in this tutorial.LET'S BEGIN...
All articles loaded
No more articles to load
Featured Projects
All articles loaded
No more articles to load

Leave a Reply

Close Menu