millisecond precision stopwatch

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
eestevao
 
Posts: 2
Joined: Fri Apr 29, 2016 3:55 pm

millisecond precision stopwatch

Post by eestevao »

Hi , first of all sorry if its in the wrong place, it seems the correct place but i could be wrong.

I'm trying to build a stopwatch, that will do the following
Subject 1 press a button and the arduino start the stop watch.
After a few seconds, minutes on 1 hour tops, the Subject 2 touch a pad.

I need the elapsed time between the start and the touch. An result like 10.321 ( like 10 seconds and 321ms)
From what i read i could use millis() from arduino but it seems to have a 1.024ms precision and that could leak a mistake pehaps, so i come across 2 possibilities.
1 - Use another crystal (heard abour ttl gen being better precise)
2 - Chronodot from adafruit could be useful in this case?

There others possibilities?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: millisecond precision stopwatch

Post by adafruit_support_rick »

I *think* the millis() function is actually 1.000ms. I haven't looked lately, but that's what I remember. Anyway, the Arduino clock is not particularly accurate, so you don't want to use millis().

You can use a chronodot. Connect the SQW output to an interrupt pin. Increment your time in the interrupt service routine.

User avatar
eestevao
 
Posts: 2
Joined: Fri Apr 29, 2016 3:55 pm

Re: millisecond precision stopwatch

Post by eestevao »

thanks for the answer, but just to confirm. With chronodot i can get millisecond right? and its acurrate? and about the acurracy, its like seconds on a day error rate?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: millisecond precision stopwatch

Post by adafruit_support_rick »

Wait - sorry. I don't know what I was thinking. The chronodot SQW output is on a 1 second interval. You'll have to use millis(). You can keep the Arduino clock synced with the chronodot for more accuracy. The Time library will do that for you.

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”