TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (351 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 (136656 times)
  2. FAT32 Library (69880 times)
  3. Network Ethernet Library (55907 times)
  4. USB Device Library (46246 times)
  5. Network WiFi Library (41880 times)
  6. FT800 Library (41120 times)
  7. GSM click (28970 times)
  8. PID Library (26404 times)
  9. mikroSDK (26336 times)
  10. microSD click (25347 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: 4418 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

1-Wire Switch click

0

1-Wire Switch Click is a compact add-on board that allows you to switch a device remotely using a 1-wire signal. This board features the DS2413, a dual-channel programmable I/O 1-Wire switch from Analog Devices.

[Learn More]

DALI 3.3V click - Example

1

This example demonstrates use of DALI protocol for controlling leds on board. There are two DALI click cards which allow protocol communication.

[Learn More]

AMR Current click

5

The AMR Current Click is a Click board which features the MCR1101-20-5, an AMR based integrated current sensor from ACEINNA.

[Learn More]