PDA

View Full Version : Time & Simulation



weirdjim
- 16th August 2007, 17:55
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

Darrel Taylor
- 16th August 2007, 18:45
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