How does it work?
RTC 18 Click as its foundation uses the RV-3032-C7, a highly accurate real-time clock/calendar module optimized for low power operations from Micro Crystal AG. The RV-3032-C7 comes with a built-in 32.768kHz “Tuning Fork” crystal oscillator and HF oscillator and has counters for hundredths of seconds, seconds, minutes, hours, date, month, year, and weekday. Its temperature compensation circuitry is factory calibrated and results in the highest time accuracy of ±2.5ppm over the entire temperature range from -40 to +85°C, with an additional non-volatile aging offset correction.
This RTC also comes with an integrated digital thermometer for actual internal temperature measurement in °C with a typical accuracy of ±1°C, resolution of 0.0625°C/step, and a programmable alarm on top and bottom temperature limits. Alongside all these features, it also supports an automatic leap year correction. 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 circuitry configured to generate an interrupt signal for Periodic Countdown Timer and Periodic Time Update (seconds, minutes), date/hour/minute alarm, and an external event registered with the CS pin on the mikroBUS™ socket. An alarm (interrupt) signal routed to the INT pin of the mikroBUS™ socket allows outputting warning every day or on a specific day visually indicated by a red LED marked as ALARM.
The RV-3032-C7 also includes an automatic backup switchover circuit allowing it to be used with a single button cell battery for an extended period. The activation of this feature can be made by positioning SMD jumpers labeled as BATT SEL in an appropriate position marked as OFF or ON. Besides an automatic backup switchover circuit, it also has a trickle charger with a charge pump providing full RTC functions with programmable counters, alarm, selectable interrupt, and programmable clock output functions for frequencies from 1Hz to 52MHz available on an onboard header labeled CLKO.
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 various time-keeping applications, including daily alarms, metering applications, and others requiring an accurate RTC for their operation
On-board modules
RV-3032-C7 – real-time clock/calendar module optimized for low power operations from Micro Crystal AG
Key Features
Low power consumption, temperature compensated, high accuracy, clock/calendar feature, battery back-up, programmable interrupt and 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 18 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 |
LD2 | ALARM | – | Alarm LED Indicator |
JP1 | VCC SEL | Left | Logic Level Voltage Selection 3V3/5V: Left position 3V3, Right position 5V |
JP2 | BATT SEL | Left | Backup Supply Voltage Selection OFF/ON: Left position OFF, Right position ON |
J1 | CLKO | Unpopulated | Programmable Clock Output Header |
RTC 18 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage | 3.3 | – | 5 | V |
RTC Accuracy | – | 0.22 | – | sec/day |
Temperature Accuracy | – | ±1 | – | °C |
Resolution | – | 0.0625 | – | °C/step |
Clock Output CLKO | 1 | – | 52 | MHz |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the RTC 18 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 18 Click driver.
Key functions
-
rtc18_read_time
This function reads the current time values – second, minute and hour. -
rtc18_read_date
This function reads the current date values – day of week, day, month and year. -
rtc18_read_temperature
This function reads temperature measurements in Celsius.
Example Description
This example demonstrates the use of RTC 18 Click board™ by reading and displaying the time and date values as well as the temperature measurements in Celsius.
void application_task ( void )
{
float temperature;
// Wait for a second count-up interrupt
while ( rtc18_get_int_pin ( &rtc18 ) );
Delay_ms ( 10 );
rtc18_clear_periodic_interrupt ( &rtc18 );
if ( RTC18_OK == rtc18_read_time ( &rtc18, &time ) )
{
log_printf( &logger, " Time: %.2u:%.2u:%.2urn",
( uint16_t ) time.hour, ( uint16_t ) time.minute, ( uint16_t ) time.second );
}
if ( RTC18_OK == rtc18_read_date ( &rtc18, &date ) )
{
log_printf( &logger, " Date: %s, %.2u.%.2u.20%.2u.rn",
rtc18_get_day_of_week_name ( date.day_of_week ),
( uint16_t ) date.day, ( uint16_t ) date.month, ( uint16_t ) date.year );
}
if ( RTC18_OK == rtc18_read_temperature ( &rtc18, &temperature ) )
{
log_printf( &logger, " Temperature: %.2f Crnn", temperature );
}
}
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.RTC18
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.