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 (137040 times)
  2. FAT32 Library (70167 times)
  3. Network Ethernet Library (56041 times)
  4. USB Device Library (46364 times)
  5. Network WiFi Library (41981 times)
  6. FT800 Library (41311 times)
  7. GSM click (29080 times)
  8. mikroSDK (26519 times)
  9. PID Library (26454 times)
  10. microSD click (25449 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

Timer click

Rating:

1

Author: MIKROE

Last Updated: 2019-03-14

Package Version: 1.0.0.1

mikroSDK Library: 1.0.0.0

Category: RTC

Downloaded: 4491 times

Not followed.

License: MIT license  

Timer click is a mikroBUS add-on board with Maxim’s DS1682 total elapsed time recorder. It holds an elapsed time counter (ETC) in conjunction with the ALARM pin. The alarm flag is one time programmable. The board communicates through I2C interface, with two additional pins: ALARM and EVENT. It uses either a 3.3V or a 5V power supply only.

No Abuse Reported

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

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

Do you want to report abuse regarding "Timer click".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Timer Click

Timer Click

Front and back view of the Timer Click board

View full image

Library Description

The library covers all the necessary functions to control Timer Click board. Timer click communicates with the target board via I2C protocol. This library contains drivers to write and reads data from DS1682 total elapsed time recorder, the function for set/gets ETC, EC, alarm seconds, for reading/write EEPROM memory, etc.

Key functions:

  • void timer_setETCData( uint32_t etcValue ) - Set elapsed time counter (ETC) data function.
  • void timer_getTime( uint16_t *timeDays, uint8_t *timeHours, uint8_t *timeMinutes, uint8_t *timeSeconds ) - Get elapsed time counter (ETC) time function.
  • void timer_setAlarmSeconds( uint32_t alarmSeconds ) - Set alarm seconds function.

Examples description

The application is composed of three sections:

  • System Initialization - Initializes GPIO, I2C and LOG structures, sets RST pin as output and INT pin as input.
  • Application Initialization -  Initialization driver enables - I2C, soft reset, sets ETC and EC start ( seconds ), hardware reset and start write log.
  • Application Task - (code snippet) This is an example which demonstrates the use of Timer Click board. Timer Click communicates with register via I2C by writing to register and read from the register, display time ( days, hours, minutes and seconds ) which we received reading from the target register address of DS1682 total elapsed time recorder. Results are being sent to the Usart Terminal where you can track their changes. All data logs write on USB uart changes for every 1 sec.
void applicationTask() 
{
    timer_getTime( &timeDays, &timeHours, &timeMinutes, &timeSeconds );
    
    if ( timeSecondsNew != timeSeconds )
    {
        mikrobus_logWrite( " ", _LOG_TEXT );
        displayLogUart( timeDays );
        mikrobus_logWrite( " days ", _LOG_TEXT );

        displayLogUart( timeHours );
        mikrobus_logWrite( ":", _LOG_TEXT );

        displayLogUart( timeMinutes ); 
        mikrobus_logWrite( ":", _LOG_TEXT );

        displayLogUart( timeSeconds );  
        mikrobus_logWrite( "", _LOG_LINE );
        mikrobus_logWrite( "------------------", _LOG_LINE );

        timeSecondsNew = timeSeconds;
    }
    
    Delay_1ms();
}

Additional Functions :

  • void displayLogUart( uint8_t value ) - Write the value of time or date as a two-digit number.

Other mikroE Libraries used in the example:

  • I2C
  • UART​
  • Conversion

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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

Barometer 4 click

0

Barometer 4 Click is a compact add-on board used to measure air pressure in a specific environment. This board features the ICP-10111, a high accuracy low power barometric and temperature sensor from TDK InvenSense. The ICP-10111 is based on MEMS capacitive technology providing ultra-low noise at the lowest power, enabling industry-leading relative accuracy, sensor throughput, and temperature stability. It comes with a configurable host interface that supports I2C serial communication and measures pressure in a range from 30kPa up to 110kPa with an accuracy of ±1Pa over a wide operating temperature range. This Click board™ is suited for various pressure-based applications, especially when low power consumption is required, home appliances such as airflow control in HVAC, water level detection, vertical velocity monitoring, weather forecasting, and many more.

[Learn More]

Flash 8 click

0

Flash 8 Click is a compact add-on board representing a highly reliable memory solution. This board features the GD5F2GQ5UEYIGR, a 2Gb high-density non-volatile memory storage solution for embedded systems from GigaDevice Semiconductor. It is based on an industry-standard NAND Flash memory core, representing an attractive alternative to SPI-NOR and standard parallel NAND Flash with advanced features. The GD5F2GQ5UEYIGR also has advanced security features (8K-Byte OTP region), software/hardware write protection, can withstand many write cycles (minimum 100k), and has a data retention period greater than ten years.

[Learn More]

Thermo 9 Click

5

Thermo 9 Click is a Click board equipped with the TSYS01, a digital temperature sensor from TE Connectivity. Given its main features, the Thermo 9 Click, can be used for industrial control, replacement of thermistors and NTCs, heating/cooling systems, and HVAC.

[Learn More]