How to delay an ARM Cortex M0+ for n cycles, without a timer?
问题 I want to delay an ARM Cortex M0+ for n cycles, without using a timer, with the smallest possible code size. (I think this mandates use of assembly.) A delay of 0 cycles is simple no code. A delay of 1 cycle is a single NOP. A delay of 2 cycles is two NOPs. At what point is it (code-size) efficient to start looping? How many cycles does the tightest possible loop take? What is the setup time? Post answer notes: The following C code: register unsigned char counter = 100; while (counter-- > 0)