How does it work?
RTC 17 Click as its foundation uses the RV5C387A, an I2C configurable real-time clock/calendar optimized for low power operations from Nisshinbo Micro Devices Inc. The RV5C387A is configured to transmit calendar and time data to the MCU and comes with an integrated interrupt generation function. It reads and writes time data from and to the MCU in units ranging from seconds to the last two digits of the calendar year. The calendar year will automatically be identified as a leap year when its last two digits are a multiple of 4. Consequently, leap years up to the year 2099 can automatically be recognized.
This Click board™ communicates with MCU using the standard I2C 2-Wire interface to read data and configure settings, supporting a Fast Mode operation up to 400kHz. It also incorporates an alarm circuit configured to generate an interrupt signal to the INT pin of the mikroBUS™ socket from its A, B, or C interrupt pin at preset times. The alarm circuit allows two types of alarm settings specified by the Alarm_W registers and the Alarm_D registers.
The Alarm_W registers (interrupt B) allow a week, hour, and minute alarm settings, including combinations of multiple day-of-week settings such as Monday, Wednesday, while the Alarm_D registers (interrupt C) allow an hour and minute alarm settings. Besides, the RV5C387A can generate periodic interrupt signals aside from interrupt signals generated by the alarm circuit from interrupt A pin. The RTC 17 Click also has an onboard header labeled CLKO, which provides clock pulses of 32kHz.
The most common RTC configuration, like this one, is a battery-backed up, which maintains time and continues its work without interruption in the event of a power failure. That’s why, in addition to the BU9873, the RTC 17 Click is equipped with a button cell battery holder compatible with the 3000TR battery holder, suitable for 12mm Coin Cell batteries.
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 that contains 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 various time-keeping applications, including daily alarms, metering applications, and others requiring an accurate RTC for their operation
On-board modules
RV5C387A – I2C configurable real-time clock/calendar optimized for low power operations from Nisshinbo Micro Devices Inc
Key Features
Low power consumption, programmable periodic and alarm with interrupt capability, clock/calendar feature, battery back-up, 32kHz clock output, automatic leap year recognition up to the year 2099, and more
Interface
I2C
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 17 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 |
R8 | A | Unpopulated | Interrupt A Signal Jumper |
R7 | B | Populated | Interrupt B Signal Jumper |
R6 | C | Unpopulated | Interrupt C Signal Jumper |
J1 | CLKO | Unpopulated | 32kHz Clock Output Header |
RTC 17 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
Clock Output CLKO | – | 32 | – | kHz |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the RTC 17 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Library Description
This library contains API for RTC 17 Click driver.
Key functions
-
rtc17_set_time
This function sets the starting time values – second, minute and hour. -
rtc17_read_time
This function reads the current time values – second, minute and hour. -
rtc17_read_date
This function reads the current date values – day of week, day, month and year.
Example Description
This example demonstrates the use of RTC 17 Click board™ by reading and displaying the time and date values.
void application_task ( void )
{
// Wait for interrupt which is synchronized with second count-up
while ( rtc17_get_int_pin ( &rtc17 ) );
rtc17_clear_interrupts ( &rtc17 );
if ( RTC17_OK == rtc17_read_time ( &rtc17, &time ) )
{
log_printf( &logger, " Time: %.2u:%.2u:%.2urn",
( uint16_t ) time.hour, ( uint16_t ) time.minute, ( uint16_t ) time.second );
}
if ( RTC17_OK == rtc17_read_date ( &rtc17, &date ) )
{
log_printf( &logger, " Date: %s, %.2u.%.2u.20%.2u.rnn",
rtc17_get_day_of_week_name ( date.day_of_week ),
( uint16_t ) date.day, ( uint16_t ) date.month, ( uint16_t ) date.year );
}
}
The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.
Other Mikroe Libraries used in the example:
- MikroSDK.Board
- MikroSDK.Log
- Click.RTC17
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 MikroElektronika compilers.
mikroSDK
This Click board™ is supported with mikroSDK – MikroElektronika 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.