PDA

View Full Version : High Accuracy Timer



hippy
07-02-2010, 22:45
This is a high accuracy timer which uses a 20X2 to measure the time a gated clock pulse is present. Using 64MHz operating speed it has a timing period in excess of 18 hours, accurate to below 125ns.

The program includes auto-generation of a clock signal using PWMOUT ( up to 8MHz ) which can be gated to the clock input using just a push button. Possibly the most accurate push button timer so far :-)

BeanieBots
08-02-2010, 07:14
Useful, thanks.

andyshrimpton
04-06-2010, 13:28
Hi Hippy

I am newish to this site and have enjoyed learning about pixace.

Your code looks very interesting although its very advanced for me.

I am trying to build a timer (stopwatch) to measure the speed of an object between two points. So would need to measure the time to 0.001 of a second i would think, unless your code goes better than that.

I hope to use to lasers as the switches to start and stop the timer. Setting the laser at a know distance would be vital, though i will practice with infrared to start with.

I am using serial4 x 20 LCD in my first project with work well

My code will then work out the speed in m/s or some other miles/hour etc

I think your code gives me the accurate clock (timer) that i would need.

I have tried your code through the simulate in editor but cant find out how to start and stop the timer.

Any advice would be welcome.

hippy
04-06-2010, 14:36
There are a number of other projects which have dealt with measuring speed as an object passes between two points. A Forum Search will help there, with one thread I could find which will be useful being -

http://www.picaxeforum.co.uk/showthread.php?t=4863

In my code you don't have to really worry about turning the timer on and off, it's more a counter of pulses which only occur when the clock signal is routed through to the timer acting as a counter. You'd use the two timing points to make the connection and then break it, the count during that time is then used to determine the speed.

I am not sure the code will simulate well as it relies on the physical hardware of the chip which the simulator cannot emulate.