TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137092 times)
  2. FAT32 Library (70234 times)
  3. Network Ethernet Library (56119 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42053 times)
  6. FT800 Library (41384 times)
  7. GSM click (29111 times)
  8. mikroSDK (26560 times)
  9. PID Library (26489 times)
  10. microSD click (25486 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

RTC 14 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.12

mikroSDK Library: 2.0.0.0

Category: RTC

Downloaded: 89 times

Not followed.

License: MIT license  

RTC 14 Click is a compact add-on board that measures the passage of time. This board features the ISL1221, a low-power RTC with battery-backed SRAM and event detection from Renesas. The ISL1221 tracks time with separate registers for hours, minutes, and seconds, operating in normal and battery mode. It also can timestamp an event by either issuing an output signal, containing the second, minute, hour, date, month, and year that the triggering event occurred, or by stopping the RTC registers from advancing at the moment the event occurs. The calendar feature is exceptionally accurate through 2099, with automatic leap year correction.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "RTC 14 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "RTC 14 click" changes.

Do you want to report abuse regarding "RTC 14 click".

  • Information
  • Comments (0)

mikroSDK Library Blog


RTC 14 click

RTC 14 Click is a compact add-on board that measures the passage of time. This board features the ISL1221, a low-power RTC with battery-backed SRAM and event detection from Renesas. The ISL1221 tracks time with separate registers for hours, minutes, and seconds, operating in normal and battery mode. It also can timestamp an event by either issuing an output signal, containing the second, minute, hour, date, month, and year that the triggering event occurred, or by stopping the RTC registers from advancing at the moment the event occurs. The calendar feature is exceptionally accurate through 2099, with automatic leap year correction.

rtc14_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Aug 2021.
  • Type : I2C type

Software Support

We provide a library for the RTC14 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 RTC14 Click driver.

Standard key functions :

  • rtc14_cfg_setup Config Object Initialization function.

    void rtc14_cfg_setup ( rtc14_cfg_t *cfg );
  • rtc14_init Initialization function.

    err_t rtc14_init ( rtc14_t *ctx, rtc14_cfg_t *cfg );
  • rtc14_default_cfg Click Default Configuration function.

    err_t rtc14_default_cfg ( rtc14_t *ctx );

Example key functions :

  • rtc14_get_time RTC 14 get time function.

    err_t rtc14_get_time ( rtc14_t *ctx, rtc14_time_t *rtc_time );
  • rtc14_set_time RTC 14 set time function.

    err_t rtc14_set_time ( rtc14_t *ctx, rtc14_time_t rtc_time );
  • rtc14_get_date RTC 14 get date function.

    err_t rtc14_get_date ( rtc14_t *ctx, rtc14_date_t *rtc_date );

Example Description

This is an example that demonstrates the use of the RTC 14 click board™.

The demo application is composed of two sections :

Application Init

Initialization of I2C module, log UART and additional pins. After driver initialization and default settings, the app set the time to 11:59:50 PM ( 12-hour format ) and set date to Thursday 05.08.2021.


void application_init ( void ) 
{
    log_cfg_t log_cfg;      /**< Logger config object. */
    rtc14_cfg_t rtc14_cfg;  /**< Click config object. */

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    rtc14_cfg_setup( &rtc14_cfg );
    RTC14_MAP_MIKROBUS( rtc14_cfg, MIKROBUS_1 );
    err_t init_flag = rtc14_init( &rtc14, &rtc14_cfg );
    if ( I2C_MASTER_ERROR == init_flag ) 
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    rtc14_default_cfg ( &rtc14 );
    Delay_ms ( 100 );

    time.hours_format = RTC14_SET_HOURS_FORMAT_12;
    time.am_pm = RTC14_SET_HOURS_FORMAT_12_PM;
    time.hours = 11;
    time.min = 59;
    time.sec = 50;
    rtc14_set_time( &rtc14, time );
    Delay_ms ( 100 );

    date.day_of_week = RTC14_DW_THURSDAY;
    date.day = 5;
    date.month = 8;
    date.year = 21;
    rtc14_set_date( &rtc14, date );
    Delay_ms ( 100 );

    log_info( &logger, " Application Task " );
    log_printf( &logger, "- - - - - - - - - - -\r\n" );
}

Application Task

This is an example that shows the use of a RTC 14 click board™. In this example, we read and display the current time ( AM or PM ) and date ( day of the week ), which we also previously set. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB changes every 1 sec.


void application_task ( void ) 
{    
    rtc14_get_time( &rtc14, &time );
    Delay_ms ( 1 );
    rtc14_get_date( &rtc14, &date );
    Delay_ms ( 1 );

    if ( time.sec != new_sec ) 
    {       
        log_printf( &logger, "  Date : %.2d-%.2d-%.2d ", ( uint16_t ) date.day, ( uint16_t ) date.month, ( uint16_t ) date.year );
        display_day_of_week( );
        log_printf( &logger, "%cM\r\n", ( time.am_pm == RTC14_SET_HOURS_FORMAT_12_PM ? 'P' : 'A' ) );
        log_printf( &logger, "- - - - - - - - - - -\r\n" );
        new_sec = time.sec;
        Delay_ms ( 1 );
    }
}

Additional Function

  • display_day_of_week The function displays the day of the week.
    static void display_day_of_week ( void );

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.RTC14

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.


ALSO FROM THIS AUTHOR

Pressure 2 click

0

Pressure 2 click carries MS5803, a high resolution MEMS pressure sensor that is both precise and robust. Its measurement range is from 0 to 14 bars (with a resolution of up to 0.2 mbars), but because of the stainless steel cap enclosure, the sensor can withstand up to 30 bars of pressure. Pressure 2 click communicates with the target board MCU either through mikroBUS SPI or I2C lines, depending on the position in which the onboard jumpers are soldered.

[Learn More]

Flash 11 click

0

Flash 11 Click is a compact add-on board representing a highly reliable memory solution. This board features the AT25SF321B, a 32-Mbit SPI serial Flash memory with Dual I/O and Quad I/O support from Dialog Semiconductor. It is designed for applications in which the program code is shadowed from Flash memory into embedded or external RAM for execution and where small amounts of data are stored and updated locally in the Flash memory. It has a flexible and optimized erase architecture for code and data storage applications, non-volatile protection, three specialized protected programmable 256-byte OTP security registers, and a 64-bit factory programmable UID register.

[Learn More]

LLC I2C click

0

LLC I2C click can be utilized as the level converter for logic signals, which makes it a very useful Click board™. The topology of this logic level conversion (LLC) circuit is perfectly suited for the bi-directional I2C communication. Although there are some specialized integrated circuits on the market, sometimes it is more convenient to have a simple solution made of just a few passive elements and four MOSFETs.

[Learn More]