Time & Simulation


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2007
    Location
    Grass Valley CA
    Posts
    16

    Question Time & Simulation

    Two questions from a nooby ...

    1. How can I either estimate (and a rectorandom estimate is fine) or measure how long it takes my program to execute a loop? That is, if I'm looking at a dozen ports to see if a switch is thrown and then do some other stuff, how do I figure out how often each port will be sampled to see if the switch has been activated?

    2. Is there a program or routine where I can load my program and "build" a circuit (complete with processor, switches, lights, resistors, capacitors, perhaps peripheral memory...) and watch what happens when I press this or that switch?

    Jim

  2. #2
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Several possibilities.
    • Use MPLAB's MPSIM simulator, and use the built in "Stopwatch" to measure the time.<br><br>
    • Toggle an output pin on each loop and use an oscilloscope to measure the time.<br><br>
    • or, try this program...<br>
      Instruction Execution Time
      http://www.picbasic.co.uk/forum/showthread.php?t=365
    DT

Similar Threads

  1. I don't understand this code!
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 13th February 2008, 03:55
  2. Measuring time
    By AugustoPedrone in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st July 2007, 00:46
  3. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 20:55
  4. Alarm Time
    By Santana in forum Code Examples
    Replies: 1
    Last Post: - 8th December 2006, 14:58
  5. Timer in real time
    By martarse in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th July 2005, 15:24

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts