Building a timer?

Thread Starter

toeykq

Joined Apr 17, 2014
10
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?
 

MrChips

Joined Oct 2, 2009
30,795
Bear in mind that designing and building a digital timer is an early stage exercise in an introductory course in digital electronics.
 

Alec_t

Joined Sep 17, 2013
14,313
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.
 

Thread Starter

toeykq

Joined Apr 17, 2014
10
hi,
We would need to know the longest time the timer has to run and what accuracy.?
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.

Bear in mind that designing and building a digital timer is an early stage exercise in an introductory course in digital electronics.
It's introductory but we are lost nevertheless.

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.
It's part of something we need for a project.
 

ericgibbs

Joined Jan 29, 2010
18,845
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.
Why do you think the count will be lost when the Stop button is pressed.?
 

MrChips

Joined Oct 2, 2009
30,795
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...?
 

Thread Starter

toeykq

Joined Apr 17, 2014
10
Why do you think the count will be lost when the Stop button is pressed.?
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.
 

wayneh

Joined Sep 9, 2010
17,498
It's part of something we need for a project.
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.
 

shteii01

Joined Feb 19, 2010
4,644
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.
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.
 

shteii01

Joined Feb 19, 2010
4,644
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.
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.
 
Top