How does it work?
RTC 12 Click as its foundation uses the DS1343, a low-current RTC that consumes an extremely low timekeeping current permitting longer life from a backup supply source from Analog Devices. The devices provide a full binary-coded decimal clock calendar accessed by a simple serial interface. The clock/calendar provides seconds, minutes, hours, day, date, month, and year information. The month’s end date is automatically adjusted for months with fewer than 31 days, including corrections for leap year through 2099. The clock operates in either a 24-hour or 12-hour format with an AM/PM indicator.
As performed on this Click board™, the most common configuration is a battery-backed up RTC, which maintains time and may hold data in 96 bytes of NV RAM provided for data storage. In addition to the DS1343, the RTC 12 Click is equipped with a button cell battery holder compatible with the 3000TR battery holder, suitable for 12mm Coin Cell batteries. Furthermore, it also has a built-in temperature-compensated power-sense circuit that detects power failures and automatically switches to the backup supply, thus allowing for uninterrupted operation.
The DS1343 communicates with MCU using the standard SPI serial interface that supports modes 1 and 3 with a maximum frequency of 4 MHz. It also provides two programmable time-of-day alarms. Each alarm can generate an interrupt on a programmable combination of seconds, minutes, hours, and days, available on the INT pin of the mikroBUS™ socket. The interrupt selection can be made by positioning the SMD jumper labeled INT SEL to an appropriate position. Both interrupt outputs operate when the device is powered by mikroBUS™ power rails or backup supply voltage.
In addition to the features mentioned above, the user can use another additional indicator routed to the AN pin of the mikroBUS™ socket labeled as PF to indicate a loss of a primary power supply, VCC from mikroBUS™ power rails.
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 SPI communication lines properly. In addition, 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 portable applications, industrial and health-related time metering applications, and others requiring an accurate RTC for their operation.
On-board modules
DS1343 – low-current RTC that consumes an extremely low timekeeping current permitting longer life from a backup supply source from Maxim Integrated
Key Features
Low power consumption, low timekeeping current of 250nA, RTC counts seconds, minutes, hours, days, dates, months, and years with year compensation valid through 2099, power-fail and switch circuitry, 96B battery-backed NV RAM, and more.
Interface
SPI
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 12 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 | INT SEL | Right | Interrupt Selection INT1/INT0: Left position INT1, Right position INT0 |
RTC 12 Click electrical specifications
Description | Min | Typ | Max | Unit |
---|---|---|---|---|
Supply Voltage VCC | 3.3 | – | 5 | V |
Battery Supply Voltage | 1.3 | – | 5.5 | V |
RTC Memory Size | – | – | 96 | bytes |
Operating Temperature Range | -40 | +25 | +85 | °C |
Software Support
We provide a library for the RTC 12 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 12 Click driver.
Key functions:
rtc12_cfg_setup
– Config Object Initialization function.rtc12_init
– Initialization function.rtc12_default_cfg
– Click Default Configuration function.
Examples description
This is an example that demonstrates the use of the RTC 12 Click board™.
The demo application is composed of two sections :
void application_task ( void ) { rtc12_get_time( &rtc12, &time ); Delay_ms( 1 ); rtc12_get_date( &rtc12, &date ); Delay_ms( 1 ); if ( time.sec != new_sec ) { log_printf( &logger, " Date : %.2d-%.2d-%.2drn", ( uint16_t ) date.day, ( uint16_t ) date.month, ( uint16_t ) date.year ); log_printf( &logger, " Time : %.2d:%.2d:%.2drn", ( uint16_t ) time.hours, ( uint16_t ) time.min, ( uint16_t ) time.sec ); log_printf( &logger, "- - - - - - - - - - - -rn" ); new_sec = time.sec; Delay_ms( 1 ); } }
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.Rtc12
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. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
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.