SPIN instruction length
HGPL
Posts: 15
How many cycles length a SPIN instruction?
I think one spin instruction executed in once per 16 cycles max.
...because the SPIN application are in the Main Memory (mutually-exclusive) and I think that in case give me the sentence in below.
... and it's mean the most sorted SPIN instruction is quite 16 cycle.
It is right ???
Please help me!
I think one spin instruction executed in once per 16 cycles max.
...because the SPIN application are in the Main Memory (mutually-exclusive) and I think that in case give me the sentence in below.
... and it's mean the most sorted SPIN instruction is quite 16 cycle.
It is right ???
Please help me!
Comments
Though, I can't answer your question exactly, I too would ask the same. They say that SPIN operates at around 80k instructions per second. My specific question is; does each command execute in the same length? Writing PASSY code, one can predict and control the exact time to run, but I don't think the same is possible with SPIN.
-Parsko
Assembly language is a different thing. Each instruction (other than HUB instructions) takes either 4 or 8 cycles to execute with conditional jumps (like DJNZ/TJZ/TJNZ) taking 8 cycles if they don't jump and all non-HUB instructions taking 4 cycles. The Propeller Manual discusses the HUB timing which is variable. There's a table on pages 350-1 of the manual that gives the timings.
Take an oscilloscope and set it up in positive edge trigger mode where the trigger·level is Vdd/2. Setup a simple program where two consecutive instructions setting a·pin high followed by setting a bit low are executed·then measure the pulse width and record the value. Now place an instruction between those two instructions and measure the pulse width. Take the second measure and subtract from it the first measure and you now have the length of time it took to execute the instruction under test. This procedure can be used to measure the length of time it takes to execute any Spin instruction.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Post Edited (Paul Baker (Parallax)) : 2/11/2007 9:02:10 PM GMT
I will get the propeller chip about a week (because the suplier wait for my another order (FPU V3)).
I study the whole Propeller Manual several times. And I started predevelop...
My application is very time-sensitive so I think coding assembly.
But the SPIN are the comfortable language and poke my mind.
...however I not anywhere found SPIN relative timing description, only for ASM instructions.
... so I can't analyze the timing with oscilloscope ... yet
to get the value to subtract from future measurements use two assignment operators in a row
start_time := cnt
end_time := cnt
time := end_time - start_time
then just tuck any expression you want to time inside the two to get the number of clock cycles for that expression, you could even
do a batch of them and have it display on a tv or monitor very easily with tv/vga text.spin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
I tried a similar test a couple of weeks ago, and got 10 microseconds for a single simple line of spin that transitioned a pin. (I didn't try adding another line of code to see how much additional time that added)
Jim C
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.