Duration of a NOP?
jmspaggi
Posts: 629
Hi all,
When newbie ask a question, what we hate is when he did not searched [noparse];)[/noparse]
So I searched [noparse];)[/noparse]
Can you please confirm if I'm right?
Standard propeller is running at 80Mhz. Which mean one cycle take 12.5ns. Since a NOP take 4 cycles, that mean a NOP is 50ns.
Correct?
Thanks,
JM
When newbie ask a question, what we hate is when he did not searched [noparse];)[/noparse]
So I searched [noparse];)[/noparse]
Can you please confirm if I'm right?
Standard propeller is running at 80Mhz. Which mean one cycle take 12.5ns. Since a NOP take 4 cycles, that mean a NOP is 50ns.
Correct?
Thanks,
JM
Comments
Furthermore if you add conditional expression flags to any instruction and the expression evaluates false, the affected instruction temporarily becomes a NOP to the COG and will be 50ns even if the original instruction is something like rdlong or waitcnt.
Cheers,
--Steve
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Propeller Pages: Propeller JVM
Thanks Steve.
JM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Linux? There is worst, but it's more expensive.
I'm using this old post regarding the nop to ask you a Spin question.
Is there something like a NOP in spin?
Else, what's the smallest delay I can introduce, and how?
Is it waitcnt(cnt +1)?
Of waitcnt(cnt)?
I would like to wait for 4 cycles, if possible.
Thanks,
JM
It was to reduce tue quantity of data displayed in the terminal while I was waiting in a repeat loop
So I was just wondering what was the smallest delay possible.
I finished by simply using a repeat 1 to do it.
Now that everything is working fine, I removed the trace and the delay.
Thanks,
JM
Like between:
waitcnt(cnt +1)
and
repeat 1
Which one is the smallest?
Or even beter, will repeat 0 be "cleaned" at the compilation? Or will be interpretated?
Anyway, I agree this is not a very important information in high level langage, but I was just curious...
Maybe I should try to mesure them
JM
repeat 0 would prob be interpreted as just repeat i think, and reapeat by itself will infinitely reapeat and not have the effect of creating a delay in the program, but just hang it forever.
Good to know! I didn't think about the minimal duration. That's right. Else I will have to wait for an entire clock cycle.
So I will probably go with a repeat 1. Safer for my needs.
Thanks.
JM
There are probably other solutions to a smaller delay in Spin, but here are a couple that I measured with a scope.
... here is the program I used. Just measure the time that the pulse is HIGH, and subtract 7.6us.
Thanks for those details! Nice way to validate that. I think I will have to buy a scope...
Is that something which is doable with the "Parallax USB Oscilloscope" or the "PropScope"?
JM
Using a cog counter is cheaper.