cancel
Showing results for 
Search instead for 
Did you mean: 

Instructions take longer than expected

Chris K
Associate II
Posted on October 13, 2017 at 22:28

I am trying to write very tight loops in assembly. Looking at the programming guide, I see how many cycles each instruction should take. However, when I execute the code, the instructions take longer than I would expect. For example, both a nop and a cp should be one cycle. But if I replace a bunch of nops with cps, the timing changes. This seems strange to me. I cant tell exactly how far off they are, but slightly. I am running at 16MHz, and if I use bset/bres to set and clear a GPIO (also supposed to be one cycle) and verify it on a scope, it is clearly taking longer than one cycle. 

0 REPLIES 0