An exact cycle length loop?
I was wondering about the inner workings of the Pause and Pauseus commands
I am trying to develop a loop with a certain delay and not happy with the results from·pause(us) .
If I pause(us) by a Byte the cycle is slightly different than a Word variable even though the value is the same.
I assume this is becuase it has an extra few lines to get the MSB and LSB.
·
Not knowing assembly I have been looking at the list output from the SX/B and trying to workout a loop that has an exact cycle length.
·
So I was thinking if my overhead in the loop was “X” cycles and I needed a Y clock cycle loop to give me an exact time at 50MHz then I need a pause routine to give me Y-X cycles.
Using a word variable as (Y-X) what Assembly code would give me a consistent cycle length resolute to 1 cycle?
The help file talks about·2 nested loops using bytes only but I am trying to·determine how that code works.
I am waiting for my SX28 kit to arrive so all this is being done still thru the simulator.
I am trying to develop a loop with a certain delay and not happy with the results from·pause(us) .
If I pause(us) by a Byte the cycle is slightly different than a Word variable even though the value is the same.
I assume this is becuase it has an extra few lines to get the MSB and LSB.
·
Not knowing assembly I have been looking at the list output from the SX/B and trying to workout a loop that has an exact cycle length.
·
So I was thinking if my overhead in the loop was “X” cycles and I needed a Y clock cycle loop to give me an exact time at 50MHz then I need a pause routine to give me Y-X cycles.
Using a word variable as (Y-X) what Assembly code would give me a consistent cycle length resolute to 1 cycle?
The help file talks about·2 nested loops using bytes only but I am trying to·determine how that code works.
I am waiting for my SX28 kit to arrive so all this is being done still thru the simulator.