TOP Contributors

  1. MIKROE (2642 codes)
  2. Alcides Ramos (347 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 (136222 times)
  2. FAT32 Library (69487 times)
  3. Network Ethernet Library (55706 times)
  4. USB Device Library (45992 times)
  5. Network WiFi Library (41639 times)
  6. FT800 Library (40784 times)
  7. GSM click (28788 times)
  8. PID Library (26332 times)
  9. mikroSDK (26054 times)
  10. microSD click (25141 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: 4353 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

TMR Angle click

0

TMR Angle Click is a Click board perfectly suited for developing applications that range from steering angle applications with the highest functional safety requirements to motors for wipers, pumps and actuators and electric motors in general.

[Learn More]

POT click

0

POT Click is a Click board™ with the accurate selectable reference voltage output. By employing a high-quality 10mm carbon potentiometer, this Click board™ can provide very accurate voltage output.

[Learn More]

Air quality 3 click

0

Air quality 3 click is the air quality measurement device, which is able to output both equivalent CO2 levels and total volatile organic compounds (TVOC) concentration in the indoor environment.

[Learn More]