??? 07/08/08 04:25 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#156506 - Measure Any Code Timing Responding to: ???'s previous message |
The tried and true way to do this is to find a spare output port pin and use it as a timing signal. Locate the particular function you want to measure and at the beginning set this port pin to a "1". At the end of the function set the port pin back to a "0". Next connect the pin to an oscilloscope and measure the high time width of the port pin. This tells you how long the routine took to execute. If you want to include the call/return overhead in the measurement then place the port bit set and clear instructions before and after the CALL/ACALL instruction instead of inside the routine itself.
By the way this technique is language agnostic. Works in C, Assembler, Pascal or any other language for the MCU that supports access to the I/O port registers. Michael Karas |
Topic | Author | Date |
Function execution time in 'C' | 01/01/70 00:00 | |
Measure Any Code Timing | 01/01/70 00:00 | |
Delay functions in 'C' | 01/01/70 00:00 | |
Not a single value? | 01/01/70 00:00 | |
try disassembling![]() | 01/01/70 00:00 |