time for PBP statements


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2006
    Posts
    14

    Default time for PBP statements

    Should it be possible to know how much time or clock cycles needs PicBasic Pro compiler to execute every of its statements? I'm specially interested in If..Then..else, High, Low, While ..Wen and For..Next and GoTo
    -Francesc

  2. #2
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Hi Francesc,

    Here is your answer.

    Check this post.

    http://www.picbasic.co.uk/forum/show...ghlight=timer1



    -----------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  3. #3
    Join Date
    Mar 2006
    Posts
    14


    Did you find this post helpful? Yes | No

    Default time for PBP statements

    Thanks for your answer Sayzer but the thread explains how to measure time elapsed between sentences in a program and what I 'm interested in is to know when programming with Basic how many cycles it takes for every statement I write.
    -Francesc

  4. #4
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Francesc,

    You might try this include file I was working on and haven't gotten a chance to post. It should be self explianatory (assuming you are carefully reading your PICs datasheet and the PBP manual.

    CodeTimer

    HTH,
    Steve B

  5. #5
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fnovau
    Thanks for your answer Sayzer but the thread explains how to measure time elapsed between sentences in a program and what I 'm interested in is to know when programming with Basic how many cycles it takes for every statement I write.
    -Francesc

    Ok, I see.

    But, my curiosity, why would you need to know that information?
    A kind of HW or what?


    ----------------------------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fnovau
    Thanks for your answer Sayzer but the thread explains how to measure time elapsed between sentences in a program and what I 'm interested in is to know when programming with Basic how many cycles it takes for every statement I write.
    -Francesc
    Impossible to know uneless you measure every single statement or a block of.

    How many different IF-THEN-ELSE combination exist?
    How many different HSERIN combination exist?
    How many different LCDOUT combination exist?
    ....
    nobody can answer that. So you need to measure everything. Using a internal Timer or an i/o and a scope.

    Now if you add some interupts in the chain... it's quite impossible to know uneless you sim every conditions... good luck!
    Steve

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

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by fnovau
    Thanks for your answer Sayzer but the thread explains how to measure time elapsed between sentences in a program and what I 'm interested in is to know when programming with Basic how many cycles it takes for every statement I write.
    -Francesc
    You should take a look at the program SteveB showed in Post# 4.

    It's a great little program that can tie in with "ON DEBUG", and will show the exact time of each individual line of code in your program. It's pretty cool.
    <br>
    DT

Similar Threads

  1. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  2. I don't understand this code!
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 13th February 2008, 02:55
  3. Measuring time
    By AugustoPedrone in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 30th July 2007, 23:46
  4. Serout2/serin2 Pbp Problem
    By SOMRU in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th December 2006, 19:55
  5. Timer in real time
    By martarse in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 29th July 2005, 14: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