Shop OBEX P1 Docs P2 Docs Learn Events
SxSim & pipeline & clockcycle — Parallax Forums

SxSim & pipeline & clockcycle

AlessandroAlessandro Posts: 26
edited 2008-03-10 10:37 in General Discussion
Hi folks! how are you?
·I'm an italian student, i'm doing some benchmark on the sx28, it works fine but·both the Ubicom datasheet, and the Parallax ones are not telling the truth on the timing that i found.

I tried also to use the SxSim to understand but nothing.

Is possible to see the pipeline (fetch, decode, execute, write) on the simulator?

are in the SxSim some Known problem?

Thanks to all!

Alessandro

·

Comments

  • PJMontyPJMonty Posts: 983
    edited 2008-03-07 19:38
    Allesandro,

    SxSim doesn't show the pipeline stages, just each instruction.

    You say that the datasheet doesn't match your timing. There are many people using the SX for timing critical work and no one has reported problems. Can you post some code that shows a difference between your timing and the datasheet?

    Thanks,
    PeterM
  • AlessandroAlessandro Posts: 26
    edited 2008-03-09 19:41
    Thanks for·your answer!

    To test·the speed and the clockcycle·i have put a led over the RB0 and through a 460OHM resistor to Vss.

    The program to test the speed is simple:··it·turn the·led on and· than·turn it off.



    Initialize··· ;Configure port settings

    mov rb, #%00000000 ;Port·B output zero

    mov !rb,#%11111110 ;Port B.bit0 output dir.

    ;
    MAIN PROGRAM

    Main

    mov rb,#$01

    mov rb,#$00

    jmp Main ;goto main



    on 4 MHZ turbo, the high period is 470 ns, and the low period is a bit more because of the jump time.

    Now on 4 MHZ the clock cycle is 250 ns, and the datasheet says that the move istruction takes 1 clock.

    but it is longer! what is wrong?



    Thanks again

    Alessandro

  • BeanBean Posts: 8,129
    edited 2008-03-09 20:14
    The "MOV rb,#" instruction is a compound instruction.
    It is actually TWO mov instructions.

    MOV W,#$01
    MOV rb,W

    So it takes 2 cycles.
    To make a 1 cycle pulse, use SETB and CLRB.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com



    Post Edited (Bean (Hitt Consulting)) : 3/9/2008 10:01:16 PM GMT
  • AlessandroAlessandro Posts: 26
    edited 2008-03-10 10:37
    YEA! You are right, i love forum moderators smilewinkgrin.gif

    thanks a lot!

    Alessandro (Italy)
Sign In or Register to comment.