How does it work?
RTC 4 Click is based on the DS2417, a real-time clock from Analog Devices, offering a simple solution for storing and retrieving vital time information with minimal hardware. The DS2417 contains a real-time clock/calendar implemented as a 32-bit binary counter and a unique factory-lasered 64-bit registration number that allows multiple same Click boards™ to be connected on the same data line. It communicates with the host MCU through a standard Dallas Semiconductor 1-Wire interface (16.3kbps). It comes with a clock accuracy of ±2 minutes per month at a 25 degrees Celsius temperature and a clock frequency derived from an onboard 32.768kHz oscillator.
The DS2417’s data is nonvolatile and can be used for stand-alone operation thanks to a backup energy source (an onboard coin cell supercapacitor). The DS2417 adds functions such as a calendar, time and date stamp, and logbook to any electronic device or embedded microcontroller application. It can accumulate 136 years of seconds before rolling over, where time/date is represented by the number of seconds since a reference point, which the user determines.
This Click board™ communicates with MCU using the 1-Wire interface that, by definition, requires only one data line (and ground) for communication with MCU. Without the main power supply, the data line can also power the sensor parasitically. The 1-Wire communication line is routed to the GP SEL jumper allowing the 1-Wire communication signal to the PWM pin or the AN pin of the mikroBUS™ socket. These pins are labeled GP0 and GP1, respectively, the same as the SMD jumper positions, making selecting the desired pin straightforward. Besides, the DS2417 also includes an interrupt feature routed to the INT pin of the mikroBUS™ socket for system output.
This Click board™ can operate with both 3.3V and 5V logic voltage levels selected via the VCC SEL jumper. This way, it is allowed for both 3.3V and 5V capable MCUs to use the communication lines properly. However, the Click board™ comes equipped with a library containing easy-to-use functions and an example code that can be used, as a reference, for further development.
Specifications
Type
RTC
Applications
Can be used for general-consumer applications, including daily alarms, metering applications, and others requiring an accurate RTC for their operation
On-board modules
DS2417 – real-time clock from Analog Devices
Key Features
Binary time/date representation, 1 second resolution, clock accuracy ±2 minutes, programmable interrupt, 1-Wire interface, unique lasered ROM, backup energy source, low power consumption, high accuracy, and more
Interface
1-Wire
Feature
No ClickID
Compatibility
mikroBUS™
Click board size
M (42.9 x 25.4 mm)
Input Voltage
3.3V or 5V
Pinout diagram
This table shows how the pinout on RTC 4 Click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard settings and indicators
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | – | Power LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | GP SEL | Left | Communication Pin Selection GP0/GP1: Left position GP0, Right position GP1 |
RTC 4 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Software Support
We provide a library for the RTC 4 Click as well as a demo application (example), developed using Mikroe compilers. The demo can run on all the main Mikroe development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for RTC 4 Click driver.
Key functions
-
rtc4_get_interrupt
This function checks the interrupt state of the DS2417 Real time clock/calendar. -
rtc4_set_date_time
This function sets date and time structure along with interrupt interval. -
rtc4_get_date_time
This function gets RTC4 time and date structure.
Example Description
This example demonstrates the use of the RTC 4 click board.
void application_task ( void )
{
while ( rtc4_get_interrupt ( &rtc4 ) );
if ( RTC4_OK == rtc4_get_date_time ( &rtc4, &date, &time ) )
{
log_printf( &logger, "Time: %.2u:%.2u:%.2urn",
( uint16_t ) time.hours, ( uint16_t ) time.min, ( uint16_t ) time.sec );
log_printf( &logger, "Date: %.2u/%.2u/%urn",
( uint16_t ) date.day, ( uint16_t ) date.month, ( uint16_t ) date.year );
log_printf( &logger, "------------------------rnn");
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.RTC4
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. UART terminal is available in all Mikroe compilers.
mikroSDK
This Click board™ is supported with mikroSDK – Mikroe Software Development Kit. To ensure proper operation of mikroSDK compliant Click board™ demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.
For more information about mikroSDK, visit the official page.