How does it work?
RTC 20 Click is based on the AB0805, a low-power, real-time clock (RTC) time-keeping device from Abracon LLC. The AB0805 is configured to transmit calendar and time data to the MCU based on a 32.768kHz quartz crystal and comes with 256 bytes of general-purpose RAM. It reads and writes clock/calendar data from and to the MCU in units ranging from seconds to the last two digits of the calendar year, providing seconds, minutes, hours, dates, days, weeks, months, years, and century information. The end-of-the-month date is automatically adjusted for months with fewer than 31 days, including corrections for the leap year until 2199.
This Click board™ communicates with the MCU using the standard I2C 2-Wire interface to read data and configure settings, supporting a Fast Mode operation up to 400kHz. By utilizing an automatic backup switch feature, this RTC can use an external power source (220mF supercapacitor) when there is no power supply on its main power terminals, thus allowing for uninterrupted operation.
Besides an automatic backup switchover circuit, the AB0805 also has some flexible inputs that can aggregate various interrupt sources to an MCU. Based on this, functions like external interrupt or watchdog timer reset could be found on this Click board™ routed on the EXT and WDI pins of the mikroBUS™ socket, as well as the primary and secondary interrupt signals routed on the IR1 and IR2 pins of the mikroBUS™ socket. In addition to the alarm/interrupt feature, the IR1 signal also provides the selectable-frequency square wave signal (512Hz default value).
This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing 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
AB0805 – real-time clock from Abracon LLC
Key Features
Low power consumption, programmable square-wave output, high-speed I2C interface, clock/calendar counter, 256 bytes RAM, automatic leap year compensation, automatic backup switchover, alarms for timer and watchdog functions, and more
Interface
I2C
Feature
ClickID
Compatibility
mikroBUS™
Click board size
S (28.6 x 25.4 mm)
Input Voltage
3.3V
Pinout diagram
This table shows how the pinout on RTC 20 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 |
RTC 20 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | – | 3.3 | – | V |
Memory Size | – | – | 256 | bytes |
Date Format | YY-MM-DD-dd | |||
Time Format | HH:MM:SS:hh |
Software Support
We provide a library for the RTC 20 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 20 Click driver.
Key functions
-
rtc20_set_time
RTC 20 set time function. -
rtc20_set_date
RTC 20 set date function. -
rtc20_get_time
RTC 20 get time function.
Example Description
This example demonstrates the use of the RTC 20 Click board™ by reading and displaying the RTC time and date values.
void application_task ( void )
{
if ( RTC20_OK == rtc20_get_time( &rtc20, &time ) )
{
if ( RTC20_OK == rtc20_get_date( &rtc20, &date ) )
{
if ( time.second != new_sec )
{
log_printf( &logger, " Date : %.2d-%.2d-%.2drn",
( uint16_t ) date.day, ( uint16_t ) date.month, ( uint16_t ) date.year );
display_day_of_week( );
log_printf( &logger, " Time : %.2d:%.2d:%.2drn",
( uint16_t ) time.hour, ( uint16_t ) time.minute, ( uint16_t ) time.second );
log_printf( &logger, "- - - - - - - - - - -rn" );
new_sec = time.second;
Delay_ms( 1 );
}
}
}
Delay_ms( 1 );
}
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.RTC20
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, which needs to be downloaded from the LibStock and installed for the compiler you are using to ensure proper operation of mikroSDK compliant Click board™ demo applications.
For more information about mikroSDK, visit the official page.