Instruction times


Results 1 to 3 of 3

Threaded View

  1. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Some asm instructions takes 1, some other takes 2 instruction to execute, if you add conditionnal instruction then you mess up everything as they can use 1 OR 2 instructions, hence Code size is not a safe way to evaluate execution speed.

    What you want to use is a internal Timer, MPLAB stopwatch OR toggle a I/O then measure it with a scope.

    Look at the following, for simple code implementations. Note that you'll need to adjust those to suite 20MHz.
    http://www.picbasic.co.uk/forum/show...33&postcount=9
    http://www.picbasic.co.uk/forum/show...9&postcount=13


    For accuracy, you want to use internal timer instead of Pause/PauseUs. This also allow you to do something else in meantime.

    HTH
    Last edited by mister_e; - 5th June 2009 at 10:20.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. 16F628A - Stops if release power switch.
    By dene12 in forum General
    Replies: 16
    Last Post: - 14th February 2009, 08:57
  2. Calling Subroutines Multiple Times
    By Forkosh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th March 2008, 08:11
  3. instruction cycles for math operations
    By Michael Wakileh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th July 2007, 12:03
  4. code size using On Interrupt PBP instruction
    By eduardojx in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st December 2005, 10:57
  5. instruction execution time
    By tjg in forum Code Examples
    Replies: 3
    Last Post: - 21st April 2004, 19:15

Members who have read this thread : 0

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