How many clock cycles asm commands
DXC
Posts: 33
Hello all,
I have made some code but dont know how many clock cycles they take to execute.
Can someone tell me howmany cycles the command below take?
if_z jmp #Begin
I think the instruction below takes 4cycles?
mov t2,SLCK wz ' 4c Clock Pin
gr,
I have made some code but dont know how many clock cycles they take to execute.
Can someone tell me howmany cycles the command below take?
if_z jmp #Begin
I think the instruction below takes 4cycles?
mov t2,SLCK wz ' 4c Clock Pin
gr,
Comments
(more, but I'm looking)
Found it, darn quick! That new forum search is worth every other teething pain we are dealing with right now.
DJNZ, TJZ, TJNZ take 4 on a branch, but 8 on a non-branch. (faster to loop, slower to leave loop)
Jumps always take 4.
If you turn a instruction into a conditional, it still consumes 4 cycles, just like a NOP would.
The timing is more complex on waitpeq, waitvid, etc... Those can be discussed later, if needed.
But <if_z jmp #Begin> takes a total of 4 cycles or 8 cycles?
What does NOP mean? No Operational Proces?
I know a DJNZ is optimized for DOING(4cycles) the jump that NOT DOING(8 cycles)
Putting the wz flag on the Mov instruction does not cost more the 4 cycles?
<mov t2,SLCK wz>
gr,
No OPeration (it's useful when you have to e.g. fill the pipeline for self-modifying code but nothing else to do)
No, it doesn't. Internally all operations involved (with flags) are done anyway. The flags are just not updated when wz or wc aren't specified. So a mov will always cost you 4 cycles.
Thats the info I wanted to hear.
Now I have a very small tlc5940 driver, now I will try to put the GSCLK in the DAtashift bit.
Btw.
The rdlong instruction takes 7..22clock cycles, I all software is running will the clock cycle stay the same?
Thus:
First run is takes 16 cycles, next run no cags are swapped or deactivated.
Will the second loop still consist of 16 cycles.
This way I will be able to make pulses in between the data clock in routine.
Well if it doesnt work I still have a small and fast tlc5940 driver.
gr,
Don't know if you ment to say the same, but I saw something on a AVR forum.
They used a counter for the GSCLK.
GSCLK needs 4096 pulses and then a blank then 4096 .... enz.
Need some digging into the book to see if its also possible with a prop.
gr,