TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139568 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57256 times)
  4. USB Device Library (47631 times)
  5. Network WiFi Library (43221 times)
  6. FT800 Library (42566 times)
  7. GSM click (29932 times)
  8. mikroSDK (28292 times)
  9. PID Library (26934 times)
  10. microSD click (26309 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 10 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.18

mikroSDK Library: 2.0.0.0

Category: RTC

Downloaded: 289 times

Not followed.

License: MIT license  

RTC 10 Click is a real-time clock module which has an extremely low power consumption, allowing it to be used with a single button cell battery, for an extended period of time.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "RTC 10 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "RTC 10 Click" changes.

Do you want to report abuse regarding "RTC 10 Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


Rtc 10 Click

RTC 10 Click is a real-time clock module which has an extremely low power consumption, allowing it to be used with a single button cell battery, for an extended period of time.

rtc10_click.png

Click Product page


Click library

  • Author : MikroE Team
  • Date : dec 2019.
  • Type : I2C type

Software Support

We provide a library for the Rtc10 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 form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Rtc10 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void rtc10_cfg_setup ( rtc10_cfg_t *cfg );

  • Initialization function.

    RTC10_RETVAL rtc10_init ( rtc10_t ctx, rtc10_cfg_t cfg );

  • Click Default Configuration function.

    void rtc10_default_cfg ( rtc10_t *ctx );

Example key functions :

  • Generic write function.

    oid rtc10_generic_write ( rtc10_t ctx, uint8_t reg, uint8_t data_buf, uint8_t len );

  • Generic read function.

    void rtc10_generic_read ( rtc10_t ctx, uint8_t reg, uint8_t data_buf, uint8_t len );

  • Hardware reset function.

    void rtc10_hw_reset ( rtc10_t *ctx );

Examples Description

This application is a real-time clock module.

The demo application is composed of two sections :

Application Init

Initialization driver enable's - I2C, hardware reset, set start time and date, enable counting also, write log.


void application_init ( void )
{
    log_cfg_t log_cfg;
    rtc10_cfg_t cfg;

    /** 
     * 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.

    rtc10_cfg_setup( &cfg );
    RTC10_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    rtc10_init( &rtc10, &cfg );

    Delay_ms ( 1000 );

    sec_flag = 0xFF;

    log_printf( &logger, "------------------- \r\n" );
    log_printf( &logger, "  Hardware  Reset   \r\n" );
    rtc10_hw_reset(  &rtc10 );
    Delay_ms ( 1000 );

    // Set Time: 23h, 59 min and 50 sec
    rtc10_set_time(  &rtc10, 23, 59, 50 );
    Delay_ms ( 10 );

    // Set Date: 6 ( Day of the week: Saturday ), 31 ( day ), 8 ( month ) and 2019 ( year )
    rtc10_set_date(  &rtc10,  6, 31, 8, 2019 );
    Delay_ms ( 100 );

    log_printf( &logger, "-------------------  \r\n" );
    log_printf( &logger, "  Enable Counting  \r\n" );
    log_printf( &logger, "------------------- \r\n" );
    log_printf( &logger, "     Start RTC      \r\n" );
    log_printf( &logger, "------------------- \r\n" );
    rtc10_enable_counting(  &rtc10 );
    Delay_ms ( 100 );
}

Application Task

This is an example which demonstrates the use of RTC 10 Click board. RTC 10 Click communicates with register via I2C interface, set time and date, enable counting and display time and date values, also, display temperature value for every 1 sec. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on Usart Terminal changes for every 1 sec.

void application_task ( void )
{
    uint8_t i;
    uint8_t time_hours = 0;
    uint8_t time_minutes = 0;
    uint8_t time_seconds = 0;

    uint8_t day_of_the_week = 0;
    uint8_t date_day = 0;
    uint8_t date_month = 0;
    uint8_t date_year = 0;

    float temperature;

    rtc10_get_time( &rtc10, &time_hours, &time_minutes, &time_seconds );
    Delay_ms ( 100 );

    rtc10_get_date( &rtc10, &day_of_the_week, &date_day, &date_month, &date_year );
    Delay_ms ( 100 );

    if ( sec_flag !=  time_seconds )
    {
        log_printf( &logger, " \r\n\n Time: %u:%u:%u  ", (uint16_t)time_hours, (uint16_t)time_minutes, (uint16_t)time_seconds );

        log_printf( &logger, "Date: %u. %u. 20%u. ", (uint16_t)date_day, (uint16_t)date_month, (uint16_t)date_year );
        display_day_of_the_week( day_of_the_week );

        if ( time_seconds == 0 )
        {
            temperature = rtc10_get_temperature( &rtc10 );

            log_printf( &logger, "\r\n\n Temp.:%.2f C", temperature);
        }
        log_printf( &logger, "--------------------------------------------" );

        sec_flag =  time_seconds;
    }
}

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Rtc10

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.


ALSO FROM THIS AUTHOR

Matrix R Click

0

Matrix R Click is a mikroBUS add-on board with two red 5x7 matrices driven by two MAX7219 8-bit LED Display Drivers. The active area of each matrix is 7.62mm high and 5.08 mm wide. 7x5 is a standard resolution for displaying ASCII characters, so the Click is essentially a dual-character display capable of showing letters in more readable typefaces compared to a 14-segment display. The Click communicates with the target MCU through the mikroBUS:tm: SPI interface with two separate Chip Select lines for each matrix (CSL for the left, CSR for the right). This board is designed to use a 5V power supply.

[Learn More]

Timer Relay Click

0

Timer Relay Click is a compact add-on board that allows you to control the load with a timer. This board features the NE5555, a precision timer from Diodes Incorporated. It is a precision timing circuit capable of producing accurate time delays in a monostable mode of operation.

[Learn More]

4G LTE-ATT Click

0

4G LTE-AT&T Click is an LTE Cat 1 / UMTS multimodecellular network solution, featuring the compact LARA-R2 series modem from u-blox. This module supports up to four LTE bands and up to two UMTS bands. It also features a full range of options for the high speed cellular networking and communication, such as the network indication, full embedded TCP/UDP stack, HTTP and HTTPS transfer protocols, IPv4/IPv6 dual-stack support, secondary antenna for the RX diversity, antenna detection, jamming signal detection, embedded TLS 1.2 protocol for the improved security and more. 4G LARA Click can achieve data rates up to 10.3 Mbps/5.2 Mbps (downlink/uplink).

[Learn More]