PDA

View Full Version : High resolution timer



Mziskind
08-13-2005, 12:18 AM
I'm looking for a simple timer circuit to add to a BS2 that would give me hundredths of a second resolution. I'm disappointed that DS1302 returns Integer seconds. Can anyone suggest a chip? Thank you. Martin

Jon Williams
08-13-2005, 12:29 AM
The PCF8583 has a 100ths register -- but it uses I2C and that takes a fair bit of code to implement if you're not running a member of the BS2p family.Ě If you're using a BS2, BS2e, or BS2sx, the I2C template I've attached will give you the core elements to talke to the PCF8583 or any other I2C device.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

allanlane5
08-13-2005, 01:40 AM
You can tell the "Simple Multi-tasking coprocessor" http://www.rhombus-tek.com/co-processors.html
Ěto give you a 50 mSec 'tick'.Ě Count two of those, and you've got your 100 mSec resolution.

It is an 8-pin processor, with included resonator, so it's as accurate as its resonator is.

And a typical BS2 program can do a lot in that 50 mSec without missing a 'tick'.Ě Check it out.
Ě

sam_sam_sam
08-14-2005, 11:13 PM
ĚHI Jon
How would i start andĚstopĚthe timer
could you some code for that

Thanks

samsam

Philip Gamblin
08-15-2005, 02:38 AM
For use as an interval timer you don't have to actually start or stop it, just simply count the ticks from start event to your end event. If on the other hand, you need a real time clock, that's nother story.

Jon Williams
08-15-2005, 12:00 PM
When you want to "start" the timer just clear all the registers; when you want to "stop" timing read them back. The method eliminates real-time capability, but keeps event timing simple.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax