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

Hub Timing Question

MikeChristleMikeChristle Posts: 31
edited 2013-03-04 10:46 in Propeller 1
Good afternoon

Given the following code:
rdlong A,Aadrs
rdlong B,BAdrs
add A,B
wrlong A,Aadrs

Obviously the first rdlong takes 8 to 23 clocks to execute. After the first rdlong I am now synchronized to the Hub. Can I make any assumptions about the timing of the remaining instructions? Seems that the second rdlong should take 16 clocks. Are there any resources that will give me more detailed information? Is there a simulator that will accurately simulate the Hub timing?

Thank you for your help.
Mike

Comments

  • tonyp12tonyp12 Posts: 1,951
    edited 2013-03-04 10:46
    A hub instruction takes 8 clocks if you are in sync.

    The next hub sync will be 16 clock later, so you have 8 clocks left over for regular cog instructions.
    As most takes 4 clocks, you can add two instructions that will not add any extra time.

    Or time it so to add 24 clocks by inserting 6 'normal' instructions.


    7-23. rdlong A,Aadrs
    16.... rdlong B,BAdrs ' arrived at hub window 8 clocks to early
    4...... add A,B
    12.... wrlong A,Aadrs ' arrived at hub window 4 clocks to early
Sign In or Register to comment.