Setting more decimal places in XTAL frequency

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I need to measure the precise time of an event.
I've got a crystal @ 14.745600MHz and the AVR studio always approximates the value to 14.75MHz.
Can I set the value to 14.745600MHz?

There are pointy haired bald people.
Time flies when you have a bad prescaler selected.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Are you talking about the Stopwatch functionality in the simulator? That's the only thing Studio uses the clock frequency setting for. But as the same panel that shows the stop watch also shows the cycle count then you should be able to calculate it yourself. All the Stopwatch does is to multiple the instruction period by the number of cycles anyway.

By the way, if you enter 14.7456MHz then it's true that the dialog rounds this to 14.75 but notice the "Processor" panel of the simulator DOES show 14.7456MHz - so it's just the dialog that's incorrect it seems. As such the Stopwatch probably IS right anyway. As I single step it's incrementing 0.07us at a time. By my caculation the cycle time of 14.7456M is 67.8168ns so, given display rounding errors again, 0.07us sounds right.

Cliff