Shop OBEX P1 Docs P2 Docs Learn Events
Calculating Pause — Parallax Forums

Calculating Pause

JohnBFJohnBF Posts: 107
edited 2007-03-25 03:56 in Propeller 1
The BS2_Functions Pause routine subracts 2300 from each result. Is this to account for·the time of instructions to run? Which instructions? How is the figure 2300 calculated? I'd love to understand this better if someone can explain. Thanks!

/John

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-25 03:31
    At that point in the calculation, the value is in "clock ticks". For a system clock of 80MHz, that's 12.5ns per tick or maybe 28us. I'm not sure how that exact number was chosen, but it takes a few microseconds to add that number to CNT and perform a WAITCNT() on the result and this delay guarantees that the resulting time is only a few clock ticks in the future rather than 2^32+ clock ticks away.
  • JohnBFJohnBF Posts: 107
    edited 2007-03-25 03:56
    Thanks. /John
Sign In or Register to comment.