Shop OBEX P1 Docs P2 Docs Learn Events
Instruction execution time — Parallax Forums

Instruction execution time

ArchiverArchiver Posts: 46,084
edited 2003-02-03 15:01 in General Discussion
Hi
Does any one know how much time does the BS 2 take
between two instructions ?
Thanks


__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-02-01 03:30
    time 'between' 2 instructions?
    I think you mean each instruction. Depends. Some become HUGE asm
    subroutines, while others down to a couple.

    --- In basicstamps@yahoogroups.com, harshit suri <suri_list@y...>
    wrote:
    > Hi
    > Does any one know how much time does the BS 2 take
    > between two instructions ?
    > Thanks
    >
    >
    > __________________________________________________
    > Do you Yahoo!?
    > Yahoo! News - Today's headlines
    > http://news.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-01 03:52
    In a message dated 1/31/2003 7:31:24 PM Pacific Standard Time,
    anode505@y... writes:

    > time 'between' 2 instructions?
    > I think you mean each instruction. Depends. Some become HUGE asm
    > subroutines, while others down to a couple.
    Just as written above the times will be different depending on the
    instructions. One way to find out the time to execute the instructions for
    your particular application is to bracket the unknown time with a pulse and
    read the pulse with an O-scope.

    Example....

    high 6
    your code
    your code
    your code
    low 6

    See how long pin 6 is high....

    >
    > --- In basicstamps@yahoogroups.com, harshit suri <suri_list@y...>
    > wrote:
    > >Hi
    > >Does any one know how much time does the BS 2 take
    > >between two instructions ?
    > >Thanks
    > >
    > >



    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-01 04:05
    http://www.emesys.com/BS2speed.htm


    Original Message

    > > time 'between' 2 instructions?
    > > I think you mean each instruction. Depends. Some become HUGE asm
    > > subroutines, while others down to a couple.
    > Just as written above the times will be different depending on the
    > instructions. One way to find out the time to execute the instructions for
    > your particular application is to bracket the unknown time with a pulse
    and
    > read the pulse with an O-scope.
    >
    > Example....
    >
    > high 6
    > your code
    > your code
    > your code
    > low 6
    >
    > See how long pin 6 is high....

    > > >Does any one know how much time does the BS 2 take
    > > >between two instructions ?
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-01 16:48
    Look at:
    http://www.emesystems.com/BS2speed.htm





    >From: harshit suri <suri_list@y...>
    >Reply-To: basicstamps@yahoogroups.com
    >To: stamp <basicstamps@yahoogroups.com>
    >Subject: [noparse][[/noparse]basicstamps] Instruction execution time
    >Date: Fri, 31 Jan 2003 19:09:49 -0800 (PST)
    >
    >Hi
    >Does any one know how much time does the BS 2 take
    >between two instructions ?
    >Thanks
    >
    >
    >__________________________________________________
    >Do you Yahoo!?
    >Yahoo! News - Today's headlines
    >http://news.yahoo.com
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and
    >Body of the message will be ignored.
    >
    >
    >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


    _________________________________________________________________
    The new MSN 8: smart spam protection and 2 months FREE*
    http://join.msn.com/?page=features/junkmail
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-01 21:49
    Thanks very much everyone

    --- Rodent <daweasel@s...> wrote:
    > http://www.emesys.com/BS2speed.htm
    >
    >
    >
    Original Message
    >
    > > > time 'between' 2 instructions?
    > > > I think you mean each instruction. Depends.
    > Some become HUGE asm
    > > > subroutines, while others down to a couple.
    > > Just as written above the times will be different
    > depending on the
    > > instructions. One way to find out the time to
    > execute the instructions for
    > > your particular application is to bracket the
    > unknown time with a pulse
    > and
    > > read the pulse with an O-scope.
    > >
    > > Example....
    > >
    > > high 6
    > > your code
    > > your code
    > > your code
    > > low 6
    > >
    > > See how long pin 6 is high....
    >
    > > > >Does any one know how much time does the BS 2
    > take
    > > > >between two instructions ?
    >
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do you Yahoo!?
    Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
    http://mailplus.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-02 02:40
    --- Rodent <daweasel@s...> wrote:
    > http://www.emesys.com/BS2speed.htm
    > > > time 'between' 2 instructions?

    Rodent, I was intrigued by your reference to the web
    page, so I checked it out. But I do have a
    question...On there it states:

    Copied text
    For example, in this sequence:

    loop:
    high 1 ' 140 microseconds high
    low 1 ' 140 microseconds low
    high 1 ' 430 microseconds high
    goto loop
    pin P1 stays 140 microseconds high, and then 140
    microseconds low, then 430 microseconds high, and then
    the sequence repeats . One can infer that the low and
    the high instruction each take 140 microseconds to
    execute. And what about the goto? Since high itself
    uses 140 microseconds, we can infer that the goto
    takes 430-140 = 290 microseconds.
    End copied text
    If you are measuring the high/low changes on pin 1,
    then I don't see how that analogy above could be
    correct. Because pin 1 is already "high" at the end
    of the loop, when the program branches back to loop
    again, there will be no change in the state of pin 1
    to gauge from the last "high" statement in the code.
    Based on the first 2 instructions, I would infer that
    the "goto" instruction takes 430-280 = 150
    microseconds, which sounds about right...

    Someone else wanna help me out here? Or is it just
    the fact that I just got home from a 12 hour work day
    and my brain has turned to mush? =)



    =====
    Chris Savage
    Knight Designs
    324 West Main Street
    Montour Falls, NY 14865
    (607) 535-6777

    http://www.knightdesigns.com

    __________________________________________________
    Do you Yahoo!?
    Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
    http://mailplus.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-02 03:10
    I merely provided the link -- I have no ties to the page whatsoever. You
    might email info@e... and see what they say.


    Original Message

    > > http://www.emesys.com/BS2speed.htm
    > > > > time 'between' 2 instructions?
    >
    > Rodent, I was intrigued by your reference to the web
    > page, so I checked it out. But I do have a
    > question...On there it states:
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-02 03:23
    --- Rodent <daweasel@s...> wrote:
    > I merely provided the link -- I have no ties to the
    > page whatsoever. You
    > might email info@e... and see what they
    > say.

    I understand...I was just wondering if you agreed with
    that conclusion...? I think if the second "high"
    statement was taken out, then a more accurate
    calculation could be obtained.

    BTW, I see I'm not the only one up late tonight... =)




    =====
    Chris Savage
    Knight Designs
    324 West Main Street
    Montour Falls, NY 14865
    (607) 535-6777

    http://www.knightdesigns.com

    __________________________________________________
    Do you Yahoo!?
    Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
    http://mailplus.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-02 06:16
    No, late is now. Its 12:15 AM here.

    I've never messed with the timing -- nothing I do with my Stamps is
    time-critical, I just happened to have saved the link from when this subject
    came up about 6 months ago.

    Original Message

    :
    > > I merely provided the link -- I have no ties to the
    > > page whatsoever. You
    > > might email info@e... and see what they
    > > say.
    >
    > I understand...I was just wondering if you agreed with
    > that conclusion...? I think if the second "high"
    > statement was taken out, then a more accurate
    > calculation could be obtained.
    >
    > BTW, I see I'm not the only one up late tonight... =)
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-02 22:53
    Hi Chris, and Rodent,

    Thanks for taking the "time", late at night, to think that through.
    I always appreciate corrections for my web pages. I always surprises
    me when something I have had there for a long time and stared at
    turns out to have a bug byte.

    This one I think is correct in substance, but I messed up the
    exposition. Sometimes I try to combine things that took several
    steps in the experiment into one paragraph.

    The total time taken for the following loop was 710 microseconds:
    loop:
    high 1 '
    low 1 ' 140 microseconds
    high 1 '
    goto loop

    That is measured from one rising edge to the next. That total loop
    time breaks down as follows: time LOW in each cycle is 140
    microseconds and the time HIGH is 570 microseconds.

    I know from this and similar experiments that the time for "high 1"
    and for "low 1" are each 140 microseconds. So 710 - (3*140) =
    710-420 = 290 microseconds for the goto.

    In my explanation I jumped the gun and attributed 140 microseconds to
    the first "high 1", plus 140 microseconds to the "low 1", plus 430
    microseconds to the second "high 1". That also adds up to the total,
    710 microseconds. Your confusion came because you were thinking that
    the 430 microseconds included the "high 1" at the top of the loop,
    but it doesn't.

    To settle it in my own mind, I tested it again. (Ask the Stamp how
    it thinks, don't ask me.) This round (using a BS2e), I came up with
    145 microseconds for the LOW and the HIGH periods, and 285
    microseconds for the "goto". There are small differences from Stamp
    to Stamp because of the tolerance of the resonator. I am depending
    on the calibration of my 'scope timebase and on eyeballing the
    transitions. Steve Parkis made more accurate readings using his
    "time machine" and had come up with 146 microseconds for the HIGH and
    the LOW commands on BS2s he tested.

    I know that later on my web page I list a figure of 245 microseconds
    for the "goto label" command, and that is different from the 285 or
    290 microsecond figure just above. I honestly don't remember why
    there is that discrepancy. It may be a mistake, or it may be due to
    a different method for testing the "goto" timing. For all of the
    BASIC Stamps, the latency is due to the time that it takes for the
    interpreter to read from eeprom the necessary bits to execute the
    command. PBASIC tokens are highly compressed. So the timing can
    depend on exact numerical values, the size of a number or address.

    The point is, if you really depend on the timing, you have to test it yourself!

    I hope that clears up the mud a bit!?

    -- best regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...


    >--- Rodent <daweasel@s...> wrote:
    > > http://www.emesys.com/BS2speed.htm
    >> > > time 'between' 2 instructions?
    >
    >Rodent, I was intrigued by your reference to the web
    >page, so I checked it out. But I do have a
    >question...On there it states:
    >
    >
    Copied text
    >For example, in this sequence:
    >
    >loop:
    >high 1 ' 140 microseconds high
    >low 1 ' 140 microseconds low
    >high 1 ' 430 microseconds high
    >goto loop
    >pin P1 stays 140 microseconds high, and then 140
    >microseconds low, then 430 microseconds high, and then
    >the sequence repeats . One can infer that the low and
    >the high instruction each take 140 microseconds to
    >execute. And what about the goto? Since high itself
    >uses 140 microseconds, we can infer that the goto
    >takes 430-140 = 290 microseconds.
    >
    End copied text
    >If you are measuring the high/low changes on pin 1,
    >then I don't see how that analogy above could be
    >correct. Because pin 1 is already "high" at the end
    >of the loop, when the program branches back to loop
    >again, there will be no change in the state of pin 1
    >to gauge from the last "high" statement in the code.
    >Based on the first 2 instructions, I would infer that
    >the "goto" instruction takes 430-280 = 150
    >microseconds, which sounds about right...
    >
    >Someone else wanna help me out here? Or is it just
    >the fact that I just got home from a 12 hour work day
    >and my brain has turned to mush? =)
    >
    >
    >
    >=====
    >Chris Savage
    >Knight Designs
    >324 West Main Street
    >Montour Falls, NY 14865
    >(607) 535-6777
    >
    >http://www.knightdesigns.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-02 23:42
    --- Tracy Allen <tracy@e...> wrote:
    > Hi Chris, and Rodent,
    > Thanks for taking the "time", late at night, to
    > think that through.
    > I always appreciate corrections for my web pages. I
    > always surprises
    > me when something I have had there for a long time
    > and stared at
    > turns out to have a bug byte.

    Hi Tracy,

    I wanted to first point out that you've proably
    noticed I don't say much in the group here. Running
    my own business has kept me pretty busy the last few
    months and I kinda "skim" through the group postings
    for the interesting stuff.

    When someone posts a link that looks like it might
    have some useful knowledge, I almost ALWAYS check it
    out...I have found so much valuable information that
    way. When I looked at your code example, I was
    thinking logically about the numbers, and the states
    of the pin in the example, and somewhere in the back
    of my mind, something said it didn't jive, and I'm
    sure I over-analyzed it too...But I was hoping someone
    could set me straight on it. I appreciate you redoing
    the test to be sure too.

    I set some projects aside a few months ago when I
    was posting more in the group, and just in that time
    until now I have lost my "groove" (For lack of a
    better word) on some things I was doing with the
    BS2...So now I am paying a bit more attention, I
    think...Anyway, thanks again. Don't mind me being a
    bit winded... =) Still tired from last night!



    >
    > This one I think is correct in substance, but I
    > messed up the
    > exposition. Sometimes I try to combine things that
    > took several
    > steps in the experiment into one paragraph.
    >
    > The total time taken for the following loop was 710
    > microseconds:
    > loop:
    > high 1 '
    > low 1 ' 140 microseconds
    > high 1 '
    > goto loop
    >
    > That is measured from one rising edge to the next.
    > That total loop
    > time breaks down as follows: time LOW in each cycle
    > is 140
    > microseconds and the time HIGH is 570 microseconds.
    >
    > I know from this and similar experiments that the
    > time for "high 1"
    > and for "low 1" are each 140 microseconds. So 710 -
    > (3*140) =
    > 710-420 = 290 microseconds for the goto.
    >
    > In my explanation I jumped the gun and attributed
    > 140 microseconds to
    > the first "high 1", plus 140 microseconds to the
    > "low 1", plus 430
    > microseconds to the second "high 1". That also adds
    > up to the total,
    > 710 microseconds. Your confusion came because you
    > were thinking that
    > the 430 microseconds included the "high 1" at the
    > top of the loop,
    > but it doesn't.
    >
    > To settle it in my own mind, I tested it again.
    > (Ask the Stamp how
    > it thinks, don't ask me.) This round (using a
    > BS2e), I came up with
    > 145 microseconds for the LOW and the HIGH periods,
    > and 285
    > microseconds for the "goto". There are small
    > differences from Stamp
    > to Stamp because of the tolerance of the resonator.
    > I am depending
    > on the calibration of my 'scope timebase and on
    > eyeballing the
    > transitions. Steve Parkis made more accurate
    > readings using his
    > "time machine" and had come up with 146 microseconds
    > for the HIGH and
    > the LOW commands on BS2s he tested.
    >
    > I know that later on my web page I list a figure of
    > 245 microseconds
    > for the "goto label" command, and that is different
    > from the 285 or
    > 290 microsecond figure just above. I honestly don't
    > remember why
    > there is that discrepancy. It may be a mistake, or
    > it may be due to
    > a different method for testing the "goto" timing.
    > For all of the
    > BASIC Stamps, the latency is due to the time that it
    > takes for the
    > interpreter to read from eeprom the necessary bits
    > to execute the
    > command. PBASIC tokens are highly compressed. So the
    > timing can
    > depend on exact numerical values, the size of a
    > number or address.
    >
    > The point is, if you really depend on the timing,
    > you have to test it yourself!
    >
    > I hope that clears up the mud a bit!?
    >
    > -- best regards
    > Tracy Allen
    > electronically monitored ecosystems
    > http://www.emesystems.com
    > mailto:tracy@e...
    >
    >
    > >--- Rodent <daweasel@s...> wrote:
    > > > http://www.emesys.com/BS2speed.htm
    > >> > > time 'between' 2 instructions?
    > >
    > >Rodent, I was intrigued by your reference to the
    > web
    > >page, so I checked it out. But I do have a
    > >question...On there it states:
    > >
    > >
    Copied text
    > >For example, in this sequence:
    > >
    > >loop:
    > >high 1 ' 140 microseconds high
    > >low 1 ' 140 microseconds low
    > >high 1 ' 430 microseconds high
    > >goto loop
    > >pin P1 stays 140 microseconds high, and then 140
    > >microseconds low, then 430 microseconds high, and
    > then
    > >the sequence repeats . One can infer that the low
    > and
    > >the high instruction each take 140 microseconds to
    > >execute. And what about the goto? Since high itself
    > >uses 140 microseconds, we can infer that the goto
    > >takes 430-140 = 290 microseconds.
    > >
    End copied
    > text
    > >If you are measuring the high/low changes on pin 1,
    > >then I don't see how that analogy above could be
    > >correct. Because pin 1 is already "high" at the
    > end
    > >of the loop, when the program branches back to loop
    > >again, there will be no change in the state of pin
    > 1
    > >to gauge from the last "high" statement in the
    > code.
    > >Based on the first 2 instructions, I would infer
    > that
    > >the "goto" instruction takes 430-280 = 150
    > >microseconds, which sounds about right...
    > >
    > >Someone else wanna help me out here? Or is it just
    > >the fact that I just got home from a 12 hour work
    > day
    > >and my brain has turned to mush? =)
    > >
    > >
    > >
    > >=====
    > >Chris Savage
    > >Knight Designs
    > >324 West Main Street
    > >Montour Falls, NY 14865
    > >(607) 535-6777
    > >
    > >http://www.knightdesigns.com
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed.
    > Text in the Subject and Body of the message will be
    > ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    =====
    Chris Savage
    Knight Designs
    324 West Main Street
    Montour Falls, NY 14865
    (607) 535-6777

    http://www.knightdesigns.com

    __________________________________________________
    Do you Yahoo!?
    Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
    http://mailplus.yahoo.com
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-03 13:29
    Are you sure your talking MICROseconds.
    It sure seems that 3/4 of a second is a little slow for that loop.

    Original Message
    From: Tracy Allen [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=qhPBK9HmHbVSBOH43Bzm9UDkYpkBdT_ofBO16--koIa2AYvs28hdvwY8UuWszY0SQ7RE41tHq4tKOk2F]tracy@e...[/url
    Sent: Sunday, February 02, 2003 5:54 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Re: Instruction execution time

    Hi Chris, and Rodent,

    Thanks for taking the "time", late at night, to think that through.
    I always appreciate corrections for my web pages. I always surprises
    me when something I have had there for a long time and stared at
    turns out to have a bug byte.

    This one I think is correct in substance, but I messed up the
    exposition. Sometimes I try to combine things that took several
    steps in the experiment into one paragraph.

    The total time taken for the following loop was 710 microseconds:
    loop:
    high 1 '
    low 1 ' 140 microseconds
    high 1 '
    goto loop

    That is measured from one rising edge to the next. That total loop
    time breaks down as follows: time LOW in each cycle is 140
    microseconds and the time HIGH is 570 microseconds.

    I know from this and similar experiments that the time for "high 1"
    and for "low 1" are each 140 microseconds. So 710 - (3*140) =
    710-420 = 290 microseconds for the goto.

    In my explanation I jumped the gun and attributed 140 microseconds to
    the first "high 1", plus 140 microseconds to the "low 1", plus 430
    microseconds to the second "high 1". That also adds up to the total,
    710 microseconds. Your confusion came because you were thinking that
    the 430 microseconds included the "high 1" at the top of the loop,
    but it doesn't.

    To settle it in my own mind, I tested it again. (Ask the Stamp how
    it thinks, don't ask me.) This round (using a BS2e), I came up with
    145 microseconds for the LOW and the HIGH periods, and 285
    microseconds for the "goto". There are small differences from Stamp
    to Stamp because of the tolerance of the resonator. I am depending
    on the calibration of my 'scope timebase and on eyeballing the
    transitions. Steve Parkis made more accurate readings using his
    "time machine" and had come up with 146 microseconds for the HIGH and
    the LOW commands on BS2s he tested.

    I know that later on my web page I list a figure of 245 microseconds
    for the "goto label" command, and that is different from the 285 or
    290 microsecond figure just above. I honestly don't remember why
    there is that discrepancy. It may be a mistake, or it may be due to
    a different method for testing the "goto" timing. For all of the
    BASIC Stamps, the latency is due to the time that it takes for the
    interpreter to read from eeprom the necessary bits to execute the
    command. PBASIC tokens are highly compressed. So the timing can
    depend on exact numerical values, the size of a number or address.

    The point is, if you really depend on the timing, you have to test it
    yourself!

    I hope that clears up the mud a bit!?

    -- best regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...


    >--- Rodent <daweasel@s...> wrote:
    > > http://www.emesys.com/BS2speed.htm
    >> > > time 'between' 2 instructions?
    >
    >Rodent, I was intrigued by your reference to the web
    >page, so I checked it out. But I do have a
    >question...On there it states:
    >
    >
    Copied text
    >For example, in this sequence:
    >
    >loop:
    >high 1 ' 140 microseconds high
    >low 1 ' 140 microseconds low
    >high 1 ' 430 microseconds high
    >goto loop
    >pin P1 stays 140 microseconds high, and then 140
    >microseconds low, then 430 microseconds high, and then
    >the sequence repeats . One can infer that the low and
    >the high instruction each take 140 microseconds to
    >execute. And what about the goto? Since high itself
    >uses 140 microseconds, we can infer that the goto
    >takes 430-140 = 290 microseconds.
    >
    End copied text
    >If you are measuring the high/low changes on pin 1,
    >then I don't see how that analogy above could be
    >correct. Because pin 1 is already "high" at the end
    >of the loop, when the program branches back to loop
    >again, there will be no change in the state of pin 1
    >to gauge from the last "high" statement in the code.
    >Based on the first 2 instructions, I would infer that
    >the "goto" instruction takes 430-280 = 150
    >microseconds, which sounds about right...
    >
    >Someone else wanna help me out here? Or is it just
    >the fact that I just got home from a 12 hour work day
    >and my brain has turned to mush? =)
    >
    >
    >
    >=====
    >Chris Savage
    >Knight Designs
    >324 West Main Street
    >Montour Falls, NY 14865
    >(607) 535-6777
    >
    >http://www.knightdesigns.com

    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-03 13:36
    Sorry, rethought my statements.
    You know dumb sliderule ( decimal point) errors.
    Original Message
    From: Sadler Porter
    Sent: Monday, February 03, 2003 8:29 AM
    To: basicstamps@yahoogroups.com
    Subject: RE: [noparse][[/noparse]basicstamps] Re: Instruction execution time

    Are you sure your talking MICROseconds.
    It sure seems that 3/4 of a second is a little slow for that loop.

    Original Message
    From: Tracy Allen [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=Rz4sZR7qO0pW060ErYP_mQ3MFKQ1iWGXwMCGgu_L-AnJdoaELCb6DngHgxd_m4NY5awrm4A_4G378A]tracy@e...[/url
    Sent: Sunday, February 02, 2003 5:54 PM
    To: basicstamps@yahoogroups.com
    Subject: Re: [noparse][[/noparse]basicstamps] Re: Instruction execution time

    Hi Chris, and Rodent,

    Thanks for taking the "time", late at night, to think that through.
    I always appreciate corrections for my web pages. I always surprises
    me when something I have had there for a long time and stared at
    turns out to have a bug byte.

    This one I think is correct in substance, but I messed up the
    exposition. Sometimes I try to combine things that took several
    steps in the experiment into one paragraph.

    The total time taken for the following loop was 710 microseconds:
    loop:
    high 1 '
    low 1 ' 140 microseconds
    high 1 '
    goto loop

    That is measured from one rising edge to the next. That total loop
    time breaks down as follows: time LOW in each cycle is 140
    microseconds and the time HIGH is 570 microseconds.

    I know from this and similar experiments that the time for "high 1"
    and for "low 1" are each 140 microseconds. So 710 - (3*140) =
    710-420 = 290 microseconds for the goto.

    In my explanation I jumped the gun and attributed 140 microseconds to
    the first "high 1", plus 140 microseconds to the "low 1", plus 430
    microseconds to the second "high 1". That also adds up to the total,
    710 microseconds. Your confusion came because you were thinking that
    the 430 microseconds included the "high 1" at the top of the loop,
    but it doesn't.

    To settle it in my own mind, I tested it again. (Ask the Stamp how
    it thinks, don't ask me.) This round (using a BS2e), I came up with
    145 microseconds for the LOW and the HIGH periods, and 285
    microseconds for the "goto". There are small differences from Stamp
    to Stamp because of the tolerance of the resonator. I am depending
    on the calibration of my 'scope timebase and on eyeballing the
    transitions. Steve Parkis made more accurate readings using his
    "time machine" and had come up with 146 microseconds for the HIGH and
    the LOW commands on BS2s he tested.

    I know that later on my web page I list a figure of 245 microseconds
    for the "goto label" command, and that is different from the 285 or
    290 microsecond figure just above. I honestly don't remember why
    there is that discrepancy. It may be a mistake, or it may be due to
    a different method for testing the "goto" timing. For all of the
    BASIC Stamps, the latency is due to the time that it takes for the
    interpreter to read from eeprom the necessary bits to execute the
    command. PBASIC tokens are highly compressed. So the timing can
    depend on exact numerical values, the size of a number or address.

    The point is, if you really depend on the timing, you have to test it
    yourself!

    I hope that clears up the mud a bit!?

    -- best regards
    Tracy Allen
    electronically monitored ecosystems
    http://www.emesystems.com
    mailto:tracy@e...


    >--- Rodent <daweasel@s...> wrote:
    > > http://www.emesys.com/BS2speed.htm
    >> > > time 'between' 2 instructions?
    >
    >Rodent, I was intrigued by your reference to the web
    >page, so I checked it out. But I do have a
    >question...On there it states:
    >
    >
    Copied text
    >For example, in this sequence:
    >
    >loop:
    >high 1 ' 140 microseconds high
    >low 1 ' 140 microseconds low
    >high 1 ' 430 microseconds high
    >goto loop
    >pin P1 stays 140 microseconds high, and then 140
    >microseconds low, then 430 microseconds high, and then
    >the sequence repeats . One can infer that the low and
    >the high instruction each take 140 microseconds to
    >execute. And what about the goto? Since high itself
    >uses 140 microseconds, we can infer that the goto
    >takes 430-140 = 290 microseconds.
    >
    End copied text
    >If you are measuring the high/low changes on pin 1,
    >then I don't see how that analogy above could be
    >correct. Because pin 1 is already "high" at the end
    >of the loop, when the program branches back to loop
    >again, there will be no change in the state of pin 1
    >to gauge from the last "high" statement in the code.
    >Based on the first 2 instructions, I would infer that
    >the "goto" instruction takes 430-280 = 150
    >microseconds, which sounds about right...
    >
    >Someone else wanna help me out here? Or is it just
    >the fact that I just got home from a 12 hour work day
    >and my brain has turned to mush? =)
    >
    >
    >
    >=====
    >Chris Savage
    >Knight Designs
    >324 West Main Street
    >Montour Falls, NY 14865
    >(607) 535-6777
    >
    >http://www.knightdesigns.com

    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



    [noparse][[/noparse]Non-text portions of this message have been removed]


    To UNSUBSCRIBE, just send mail to:
    basicstamps-unsubscribe@yahoogroups.com
    from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-03 15:01
    mS = .001 mili
    uS = .000,001 micro


    Original Message
    From: "Sadler Porter" <porter.sadler@s...>
    To: <basicstamps@yahoogroups.com>
    Sent: February 03, 2003 5:29 AM
    Subject: RE: [noparse][[/noparse]basicstamps] Re: Instruction execution time


    : Are you sure your talking MICROseconds.
    : It sure seems that 3/4 of a second is a little slow for that loop.
    :
    :
    Original Message
    : From: Tracy Allen [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=s75H0brFsdimDEnXhC_PtRk2I19LDbWWLH5XnAo_Au8_m423CH5daSrp2ORkO9VUYp3VofGGSn9lgmQi]tracy@e...[/url
    : Sent: Sunday, February 02, 2003 5:54 PM
    : To: basicstamps@yahoogroups.com
    : Subject: Re: [noparse][[/noparse]basicstamps] Re: Instruction execution time
    :
    : Hi Chris, and Rodent,
    :
    : Thanks for taking the "time", late at night, to think that through.
    : I always appreciate corrections for my web pages. I always
    surprises
    : me when something I have had there for a long time and stared at
    : turns out to have a bug byte.
    :
    : This one I think is correct in substance, but I messed up the
    : exposition. Sometimes I try to combine things that took several
    : steps in the experiment into one paragraph.
    :
    : The total time taken for the following loop was 710 microseconds:
    : loop:
    : high 1 '
    : low 1 ' 140 microseconds
    : high 1 '
    : goto loop
    :
    : That is measured from one rising edge to the next. That total loop
    : time breaks down as follows: time LOW in each cycle is 140
    : microseconds and the time HIGH is 570 microseconds.
    :
    : I know from this and similar experiments that the time for "high 1"
    : and for "low 1" are each 140 microseconds. So 710 - (3*140) =
    : 710-420 = 290 microseconds for the goto.
    :
    : In my explanation I jumped the gun and attributed 140 microseconds
    to
    : the first "high 1", plus 140 microseconds to the "low 1", plus 430
    : microseconds to the second "high 1". That also adds up to the total,
    : 710 microseconds. Your confusion came because you were thinking
    that
    : the 430 microseconds included the "high 1" at the top of the loop,
    : but it doesn't.
    :
    : To settle it in my own mind, I tested it again. (Ask the Stamp how
    : it thinks, don't ask me.) This round (using a BS2e), I came up with
    : 145 microseconds for the LOW and the HIGH periods, and 285
    : microseconds for the "goto". There are small differences from Stamp
    : to Stamp because of the tolerance of the resonator. I am depending
    : on the calibration of my 'scope timebase and on eyeballing the
    : transitions. Steve Parkis made more accurate readings using his
    : "time machine" and had come up with 146 microseconds for the HIGH
    and
    : the LOW commands on BS2s he tested.
    :
    : I know that later on my web page I list a figure of 245 microseconds
    : for the "goto label" command, and that is different from the 285 or
    : 290 microsecond figure just above. I honestly don't remember why
    : there is that discrepancy. It may be a mistake, or it may be due to
    : a different method for testing the "goto" timing. For all of the
    : BASIC Stamps, the latency is due to the time that it takes for the
    : interpreter to read from eeprom the necessary bits to execute the
    : command. PBASIC tokens are highly compressed. So the timing can
    : depend on exact numerical values, the size of a number or address.
    :
    : The point is, if you really depend on the timing, you have to test
    it
    : yourself!
    :
    : I hope that clears up the mud a bit!?
    :
    : -- best regards
    : Tracy Allen
    : electronically monitored ecosystems
    : http://www.emesystems.com
    : mailto:tracy@e...
    :
    :
    : >--- Rodent <daweasel@s...> wrote:
    : > > http://www.emesys.com/BS2speed.htm
    : >> > > time 'between' 2 instructions?
    : >
    : >Rodent, I was intrigued by your reference to the web
    : >page, so I checked it out. But I do have a
    : >question...On there it states:
    : >
    : >
    Copied text
    : >For example, in this sequence:
    : >
    : >loop:
    : >high 1 ' 140 microseconds high
    : >low 1 ' 140 microseconds low
    : >high 1 ' 430 microseconds high
    : >goto loop
    : >pin P1 stays 140 microseconds high, and then 140
    : >microseconds low, then 430 microseconds high, and then
    : >the sequence repeats . One can infer that the low and
    : >the high instruction each take 140 microseconds to
    : >execute. And what about the goto? Since high itself
    : >uses 140 microseconds, we can infer that the goto
    : >takes 430-140 = 290 microseconds.
    : >
    End copied text
    : >If you are measuring the high/low changes on pin 1,
    : >then I don't see how that analogy above could be
    : >correct. Because pin 1 is already "high" at the end
    : >of the loop, when the program branches back to loop
    : >again, there will be no change in the state of pin 1
    : >to gauge from the last "high" statement in the code.
    : >Based on the first 2 instructions, I would infer that
    : >the "goto" instruction takes 430-280 = 150
    : >microseconds, which sounds about right...
    : >
    : >Someone else wanna help me out here? Or is it just
    : >the fact that I just got home from a 12 hour work day
    : >and my brain has turned to mush? =)
    : >
    : >
    : >
    : >=====
    : >Chris Savage
    : >Knight Designs
    : >324 West Main Street
    : >Montour Falls, NY 14865
    : >(607) 535-6777
    : >
    : >http://www.knightdesigns.com
    :
    : To UNSUBSCRIBE, just send mail to:
    : basicstamps-unsubscribe@yahoogroups.com
    : from the same email address that you subscribed. Text in the
    Subject and
    : Body of the message will be ignored.
    :
    :
    : Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    :
    :
    :
    : [noparse][[/noparse]Non-text portions of this message have been removed]
    :
    :
    : To UNSUBSCRIBE, just send mail to:
    : basicstamps-unsubscribe@yahoogroups.com
    : from the same email address that you subscribed. Text in the
    Subject and Body of the message will be ignored.
    :
    :
    : Your use of Yahoo! Groups is subject to
    http://docs.yahoo.com/info/terms/
    :
    :
Sign In or Register to comment.