TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (385 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 (139845 times)
  2. FAT32 Library (72209 times)
  3. Network Ethernet Library (57392 times)
  4. USB Device Library (47740 times)
  5. Network WiFi Library (43364 times)
  6. FT800 Library (42700 times)
  7. GSM click (29980 times)
  8. mikroSDK (28440 times)
  9. PID Library (26989 times)
  10. microSD click (26398 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 7 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.13

mikroSDK Library: 2.0.0.0

Category: RTC

Downloaded: 223 times

Not followed.

License: MIT license  

RTC 7 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 or a super capacitor, for an extended period of time.

No Abuse Reported

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

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

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

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


RTC 7 Click

RTC 7 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 or a super capacitor, for an extended period of time.

rtc7_click.png

Click Product page


Click library

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

Software Support

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

Standard key functions :

  • rtc7_cfg_setup Config Object Initialization function.

    void rtc7_cfg_setup ( rtc7_cfg_t *cfg ); 
  • rtc7_init Initialization function.

    err_t rtc7_init ( rtc7_t *ctx, rtc7_cfg_t *cfg );
  • rtc7_default_cfg Click Default Configuration function.

    err_t rtc7_default_cfg ( rtc7_t *ctx );

Example key functions :

  • rtc7_check_interrupt This function returns the interrupt state, state of INTA pin.

    uint8_t rtc7_check_interrupt ( rtc7_t *ctx );
  • rtc7_read_reg This function writes one byte data to the register.

    err_t rtc7_read_reg ( rtc7_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len );
  • rtc7_get_local_time This function gets the local time data including the determined time zone in calculations.

    err_t rtc7_get_local_time ( rtc7_t *ctx, rtc7_time_t *local_time );

Examples Description

This app is used to accurately measure time with low power consumption.

The demo application is composed of two sections :

Application Init

Initializes device.


void application_init ( void )
{
    log_cfg_t log_cfg;
    rtc7_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.
    rtc7_cfg_setup( &cfg );
    RTC7_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    rtc7_init( &rtc7, &cfg );
    Delay_ms ( 300 );

    time_set.seconds = 40;
    time_set.minutes = 59;
    time_set.hours = 23;
    time_set.weekdays = 1;
    time_set.monthday = 31;
    time_set.month = 12;
    time_set.year = 22;

    err_t error_flag = rtc7_reset( &rtc7 );
    error_flag |= rtc7_init_time ( &rtc7, 0 );
    error_flag |= rtc7_set_gmt_time( &rtc7, &time_set );
    error_flag |= rtc7_set_osc( &rtc7, RTC7_ENABLE_OSC, RTC7_INPUT_FREQ_32768HZ, RTC7_OUTPUT_FREQ_32768HZ );
    error_flag |= rtc7_write_reg( &rtc7, RTC7_TIMER_INIT_REG, 15 );
    error_flag |= rtc7_set_timer( &rtc7, RTC7_TIMER_EN, RTC7_TIMER_FREQ_16HZ );
    Delay_ms ( 100 );
    if ( RTC7_ERROR == error_flag )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }
    log_info( &logger, " Application Task " );
}

Application Task

Waits for a second count-up interrupt and then reads and logs the current time and date on the USB UART.


void application_task ( void )
{
    // Wait for timer count-down interrupt which is set to 1Hz
    while ( rtc7_check_interrupt ( &rtc7 ) );

    // Clear interrupt status
    uint8_t int_status = 0;
    rtc7_read_reg( &rtc7, RTC7_INT_STATUS_REG, &int_status, 1 );

    // Read time
    if ( RTC7_OK == rtc7_get_local_time( &rtc7, &time_date ) )
    {
        // Display time
        rtc7_display_results( &rtc7 );
    }
}

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

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

NanoBeacon Click

0

NanoBeacon Click is a compact add-on board that provides a powerful and efficient Bluetooth beacon solution. This board features the IN100, an ultra-low power Bluetooth 5.3 Beacon SoC from InPlay, that sets a new standard in beacon technology. Its ultra-low power consumption, enhanced privacy mode, and three beacon modes offer seamless compatibility with no Bluetooth programming required - plug and play. Its compact design houses two types of built-in memory (4Kb OTP and 4KB SRAM), UART and I2C interfaces, and a hardware security engine.

[Learn More]

I2C to CAN Click

0

I2C to CAN Click is a compact add-on board that contains I2C to CAN-physical transceiver, which extends a single-master I2C bus through harsh or noisy environments. This board features the LT3960, a robust high-speed transceiver that extends a single-master I2C bus up to 400kbps using the CAN-physical layer from Analog Devices. One LT3960 from SCL and SDA I2C lines creates equivalent differential buses (CAN) on two twisted pairs, while the second LT3960 recreates the I2C bus locally for any slave I2C devices on the other end of the twisted pairs. A built-in 3.3V LDO powers both the I2C and CAN lines from a single input supply from 4V to 60V. This Click board™ is suitable for industrial and automotive networking, remote sensor applications, and more.

[Learn More]

Smart Card 2 Click

0

Smart Card 2 Click is a compact add-on board for reading smart cards. This board features Microchip’s SEC1210, a low-power single-chip Smart Card controller with a UART interface. The SEC1210 bridge controller uses a combination of hardware and software to deliver high-performance and flexible design customization options. It is fully compliant with standards like ISO/IEC 7816, EMV 4.2/4.3, ETSI TS 102 221, and PC/SC, utilizing TrustSpan™ technology that enables digital systems to communicate securely, process, move and store information. With its onboard card holder, it supports data processing with 2FF smart cards, and with an additional connector for external connection, it also allows the processing of a standard 1FF card.

[Learn More]