MikroElektronika
TIMER click
TIMER click
SKU:MIKROE-2333
Couldn't load pickup availability
Share
Timer click is a mikroBUS™ add-on board with Maxim’s DS1682 total elapsed time recorder. The main feature of the IC is its elapsed time counter (ETC) used in conjunction with the ALARM pin. Whenever the EVENT pin is held high, the ETC will track time in quarter second resolution. Once the EVENT pin is set to logic low, the time data will be written in the IC’s non volatile EEPROM. The next time the EVENT pin is pulled high, the timer will pick up where it left and continue measuring accumulated time. The upper limit is 34 years. In practical applications, the ALARM pin will be utilized to set off a flag once a certain threshold of accumulated time is reached. The alarm flag is one time programmable. The board communicates with the target MCU through the mikroBUS™ I2C interface, with two additional pins: ALARM (in place of default INT) and EVENT (in place of RST). Designed to use either a 3.3V or a 5V power supply only.
Specification
Type | RTC |
Applications | Warranty tracking or other systems where time-of-use is of importance |
On-board modules | Maxim’s DS1682 |
Key Features | 32-bit nonvolatile elapsed time counter, I2C interface with additional pins for alarms and events |
Key Benefits | Records total elapsed time without backup power supply, Resilient against high temperatures and vibration |
Interface | GPIO,I2C |
Input Voltage | 3.3V or 5V |
Compatibility | mikroBUS |
Click board size | S (28.6 x 25.4 mm) |
Features and usage notes
Here’s a description of individual pins from the DS1682 IC, taken from the official data sheet. Each of these is accessible through the mikroBUS™ pin
EVENT Event Input. The EVENT pin is the input the DS1682 monitors to determine when an event occurs. When the pin is pulled high, the contents of the EEPROM are transferred to the ETC and the oscillator starts. The ETC begins to count in quarter-second increments. When the EVENT pin falls to logic 0, the event counter increments, and the event counter, ETC, and user-memory data are stored in the EEPROM array. When the EVENT pin changes states, the 2-wire bus is unavailable for communications for tEW (falling) and tER (rising). The EVENT input is also deglitched (tG) to prevent short noise spikes from triggering an event.
ALARM Active-Low Alarm Output. The DS1682 monitors the values in the ETC for the programmed value in the alarm register. When the ETC matches the alarm value, the alarm flag (AF) is set. Once set, the alarm flag cannot be reset. See the operating descriptions for the AOS and AP bits for details about the operation of the ALARM pin.
SCL 2-Wire Serial-Clock Input. The SCL pin is the serial-clock input for the 2-wire synchronous communications channel. The SCL pin is an input that requires an external pullup resistor.
SDA 2-Wire Input/Output. The SDA pin is the data input/output signal for the 2-wire synchronous communications channel. The SDA pin is an open-drain I/O, which requires an external pullup resistor.
N.C. No Connection. These pins are not connected internally.
Vcc +2.5V to +5.5V Input Supply
To switch between 3.3V and 5V power supplies, use the onboard jumper.
Programming
Code snippet demonstrates how the Timer click counts the elapsed time, as well as the number of events on the EVT pin
1 //TIMER click on socket 1 2 3 #include "timer_hw.h" 4 5 //#define CountFromZero 6 7 // TFT module connections 8 unsigned int TFT_DataPort at GPIOE_ODR; 9 sbit TFT_RST at GPIOE_ODR.B8; 10 sbit TFT_RS at GPIOE_ODR.B12; 11 sbit TFT_CS at GPIOE_ODR.B15; 12 sbit TFT_RD at GPIOE_ODR.B10; 13 sbit TFT_WR at GPIOE_ODR.B11; 14 sbit TFT_BLED at GPIOE_ODR.B9; 15 // End TFT module connections 16 17 sbit TIMER_EVT at GPIOD_ODR.B1; 18 sbit TIMER_ALM at GPIOC_IDR.B1; 19 20 char text[24]; 21 unsigned long ETC; //elapsed time counter 22 unsigned int EC; 23 24 void Display_Init(){ 25 TFT_Init_ILI9341_8bit(320, 240); 26 TFT_BLED = 1; 27 TFT_Set_Pen(CL_AQUA, 1); 28 TFT_Fill_Screen(CL_AQUA); 29 TFT_Set_Font(TFT_defaultFont, CL_BLACK, FO_HORIZONTAL); 30 TFT_Set_Pen(CL_AQUA, 1); 31 32 TFT_Set_Brush(1, CL_AQUA, 0, LEFT_TO_RIGHT, CL_AQUA, CL_AQUA); 33 34 TFT_Write_Text("Event count: ",10,10); 35 TFT_Write_Text("Time count: ",10,50); 36 } 37 38 void MCU_Init() { 39 GPIO_Digital_Output(&GPIOD_BASE, _GPIO_PINMASK_1); 40 GPIO_Digital_Input(&GPIOC_BASE, _GPIO_PINMASK_1); 41 TIMER_EVT = 1; 42 I2C1_Init_Advanced(400000, &_GPIO_MODULE_I2C1_PB67); 43 delay_ms(200); 44 } 45 46 void main() { 47 MCU_Init(); 48 timer_hal_init(DS1682_I2C_Adr); 49 Display_Init(); 50 #ifdef CountFromZero 51 timer_set_ec_value(0); 52 timer_set_etc_value(0); 53 TIMER_EVT = 0; 54 delay_ms(100); 55 TIMER_EVT = 1; 56 delay_ms(100); 57 #endif 58 while(1) { 59 delay_ms(2000); 60 TFT_Rectangle(100,10,200,40); 61 TFT_Rectangle(80,50,200,80); 62 //Event counter 63 EC = timer_Get_ec_Value(); 64 WordToStr(EC,text); 65 TFT_Write_Text(text,100,10); 66 //Time counter - in quarter seconds 67 ETC = timer_get_etc_value(); 68 LongWordToStr(ETC,text); 69 TFT_Write_Text(text,100,50); 70 } 71 72 }
Code examples that demonstrate the usage of Timer click with MikroElektronika hardware, written for mikroC for ARM, FT90x, and PIC are available on Libstock




New Products
-
Sold out
OAK-FFC IMX577 M12
Vendor:POLOLURegular price Rs. 8,499.00Regular priceUnit price / perSold out -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 20A
Vendor:POLOLURegular price Rs. 329.00Regular priceUnit price / perSold out -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 25A
Vendor:POLOLURegular price Rs. 439.00Regular priceUnit price / perSold out -
Pololu I²C Isolator, ISO1640
Vendor:POLOLURegular price Rs. 449.00Regular priceUnit price / per -
3pi+ 32U4 OLED Robot Kit with 30:1 MP Motors (Standard Edition Kit)
Vendor:POLOLURegular price Rs. 15,549.00Regular priceUnit price / per -
Conductivity Calibration K 1.0 Set (4 pouches)
Vendor:Atlas ScientificRegular price Rs. 1,599.00Regular priceUnit price / perSold out -
Analog Discovery 3 Pro Bundle
Vendor:DigilentRegular price Rs. 42,569.00Regular priceUnit price / per -
Lighthouse swarm bundle - Crazyflie 2.1+ (250mAh batteries)
Vendor:BitcrazeRegular price Rs. 474,999.00Regular priceUnit price / perSold out -
Loco Swarm bundle - Crazyflie 2.1+ (250mAh batteries)
Vendor:BitcrazeRegular price Rs. 544,999.00Regular priceUnit price / perSold out -
Kopis X8 Cinelifter 5" Kit - Caged (Frame Kit)
Vendor:HolybroRegular price Rs. 28,199.00Regular priceUnit price / per -
Atlas Scientific i3 InterLink
Vendor:Atlas ScientificRegular price Rs. 6,349.00Regular priceUnit price / per -
Sold out
PoE Injector
Vendor:LuxonisRegular price Rs. 2,099.00Regular priceUnit price / perSold out -
Sold out
1-Port VINT Hub Phidget
Vendor:PhidgetsRegular price Rs. 2,699.00Regular priceUnit price / perSold out -
Holybro 1045 Propeller 2 Pair CW+CCW-Black
Vendor:HolybroRegular price Rs. 1,549.00Regular priceUnit price / per -
ACS37220LEZATR-100B3 Current Sensor Large Carrier -100A to +100A, 3.3V
Vendor:POLOLURegular price Rs. 829.00Regular priceUnit price / per -
CT433-HSWF50MR TMR Current Sensor Compact Carrier -50A to +50A, 3.3V
Vendor:POLOLURegular price Rs. 1,039.00Regular priceUnit price / per -
A5984 Stepper Motor Driver Carrier, Adjustable Current, Blue Edition
Vendor:POLOLURegular price Rs. 409.00Regular priceUnit price / per -
A5984 Stepper Motor Driver Carrier, Fixed 1A@5V / 660mA@3.3V, Blue Edition (Soldered Header Pins)
Vendor:POLOLURegular price Rs. 489.00Regular priceUnit price / per -
A5984 Stepper Motor Driver Carrier, Fixed 500mA@5V / 330mA@3.3V (Soldered Header Pins)
Vendor:POLOLURegular price Rs. 469.00Regular priceUnit price / per -
T Connector Male-Female Pair
Vendor:POLOLURegular price Rs. 169.00Regular priceUnit price / per -
Pololu Reverse Voltage Protector, 4-60V, 10A
Vendor:POLOLURegular price Rs. 159.00Regular priceUnit price / per -
Pololu Reverse Voltage Protector, 4-60V, 12A
Vendor:POLOLURegular price Rs. 199.00Regular priceUnit price / per -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 10A
Vendor:POLOLURegular price Rs. 179.00Regular priceUnit price / perSold out -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 12A
Vendor:POLOLURegular price Rs. 229.00Regular priceUnit price / perSold out -
Pololu Mini Plastic Gearmotor Bracket Pair - Tall
Vendor:POLOLURegular price Rs. 599.00Regular priceUnit price / per