Using the Real-Time Clock TinyShield

by TinyCircuits Staff February 24, 2016

Using the Real-Time Clock TinyShield

Overview:

The TinyShield Real-Time Clock lets you keep track of time in seconds, minutes, hours, days, date, month and year with leap-year compensation (valid up to 2100). This TinyShield is based around the Maxim DS1339 Real-Time clock.


Powering the System:

The Maxim DS1339 is a very low power real-time clock, drawing only 400 nA to maintain time keeping. Due to the low power, a coin cell battery is sufficient to run this board. This TinyShield can operate over the entire TinyDuino voltage range (2.7 - 5.5V) safely.


Using the Real-Time Clock TinyShield

The Real-Time Clock TinyShield uses the I2C bus to communicate between the TinyDuino processor and the Maxim DS1339 RTC. Below is a sample sketch to get set and get the time values for the RTC on the USB serial port:

Plug in your TinyDuino to your computer with the USB TinyShield and the RTC TinyShield attached.

Upload the code using Codebender directly from this webpage. Alternatively, open the Arduino IDE and copy the source code above into it, and upload to the TinyDuino.

Open up the Serial Monitor, and you'll be able to configure and read out the time values (using options 4 & 5):


Using the Real-Time Alarm Function

This example lets you configure the RTC Alarm Function to wakeup the TinyDuino Processor to perform a function - this particular example will turn on or off an IO pin, so you can turn on an LED or use a Relay to control an external light.



TinyCircuits Staff
TinyCircuits Staff

Author



Also in Learn

New Tiny Arcade - Assembly Instructions (With Rev5 Boards)
New Tiny Arcade - Assembly Instructions (With Rev5 Boards)

by TinyCircuits Staff January 15, 2019

We are super excited to release our latest version of the beloved Tiny Arcade kit! This assembly tutorial features our...

View full article →

Command Servo Motors from your Phone using Bluetooth
Command Servo Motors from your Phone using Bluetooth

by TinyCircuits Staff December 27, 2018

Using a TinyZero, Bluetooth TinyShield, Servo TinyShield, and a servo along with a handy dandy iOS or Android app, you...

View full article →

Tiny Screen Video(TSV) Converter Install for macOS
Tiny Screen Video(TSV) Converter Install for macOS

by Laverena Wienclaw December 19, 2018

In this tutorial we'll talk about how you can get a Windows application running on your Mac (for free) using Wine...

View full article →