2

In the question: Very accurate time measurement, Rocketmagnet show a circuit that is exactly what I need for a cub scout pinewood derby race track timer. I want to be able to dedicate a timer to each event and get accurate times for each event to +/- 100 ns.

I have not designed, built or programmed any real time control circuits / computer systems in 15 years and need a set of suggestions on where to start, what tools I need and preferably a suggestion for an eval board that I can use to start with. I can learn the newer RT programming compilers, debuggers and tools and implement any sensor circuits but need a starting point to pick the correct MCU.

Any help in getting started is appreciated.

sbardash
  • 21
  • 2
  • You want an MCU that can latch the current timer value upon pin change. ATtiny2313 supports that with Input Capture. The program/interrupt latency no longer matters as it reads the latched value. I use it for timing at 50ns resolution (20MHz system clock). – jippie Jul 12 '13 at 20:21
  • The pic 12f617 would almost work. It has a timer gate on a 16 bit timer. It clocks up to 20MHz for 5 MIPS, which would give you 200 nsec resolution. That said, it's 8 pins, cost less than a buck in quants of 10, and is available in DIP if you need it. – Scott Seidman Jul 12 '13 at 21:26
  • 1
    A race track timer with 100ns resolution? – Andy aka Jul 12 '13 at 21:31
  • Yes 100ns resolution. This would allow for rounding to .001 seconds and make sure that the numbers were beyond doubt (you would be surprised how excited 2 parents get when the time shows the same for 2 cars but one is declared the winner). I have a track for testing and can put in place all the electronics and a dedicated PC to do the math and formatting from the timer information. – sbardash Jul 12 '13 at 22:16
  • 1
    100 ns is very small. Don't you mean 100 us (which would be enough for your need)? – Renan Jul 12 '13 at 23:59

1 Answers1

1

My suggestion on where to start is by understanding time and the fractions that time is usually broken down into. Your answer to my comment about the real need for 100ns resolution is this: -

Yes 100ns resolution. This would allow for rounding to .001 seconds and make sure that the numbers were beyond doubt (you would be surprised how excited 2 parents get when the time shows the same for 2 cars but one is declared the winner). I have a track for testing and can put in place all the electronics and a dedicated PC to do the math and formatting from the timer information

  • 1 whole second is 1000 milliseconds
  • 1 millisecond is 1000 microseconds
  • 1 microsecond is 1000 nano seconds

100ns is 0.0000001 seconds - you want 100 micro second resolution and may I also suggest you buy a modern calculator.

Andy aka
  • 434,556
  • 28
  • 351
  • 777
  • You are absolutely right. My mistake. I am looking for accuracy to 1 microsecond for 6 timers simultaneously. I'm so used to dealing in nanoseconds I missed my mark by ten to the third. So far, I am just looking for some help in picking the correct PSoC from Cypress that will let me implement the circuit the Rocketmagnet has shown in the mentioned article. Again, my apologies for my bad math. – sbardash Jul 13 '13 at 14:35
  • if you are looking to round to 0.001 seconds (1 millisecond) then you need a resolution no "tighter" than one-tenth of this i.e. 100 microseconds and not 1 microsecond. Don't make things hard for yourself sbardash – Andy aka Jul 13 '13 at 14:39
  • In the previous answer I ment to type 100 microseconds not 1 microsecond. – sbardash Jul 13 '13 at 14:40
  • 1
    @sbardash Ah those pesky decimal places LOL. Anything else in the question you need help on? – Andy aka Jul 13 '13 at 14:43
  • A few tips for picking a PSoC are listed at ["Which PSoC to use"](http://en.wikibooks.org/wiki/Embedded_Systems/Cypress_PSoC_Microcontroller#Which_PSoC_to_use) at Wikibooks. – davidcary Jul 13 '13 at 16:34
  • Andy, you helped and asked so here goes.... I think after reading about the PSoC and which one to use I want to purchase the PSoC1 eval board and an additional CYKIT-008 for the CY8C29466 processor. This should give me 4 different SoC's and plenty of choices for digital modules. I want to implement 6 timers that can be started at the same time and be stopped by an external trigger. Some of the other projects I want to build can also be done with this kit and one of the other SoC personality modules. It also seems that the interface and programming is well defined and explained. Thanks! – sbardash Jul 13 '13 at 21:05
  • @sbardash good luck with your projects dude. – Andy aka Jul 13 '13 at 23:41