Extremely precise value recording

Hello - I'm creating a pan/tilt camera system that has an option for recording user input and playing it back (a motion-control setup). I've finally realized that I can't get a computer to do the recording as computer sleep is not accurate enough.

I am looking into using a programmable interval timer that sends an interrupt pulse every millisecond in order to have a precisely accurate record and playback mechanism. Any suggestions?

Thanks!

Any suggestions?

Any details?

Yes, details indeed:

Can you handle any jitter in the signal?
How wide a pulse? High or Low?
What voltage levels?
What rise/fall times?
How much current needs to sourced/sinked?
How much variability?

I suppose I was not clear enough with my question. I'm not worried about recording values from my input devices. I can do that much.

I'm worried about getting a precisely timed alarm with very little variance. I need SOMETHING to interrupt the arduino to record a value. I would like this interrupt to happen every millisecond. Perhaps precise to +/- 10 microseconds? Drift is not preferable.

What about this:

http://www.arduino.cc/playground/Main/MsTimer2

An Arduino with a crystal should have an accuracy of a few seconds over the course of the day. You need more accuracy than that?

Why mess with timers? Why not just poll your inputs constantly and record input changes (with time deltas) when they occur? An interrupt or timer library isn't going to give you any better accuracy than that.

Good to know about the accuracy.

As for not using the timers, that's a fair idea but I actually need it to be sampled at a set interval of 1ms so that I have the ability to be pulse-synced with a shutter on a camera.

How about an RTC then, get the benefit of having time available too.
Part like DS1307 has a square wave output that can be used to trigger interrupts.
Crystal driven so its pretty precise too.
You need 1000Hz, take the 4 KHz and divide down by four - or just program to ignore 3 of them.
Pick one up here to play with
http://www.dipmicro.com/store/DS1307N
http://www.dipmicro.com/store/XC4-32768
http://datasheets.maxim-ic.com/en/ds/DS1307.pdf
http://www.dipmicro.com/store/BH120591-1
http://www.dipmicro.com/store/BAT-CR2032
and three 10K pullup resistors
Maybe a 7474 type flip flop for a divide by 4 circuit too?

Just avoid taking readings when millis() hasn't incremented.

unsigned long lastmillis = 0;

void loop() {
  if (millis() > lastmillis) {
     lastmillis = millis();
  } else {
     return; // goes back to start of loop()
  }

  // take readings here
}