Shop OBEX P1 Docs P2 Docs Learn Events
Code overhead or loop execution time? — Parallax Forums

Code overhead or loop execution time?

GerryLGerryL Posts: 7
edited 2004-12-31 13:11 in Robotics
·· I'm re-reading portions of chapter 2 & 3 in "Robotics with the Boe-Bot" to be sure I have a good handle on it.· One thing I haven't figured out is how to determine the code overhead or execution time.· For example, on page 89 it says "as given on page 79, code overhead is 1.6ms"·· (oh btw, if anyone is taking notes for corrections; should that be page 83?· I couldn't find anything on pg 79).· On page 82 we've got a lopp that takes about 1.3ms.··Where do·these numbers come from?· Are they just 'givens'·that we use to guestimate for now?
Thanks! -Gerry··

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-31 02:52
    Best measured imperically. You can set a pin high at the start of test section, then take it back low at the end. Use a 'scope or second BASIC Stamp to measure the width of the pulse.

    Dr. Tracy Allen has done a lot of work to determine the execution times of PBASIC instructions on the various BASIC Stamp modules we carry.· His web site (http://www.emesystems.com/BS2index.htm) is worth bookmarking.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • GerryLGerryL Posts: 7
    edited 2004-12-31 03:19
    Jon, thanks for the quick reply/good info. I appreciate it!
    Gerry
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-12-31 13:11
    The 'Ant-8' logic analyzer ($200) is good for this purpose.

    Link: http://www.saelig.com/ANT8.htm

    Post Edited By Moderator (Jon Williams) : 12/31/2004 7:09:17 PM GMT
Sign In or Register to comment.