Author Topic: Error from 16 bit timer capture  (Read 1138 times)

0 Members and 1 Guest are viewing this topic.

Offline airman00Topic starter

  • Contest Winner
  • Supreme Robot
  • ****
  • Posts: 3,653
  • Helpful? 21
  • narobo.com
Error from 16 bit timer capture
« on: April 14, 2009, 12:15:37 PM »
How can I figure out how much percent error I should expect from a 16 bit timer capture ?
I'll be using an AVR microcontroller running at 20MHz with a clock rate of 50nS.

Any links or info would be helpful.
Thanks
Check out the Roboduino, Arduino-compatible board!


Link: http://curiousinventor.com/kits/roboduino

www.Narobo.com

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,072
  • Helpful? 107
Re: Error from 16 bit timer capture
« Reply #1 on: April 18, 2009, 11:59:00 AM »
Not quite sure what you mean by percentage error - percentage of what? 

If you are using the timer in input capture mode then when the input changes the timer value in TCNT is latched into the input capture register ICR. It will sit here unchanged until you read it. Since this is happening in hardware it should not be effected by interrupts. That is why atmel recommend using ICR for things like measuring frequencies and duty cycles.
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,586
  • Helpful? 169
    • Society of Robots
Re: Error from 16 bit timer capture
« Reply #2 on: May 27, 2009, 07:03:17 PM »
I think he means % accuracy of an event he is trying to measure. For example, can he measure a 10ns event with with a 16 bit timer at 20MHz.

airman00, you should link the other post that solves the problem to here ;D

 

Related Topics

  Subject / Started by Replies Last post
13 Replies
6606 Views
Last post July 17, 2008, 09:54:57 AM
by pomprocker
24 Replies
5183 Views
Last post September 19, 2007, 05:39:01 PM
by HDL_CinC_Dragon
2 Replies
3543 Views
Last post May 29, 2009, 07:21:15 AM
by Tazdevil
17 Replies
1689 Views
Last post August 28, 2010, 04:43:34 AM
by voyager2


Get Your Ad Here