# Building a timer?

Discussion in 'The Projects Forum' started by toeykq, May 1, 2014.

1. ### toeykq Thread Starter New Member

Apr 17, 2014
10
0
A timer or something that can keep track of how much time has elapsed.

For example, a button is pushed. A while later a 2nd button is pushed.

How can the system know how much time has passed?

In what way could this be built?

2. ### ericgibbs AAC Fanatic!

Jan 29, 2010
3,235
565
hi,
We would need to know the longest time the timer has to run and what accuracy.?

3. ### MrChips Moderator

Oct 2, 2009
14,282
4,195
Bear in mind that designing and building a digital timer is an early stage exercise in an introductory course in digital electronics.

4. ### Alec_t AAC Fanatic!

Sep 17, 2013
7,023
1,453
Unless this is just an academic question or a learning experience it would probably be a lot cheaper/quicker to buy one (e.g. cheapo digital watch with stopwatch function, or kitchen timer) than to make one.

5. ### toeykq Thread Starter New Member

Apr 17, 2014
10
0
The longest time?
I'm not sure.
Just some arbitrary amount.
Basically we just want to test the timing between the two button pushes.
If it's very quick, 1st LED will flash.
If it's a little longer, 2nd will flash.
If longest, 3rd will flash.

I figured we could just control how many seconds pass with the speed of the clock, but the logic for the actual timer is what is confusing.

I thought about using a counter chip and sending the various numbers to certain LEDs, but then the counter will reset to 0 and the timing will be lost.

It's introductory but we are lost nevertheless.

It's part of something we need for a project.

6. ### ericgibbs AAC Fanatic!

Jan 29, 2010
3,235
565
Why do you think the count will be lost when the Stop button is pressed.?

7. ### MrChips Moderator

Oct 2, 2009
14,282
4,195
Specifications, specifications, specifications!

How many digits do you want to display, one, two, three... ten?
What are your units, milliseconds, seconds, minutes, hours, days...?
What is your resolution, tenths of seconds, seconds, minutes...?
What is your accuracy, microseconds, milliseconds, seconds...?

8. ### toeykq Thread Starter New Member

Apr 17, 2014
10
0
Because the counter cycles from 0 to 15 indefinitely.

So we would need some way to keep track of how many times the counter has cycled.

I don't know of any way to do that.
I know the borrow pin flashes 0 whenever the counter is at 0, and the borrow pin is high at all other digits.

So we could somehow take advantage of that to use 0 as a marking place for how many times the counter has cycled through, but I don't know how to make the system remember how many times that has happened.

9. ### ericgibbs AAC Fanatic!

Jan 29, 2010
3,235
565
What IF you connected two, 15 counters [ or more ] in series

10. ### wayneh Expert

Sep 9, 2010
13,435
4,273
Why does that prevent you from using a \$5 stopwatch or some other readily available solution?

Even if you cannot find exactly what you want, it would be far easier to hack an existing product.

11. ### shteii01 AAC Fanatic!

Feb 19, 2010
3,922
601
Welcome to Engineering Design.

Having an idea of what you want and having Design Requirements/Parameters/Specifications are two very different things.

So far you have provided us with what is called in the industry "voice of the customer". The customer sort of knows what they want to see, but totally clueless on how make it happen. The trouble is that we are not getting paid to come up with design.

Come up with the requirements/specifications/parameters, then there will be something to talk about.

12. ### shteii01 AAC Fanatic!

Feb 19, 2010
3,922
601
You use another counter to keep track of how many times the main counter has cycled.

Also the fact that you are counting from 0 to 15 tells me that you are looking at 4 bit counter. Like someone asked earlier: What is the highest value you want to count to? What are the time intervals?

My advice. Stop talking, start writing.