Command execution time on ARM Cortex-m3 (in particular, LPC1343)

I want to write a very time sensitive code on LPC1343, where I need to calculate the exact clock cycles. There are two questions: -

  • I read that code executed from internal flash memory may not always work at all 72 MHz and standby states may appear. But I can not find any "official" document about this. I saw one place recommending copying time-sensitive functions to ram ... I am looking either to be told definitively that this will not happen, or for information on how this affects time.

  • How long do branching instructions take? I read this kernel with branch prediction, so timings can change. Is this correct, and if so, is there any way to predict how it will behave, or turn it off (since the exact time is more important than saving several measures for me).

+4
source share
2 answers

Command execution times for the Cortex-M3 are available on arm.com:

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337g/BABBCJII.html

There are also operations with pipelines, so command counting is a bit difficult.

+2
source

Here are some real-world studies for LPC11xx and LPC13xx: http://knowledgebase.nxp.com/showthread.php?t=460

In short, there is no β€œright” answer, the results may depend on the settings of the flash accelerator, memory alignment, bus architecture (neumann vs. harvard), 32-bit and 16-bit instructions, etc.

+2
source

All Articles