Shop OBEX P1 Docs P2 Docs Learn Events
SPIN Timing Question — Parallax Forums

SPIN Timing Question

HumanoidoHumanoido Posts: 5,770
edited 2010-09-11 02:34 in Propeller 1
The clock cycles are 368 to perform 2 spin instructions.

So it takes 368/2=184 clock cycles per instruction.

The crystal is 6.25 MHz operating at 100 Mhz.

What is the instructions per second?

So 100,000,000 cycles per second clock,

100,000,000/184 = 543,478 instructions per second

Is this correct?

Thank you for your reply.

Humanoido

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2010-09-11 01:14
    Humanoido wrote: »
    The clock cycles are 368 to perform 2 spin instructions.

    So it takes 368/2=184 clock cycles per instruction.

    You can't generalize SPIN timing this way. FWIW, I just clocked ?result with 864 cycles. You'll have to admit that this doesn't really fit into your scheme :)
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-09-11 01:38
    kuroneko wrote: »
    You can't generalize SPIN timing this way. FWIW, I just clocked ?result with 864 cycles. You'll have to admit that this doesn't really fit into your scheme :)
    Kuroneko, thank you. I know different statements take different times to execute. I am testing two (identical) statements. It is not designed to be a generalization for any other statements. So apparently the math is correct, right? I am using this to determine the speed of each Spin statement, one at a time, or blocks of spin statements to know more information about the block timing. The IPS should be correct for the exact statement(s) being measured. I wonder how Parallax came up with an exact IPS value for the BASIC Stamp line. Did they average all the PBASIC commands for execution time or take the ultimate highest speed statement for a quote?
  • kuronekokuroneko Posts: 3,623
    edited 2010-09-11 01:44
    Humanoido wrote: »
    It is not designed to be a generalization for any other statements. So apparently the math is correct, right?

    Assuming your way of measuring is OK I don't see why not. What statement are you using and how do you measure it?
  • HumanoidoHumanoido Posts: 5,770
    edited 2010-09-11 02:34
    Kuroneko, thanks for your confirmation. - several methods of timing. Two in the OBEX. The other is an oscilloscope. I decided to build my own BINARY-O. After more tests, confirmation that all is well, plus debugging, and feature adding, I would like to release the BINARY-O as a complete project. There's also 12Blocks and ViewPort which may do some program analysis too.
Sign In or Register to comment.