TOP Contributors

  1. MIKROE (2751 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (139058 times)
  2. FAT32 Library (71588 times)
  3. Network Ethernet Library (56988 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29765 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 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: 265 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

OLED Switch click

1

This board has a module that combines a button and a full color organic LED display, plus input/output screw terminals for connecting external electronics. The mechanical button itself is nicely built, with a translucent black housing. When pressed, it gives satisfying tactile feedback.

[Learn More]

Moisture click

5

Moisture click is a Click board that can be used to easily detect a moisture level of the skin, by simply touching the sensitive surface of the PCB.

[Learn More]

UWB Click

0

UWB Click is an Ultra-Wideband transceiver Click board™ that can be used in 2-way ranging or TDOA location systems to locate assets to a precision of 10 cm and supports data rates of up to 6.8 Mbps. This Click board™ features the DWM1000 module based on Decawave's DW1000 Ultra-Wideband (UWB) transceiver from Decawave Limited.

[Learn More]