TOP Contributors

  1. MIKROE (2662 codes)
  2. Alcides Ramos (357 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 (137025 times)
  2. FAT32 Library (70150 times)
  3. Network Ethernet Library (56032 times)
  4. USB Device Library (46355 times)
  5. Network WiFi Library (41970 times)
  6. FT800 Library (41297 times)
  7. GSM click (29068 times)
  8. mikroSDK (26503 times)
  9. PID Library (26452 times)
  10. microSD click (25428 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 20 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.5

mikroSDK Library: 2.0.0.0

Category: RTC

Downloaded: 39 times

Not followed.

License: MIT license  

RTC 20 Click is a compact add-on board that measures the passage of real-time. This board features the AB0805, an I2C-configurable real-time clock with a highly sophisticated feature set from Abracon LLC. The AB0805 provides information like seconds, minutes, hours, days, months, years, and dates based on a 32.768kHz quartz crystal through an I2C serial interface to transmit time and calendar data to the MCU. It also has automatic leap year compensation, low power consumption, and full RTC functions such as battery backup, programmable counters, and alarms for timer and watchdog functions.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


RTC 20 click

RTC 20 Click is a compact add-on board that measures the passage of real-time. This board features the AB0805, an I2C-configurable real-time clock with a highly sophisticated feature set from Abracon LLC. The AB0805 provides information like seconds, minutes, hours, days, months, years, and dates based on a 32.768kHz quartz crystal through an I2C serial interface to transmit time and calendar data to the MCU. It also has automatic leap year compensation, low power consumption, and full RTC functions such as battery backup, programmable counters, and alarms for timer and watchdog functions.

rtc20_click.png

click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Feb 2023.
  • Type : I2C type

Software Support

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

Standard key functions :

  • rtc20_cfg_setup Config Object Initialization function.

    void rtc20_cfg_setup ( rtc20_cfg_t *cfg );
  • rtc20_init Initialization function.

    err_t rtc20_init ( rtc20_t *ctx, rtc20_cfg_t *cfg );

Example key functions :

  • rtc20_set_time RTC 20 set time function.

    err_t rtc20_set_time ( rtc20_t *ctx, rtc20_time_t rtc_time );
  • rtc20_set_date RTC 20 set date function.

    err_t rtc20_set_date ( rtc20_t *ctx, rtc20_date_t rtc_date );
  • rtc20_get_time RTC 20 get time function.

    err_t rtc20_get_time ( rtc20_t *ctx, rtc20_time_t *rtc_time );

Example Description

This example demonstrates the use of the RTC 20 click board™ by reading and displaying the RTC time and date values.

The demo application is composed of two sections :

Application Init

Initialization of I2C module, log UART and additional pins. After driver initialization the app set RTC time to 23:59:50 and set date to Tuesday 28.02.2023.

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    rtc20_cfg_t rtc20_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.
    rtc20_cfg_setup( &rtc20_cfg );
    RTC20_MAP_MIKROBUS( rtc20_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == rtc20_init( &rtc20, &rtc20_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    time.hour   = 23;
    time.minute = 59;
    time.second = 50;
    if ( RTC20_OK == rtc20_set_time( &rtc20, time ) )
    {
        log_printf( &logger, "  Set time : %.2d:%.2d:%.2d\r\n", 
                    ( uint16_t ) time.hour, ( uint16_t ) time.minute, ( uint16_t ) time.second );
    }

    date.day_of_week = RTC20_DW_TUESDAY;
    date.day         = 28;
    date.month       = 2;
    date.year        = 23;
    if ( RTC20_OK == rtc20_set_date( &rtc20, date ) )
    {
        log_printf( &logger, "  Set date : %.2d-%.2d-%.2d\r\n", 
                    ( uint16_t ) date.day, ( uint16_t ) date.month, ( uint16_t ) date.year );
    }
    Delay_ms ( 1000 );
    log_printf( &logger, "---------------------\r\n" );
}

Application Task

This is an example that shows the use of a RTC 20 Click board™. In this example, we read and display the current time ( 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 ) 
{
    if ( RTC20_OK == rtc20_get_time( &rtc20, &time ) )
    {
        if ( RTC20_OK == rtc20_get_date( &rtc20, &date ) )
        {
            if ( time.second != new_sec ) 
            {
                log_printf( &logger, "  Date : %.2d-%.2d-%.2d\r\n",
                            ( uint16_t ) date.day, ( uint16_t ) date.month, ( uint16_t ) date.year );
                display_day_of_week( );
                log_printf( &logger, "  Time : %.2d:%.2d:%.2d\r\n",
                            ( uint16_t ) time.hour, ( uint16_t ) time.minute, ( uint16_t ) time.second );
                log_printf( &logger, "- - - - - - - - - - -\r\n" );
                new_sec = time.second;
                Delay_ms ( 1 );
            }
        }
    }
    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.RTC20

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

H-Bridge 7 click

5

H-Bridge 7 Click features flexible motor driver IC for a wide variety of applications, labeled as the DRV8876N. This Click board integrates an N-channel H-bridge, charge pump regulator, and protection circuitry. The charge pump improves efficiency by allowing for both high-side and low-side N-channels MOSFETs and 100% duty cycle support.

[Learn More]

mikromedia for XMEGA - Examples

5

Set of examples for mikromedia for XMEGA.. Provided examples demonstrate working with mikromedia's various features and modules:

- Accelerometer
- MMC SD card
- MP3
- Serial Flash
- TFT
- Touch Panel
- USB UART

[Learn More]

DC Motor 13 click

0

DC Motor 13 Click is a compact add-on board with a brushed DC motor driver. This board features the TB67H481FNG, a dual-channel, H-bridge, brushed DC motor driver from Toshiba Semiconductor that uses the PWM IN interface to control the DC motor outputs. Fabricated with the BiCD process (DMOSFET is used for output power transistor), it covers a wide operating voltage range of 8.2V to 44V with a maximum output current capacity of 2A. It also offers helpful features like a robust and reliable operation, like the decay modes selection function, PWM constant-current drive, torque settings, protection features, and one anomaly detection indicator.

[Learn More]