A simple and basic question


Closed Thread
Results 1 to 36 of 36

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Wink

    Hi,

    I remember Darrel wrote a little bit of program to measure program parts duration ... a SEARCH through those columns will be welcome.

    The second way is to use MPSIM ( part of MPLAB ) with the stopwatch : result is quite perfect !

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Default

    @20MHz I'm guessing ~3uS per iteration of the loop.

    Trent Jackson

  3. #3
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    I do not understand your answers.

    What you need to take out of this:

    If you loop a variable from zero to 60000 on a pic being driven by a 20Mhz Quartz using the pbp code WHILE without adding a Pauseus XY into the loop, what does this value tell me about the time being elapsed.

  4. #4
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Angry So, was a Stupid question ...

    Quote Originally Posted by Ted's View Post
    I do not understand your answers.

    What you need to take out of this:

    .
    So, WE CANNOT ANSWER YOUR QUESTION ...

    IF A = 0 ... the loop won't be executed ...

    IF A != 0 ... The loop is infinite ...

    so, the loop will last as long as A != 0 ...


    This is what you have to take out of your hasty code snippet ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  5. #5
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    We? Are you schizophrenic?

  6. #6
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Angry

    your answers.
    I only remember having responded ONCE to you ... and I do think no one here can give you a precise time as an answer. ( except Fernand REYNAUD's " a certain time" ... Lol )

    End of File for me ...

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  7. #7


    Did you find this post helpful? Yes | No

    Default

    The best way to get your answer is to compile the code, look at the assembly listing, and compute the time to execute one cycle from that. Then multiply it by the number of cycles the loop is expected to run. You also need to check the PIC assembly code docs to see how long it takes to execute each assembly code. I have done this a lot in order to determine how long my interrupt routines are.

    Also I think some of the comments are about the fact that the code sample you gave may not run the way you expect. "A" is not defined so the WEND duration is unknown. Also, A does not change so it is not a good loop control variable.

    I wonder if someone has written a program that reads assembler files and tags execution times to all the microcode.
    Last edited by falingtrea; - 25th June 2008 at 22:51.
    Tim Barr

  8. #8
    T.Jackson's Avatar
    T.Jackson Guest


    Did you find this post helpful? Yes | No

    Wink

    Quote Originally Posted by Ted's View Post
    We? Are you schizophrenic?
    Don't worry about Alain, he doesn't bite, as long as he takes his meds he's fine. But when he forgets to take them

  9. #9
    Ted's's Avatar
    Ted's Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by T.Jackson View Post
    Don't worry about Alain, he doesn't bite, as long as he takes his meds he's fine. But when he forgets to take them
    Please muzzle him to be sure he won't bite.
    Last edited by Ted's; - 26th June 2008 at 16:36.

Similar Threads

  1. Newb Question...
    By Perrin` in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 2nd January 2009, 21:49
  2. IF question.
    By Steve Matson in forum General
    Replies: 5
    Last Post: - 23rd November 2007, 04:15
  3. Visual Basic 6 question
    By Christopher4187 in forum Off Topic
    Replies: 5
    Last Post: - 3rd July 2006, 14:06
  4. A simple startup question
    By teilhardo in forum General
    Replies: 6
    Last Post: - 7th January 2006, 21:33
  5. simple newb question
    By PICMAN in forum General
    Replies: 13
    Last Post: - 5th February 2005, 03:16

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