Go Back   PICAXE Forum > Finished User PICAXE Projects > User Projects - Miscellaneous
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
Links: PICAXE Website PICAXE Manual Datasheets Online Store Software & Drivers

Reply
 
Thread Tools Display Modes
Old 07-02-2010, 22:45   #1
hippy
Technical Support
 
Join Date: Jan 1970
Location: UK
Posts: 13,554
Lightbulb High Accuracy Timer

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 :-)
Attached Files
File Type: txt 20X2-Timer-HighAccuracy.txt (23.5 KB, 164 views)
hippy is offline   Reply With Quote
Old 08-02-2010, 07:14   #2
BeanieBots
Moderator
 
Join Date: Jan 1970
Location: UK South Coast
Posts: 7,852
Default

Useful, thanks.
BeanieBots is offline   Reply With Quote
Old 04-06-2010, 13:28   #3
andyshrimpton
New Member
 
Join Date: May 2009
Location: surrey
Posts: 24
Default Could this be used as a stop watch

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.
andyshrimpton is offline   Reply With Quote
Old 04-06-2010, 14:36   #4
hippy
Technical Support
 
Join Date: Jan 1970
Location: UK
Posts: 13,554
Default

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.
hippy is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 16:21.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
(c) Revolution Education Ltd 2007