Time Measurement via Arduino Timer

preview_player
Показать описание
ATmega328's Timer 1 is programmed to generate input capture & overflow interrupts to measure the time between two consecutives pulses input at Arduino's pin D8.

Link to code:

Contents:
0:00 Introduction
0:16 Block Diagram of Implemented System
1:28 Time Measurement via TIMER1
3:00 TIMER1 Registers
3:39 C++ Code
5:17 Demonstration
Рекомендации по теме
Комментарии
Автор

Anas, very good, from the continuity of the series on Websocket.

marcosgiovanni
Автор

Another excellent video! This could be used as a single button password lock by using morse code tapping :) Why do you use a prescaler of 1024 in most of your timer videos, would it not be more accurate using a prescaler of 1 running at the chips clock speed.

arnolduk
Автор

Hi Anas, thanks for the video, may I know are u using the extrnal library, because I use ur code to do the testing the library u use cant be recognise. Is it have the library coding

dannysiewziyang
Автор

Hi Anas, thanks for the video, It’s my second day of learning Arduino with zero background, so my question is probably naive, if I have 2 different pwm input connected to the board, how can I tell the timer to measure the time of each separately? Looking at the code no where I see you specify the pin 8, so I assume the timer take whatever pulse it takes and if I have 2 inputs it may not differentiate between the pulses from different pins, am I correct?

emadjafari
Автор

Hi Anas, thanks for the video. I'm looking your video without any Arduino background. I've started my Arduino journey with an ESP32, and I'm trying since several days to implement your example (time measurement via Timer1) on an ESP32 without success. Could you please provide something explaining how to measure the time between two rising edges with the Input Capture Interrupt on ESP32? Thanks

josiasfokam
Автор

How can we measure more than 4 seconds?

kostadinnedev