TOP Contributors

  1. MIKROE (2656 codes)
  2. Alcides Ramos (353 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 (136866 times)
  2. FAT32 Library (70000 times)
  3. Network Ethernet Library (55998 times)
  4. USB Device Library (46294 times)
  5. Network WiFi Library (41898 times)
  6. FT800 Library (41204 times)
  7. GSM click (29012 times)
  8. PID Library (26423 times)
  9. mikroSDK (26394 times)
  10. microSD click (25385 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-04-03

Package Version: 2.1.0.16

mikroSDK Library: 2.0.0.0

Category: RTC

Downloaded: 176 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

LED DRIVER click

0

This application controls the brightness.

[Learn More]

Smart Mic click

0

Smart Mic Click is a compact add-on board that provides wake-on-voice capabilities with secured privacy without compromising performance. This board features the IA611, an “Always-On” voice-wake acoustic processor from Knowles Electronics. The IA611 offers flexibility by supporting the most relevant audio and data interfaces and enables ultra-low-power voice and event detection, including voice UI supporting keywords, voice commands, and acoustic event detection. Its integrated programmable DSP is made available to 3rd party algorithms with 168kB of RAM, enabling unlimited creativity.

[Learn More]

LSM303AGR Click

6

LSM303AGR click measures acceleration and magnetic field characteristics. It carries the LSM303AGR 3D accelerometer and 3D magnetometer. LSM303AGR click is designed to run on a 3.3V power supply. It communicates with the target microcontroller over I2C interface.

[Learn More]