Shop OBEX P1 Docs P2 Docs Learn Events
Running Speed of SX-28 — Parallax Forums

Running Speed of SX-28

sunruhsunruh Posts: 11
edited 2005-10-17 22:22 in General Discussion
I am doing some speed calculations on my SX-28.· I am running with an external crystal at a freq of 50 mhz.· The instruction set gives the number of cycles for each instruction.· For instance, the ADD instruction has 1 word, and 1(4) cycles.· Does the 4 relate to the number of crystal cycles?· In other words, it takes 4/50,000,000 seconds to complete?

Stan Unruh

Comments

  • kb2hapkb2hap Posts: 218
    edited 2005-10-17 18:21
    That instruction takes 1 cycle, I belive the (4) refers to compatible mode, as where the 1 refers to turbo mode.
    the turbo mode is what you would typically use.· the compatible mode has something to do with the SX and the PIC· (C57) code being compatible (in instruction cycles) for an example if you wrote code for the C57 you could easily port it over to the SX.· the pic ran each instruction in 4 cycles.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    DTQ
  • sunruhsunruh Posts: 11
    edited 2005-10-17 18:58
    Thanks!
  • ElectronegativityElectronegativity Posts: 311
    edited 2005-10-17 22:22
    Hi Sunruh, This quote from the user's manual explains it pretty well:

    "The SX family implements a four-stage pipeline (fetch,
    decode, execute, and write back), which results in execution
    of one instruction per clock cycle."

    In turbo mode it will fetch the next instruction at the same time it is decoding the current one and executing the previous one.

    The reason that branching instructions like jumps and subroutine calls take more cycles to execute is that the pipeline is cleared on a jump

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...

    Post Edited (Electronegativity) : 10/17/2005 10:25:29 PM GMT
Sign In or Register to comment.