Stopwatch

crazynight

Senior Member
Has anyone built a stopwatch/timer which can measure seconds : 10ths : 100ths and willing to share their code or experiance with me. I have searched around and most only seem to measure seconds.

I have decided to take my project back to basics and although it may make the build of the project more complicated I think the programming will be easier and acuracy improved to just build 2 independant stopwatches/timers controlled by 2 picaxe chips and use another to monitor the inputs and then send start/lap/stop commands (via high/low pin changes) to the appropriate stopwatch (picaxe.)

Thanks in advance
 

marzan

Senior Member
Go and read the posts I directed you to when you put up the first post. As I mentioned its a lot easier to use an RTC chip via i2C than to use internal timers. The chip I used is capable of hundredths of a a second it can also be set up with a timer function
To run to 99 seconds. From memory the code was also in the posts. It's the start of the exact project you are attempting.
 

crazynight

Senior Member
Go and read the posts I directed you to when you put up the first post. As I mentioned its a lot easier to use an RTC chip via i2C than to use internal timers. The chip I used is capable of hundredths of a a second it can also be set up with a timer function
To run to 99 seconds. From memory the code was also in the posts. It's the start of the exact project you are attempting.
Totally forgot about that post will get onto that now...Have managed to interface with the old wireless system and now have the start lights working and a red for a false start. Its using all the old kit so far all I have added is the picaxe and cabling.
 

marzan

Senior Member
From memory I was thinking that the picaxe didn't really need to know the time , just display it. Grab it from the RTC, diday it on the 7 seg in a constant loop until an input is tripped for each lane when it would come out if the loop to do whatever eg. Check for crossing fault and turn on a red light. Meanwhile the RTCis still running and not affected by anything else you are doing with the picaxe. Also on the display side of things you can use more than one of them on the same I2Cbus. Just address them differently, so 1 picaxe can run both displays and the RTC on the same bus which only uses 2 pins. Lastly, I was using a 28x2. I wanted to make sure I had plenty of I/Os for whatever I needed to do, and for a couple of dollars extra I would avoid the frustration of" if only I dad a couple offer pins to use".i also wanted to run the picaxe at 64 MHz once it was working for the extra accuracy .
 

crazynight

Senior Member
From memory I was thinking that the picaxe didn't really need to know the time , just display it. Grab it from the RTC, diday it on the 7 seg in a constant loop until an input is tripped for each lane when it would come out if the loop to do whatever eg. Check for crossing fault and turn on a red light. Meanwhile the RTCis still running and not affected by anything else you are doing with the picaxe. Also on the display side of things you can use more than one of them on the same I2Cbus. Just address them differently, so 1 picaxe can run both displays and the RTC on the same bus which only uses 2 pins. Lastly, I was using a 28x2. I wanted to make sure I had plenty of I/Os for whatever I needed to do, and for a couple of dollars extra I would avoid the frustration of" if only I dad a couple offer pins to use".i also wanted to run the picaxe at 64 MHz once it was working for the extra accuracy .
off to buy a PCF8583; although having just purchased 2 8m2's I might give the stop watch idea another ago first for proof of concept as I am still learning, Yes I have 2 x I2c 4 segment displays working fine I do like i2c.

hmm could a 8m2 be programmed to act as a PCF8583......outputting the sec : tenths : hundredths over i2c
 

marzan

Senior Member
That one I will defer to people who know a lot more than me but I would imagine not as accurate as RTC with watch crystal. BTW my code was written to only show tenths of a second so I didn't need another display to show minutes but is easily changed.
 

SAborn

Senior Member
IMO the picaxe is a useless timing device when compared to other add on chips like a RTC that plods along in the background untill its interagated for a time value, the picaxe is a slow micro processor in todays standards, so to palm off any function to a additional chip dedicated for the task is the best way to go in my book.

This allows the picaxe to do what it do best (processing data) at the fastest way it can.
 

marzan

Senior Member
Saborn helped me a lot in Getting my project to where it was before other projects became a priority. It's good to see someone else run with it for a while :)
 

flyingnunrt

Senior Member
@crazynight,
I did a flyball timing unit a couple of years ago.
I had trouble with the LCD display transitioning between 99 to 0 if the interrupt occurred right at that instant.
So I ended up just using an off the shelf stopwatch and used the picaxe to start / stop and reset the watch and run the countdown to green.
I did not complete the crossover detection part but it did have a false start foul light, and then it went into the too hard basket.
We are more into agility / obedience rather than flyball.
I did another unit for timing a 24 pole weave challenge with wireless triggering using 08m's and 18x and multiple IR beams.
DSC00565.JPGDSC00619.JPG
 
Last edited:

crazynight

Senior Member
@crazynight,
I did a flyball timing unit a couple of years ago.
I had trouble with the LCD display transitioning between 99 to 0 if the interrupt occurred right at that instant.
So I ended up just using an off the shelf stopwatch and used the picaxe to start / stop and reset the watch and run the countdown to green.
I did not complete the crossover detection part but it did have a false start foul light, and then it went into the too hard basket.
We are more into agility / obedience rather than flyball.
I did another unit for timing a 12 pole weave challenge with wireless triggering using 08m's and 18x and multiple IR beams.
View attachment 14683View attachment 14684
Will keep you posted am more than happy to share my experiance one its finished.
 

erco

Senior Member
@crazynight: What's the longest timing interval you're measuring? If it's just a few seconds or a minute, and world-class accuracy is not required, you could certainly skip the RTC and use a software timing routine which would deliver reasonable accuracy and relative consistency. The time you save not adding the RTC will go into experimental calibration of your software.

If that path fails to charm you, consider hacking a cheap stopwatch/wristwatch from the dollar (oops, pound) store. It's cheap, straightforward, and already has a working LCD display. It's a matter of replacing (or paralleling) two or three pushbutton switches with transistors or even reed relays so a PicAxe can start, stop, and reset the watch. Simple soldering.

Might even be a viable product idea. I'm not aware that has developed a cheap standalone stopwatch with TTL inputs to control the timing functions. There's my next project for a rainy day.
 
Last edited:

erco

Senior Member
BTW, I asked the seller of that $9 kit in post #16 and it only does whole seconds. His reply:

This module have two LED for hour, minitue and seconds.

So, its precision is 1 second.
 
Top