TOP Contributors

  1. MIKROE (2745 codes)
  2. Alcides Ramos (371 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (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 (138914 times)
  2. FAT32 Library (71500 times)
  3. Network Ethernet Library (56914 times)
  4. USB Device Library (47269 times)
  5. Network WiFi Library (42993 times)
  6. FT800 Library (42282 times)
  7. GSM click (29724 times)
  8. mikroSDK (27668 times)
  9. PID Library (26828 times)
  10. microSD click (26087 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: 4806 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

Accel 3 click

2

Accel 3 click – board with H3LIS331DL high-g 3-axis digital accelerometer | MikroElektronika Accel 3 click is a mikroBUS add-on board with ST’s H3LIS331DL low-power high-g 3-axis digital accelerometer. The IC has ±100g/±200g/±400g dynamically selectable full scales and outputs 16-bit data at rates from 0.5 Hz to 1 kHz.

[Learn More]

Thermo 2 click

0

THERMO 2 click carries DS1825, a programmable resolution digital thermometer IC with a unique 64-bit address. The click is designed to run on a 3.3V power supply. The board communicates with the target microcontroller through a 1-wire interface. Using the onboard jumper you can select between two outputs: GP1 (default mikroBUS™ AN pin), and GPO (default PWM pin).

[Learn More]

6DOF IMU 23 click

0

6DOF IMU 23 Click is a compact add-on board for precise motion tracking and measurement. This board features the IIM-20670, a high-performance 6-axis MotionTracking device from TDK InvenSense that integrates a 3-axis gyroscope and a 3-axis accelerometer. The gyroscope offers a full-scale range of up to ±1966 dps with high accuracy, while the accelerometer provides a range of ±2g to ±65g. Key features also include a 10MHz SPI interface, shock tolerance up to 10,000 g, on-chip 16-bit ADCs, and low current consumption.

[Learn More]