Shop OBEX P1 Docs P2 Docs Learn Events
Spin Clock Cycles — Parallax Forums

Spin Clock Cycles

Computer Geek 101Computer Geek 101 Posts: 179
edited 2009-01-29 12:16 in Propeller 1
Is there any data on how many clock cycles each SPIN instruction takes?

Comments

  • Erik FriesenErik Friesen Posts: 1,071
    edited 2009-01-28 15:59
    It varies but it is somewhere in the 1000 on up range. You can test this yourself by timing a loop.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2009-01-28 23:28
    To expand on Erik's comment, an oscilloscope will tell you everything you need. Make a Pin high, then immediately make it low, measure the pulse width and record the value. Now place anything you want in between the two instructions, measure it, subtract the original pulse width and divide it by the colock frequency and you have your answer for how long it takes to execute that instruction(s).

    If you don't have an oscilloscope, you can use a counter to measure the pulse width.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker


    Post Edited (Paul Baker) : 1/28/2009 11:34:14 PM GMT
  • jazzedjazzed Posts: 11,803
    edited 2009-01-28 23:47
    See this post for some measurements based on 80MHz operation:
    http://forums.parallax.com/forums/default.aspx?f=25&m=317689&g=318421#m318421

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --Steve
  • Computer Geek 101Computer Geek 101 Posts: 179
    edited 2009-01-29 12:16
    thanks for the info ill get to work on it now
Sign In or Register to comment.