Shop OBEX P1 Docs P2 Docs Learn Events
High resolution timer — Parallax Forums

High resolution timer

MziskindMziskind Posts: 9
edited 2005-08-15 04:00 in BASIC Stamp
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

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-08-12 16:29
    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
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-08-12 17:40
    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_samsam_sam_sam Posts: 2,286
    edited 2005-08-14 15:13
    ·HI Jon
    How would i start and·stop·the timer
    could you some code for that

    Thanks

    samsam
  • Philip GamblinPhilip Gamblin Posts: 202
    edited 2005-08-14 18:38
    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 WilliamsJon Williams Posts: 6,491
    edited 2005-08-15 04:00
    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
Sign In or Register to comment.