AnsweredAssumed Answered

estimating program execution time

Question asked by Tibor Somogyi on Apr 8, 2019
Latest reply on Apr 9, 2019 by Tibor Somogyi

This question is about the MK60FN1M0VLQ12 MCU: I feed mine with an external 24 MHz oscillator and clock settings are as follows: Core Clock = 96 MHz, Bus Clock = 48 MHz, Flash Clock = 24 MHz. No external memories are used, all code is executed from the Flash.

Shortly speaking I would like to be able to get some ideas about the program execution time under these conditions.

The reason for this is that I am using an external NAND Flash Array, interfaced via the MCU's NAND Flash controller... but as I can have up to 8 NAND Flash chips in my array, I use GPIO signals as chip selects.

Setting the GPIO pins to the desired state takes 3 assembly instructions, e.g.:

   ldr         r3, [pc,#56]         ;  2 clock cycles execution time

   mov.w   r2, #256              ;  1 clock cycle

   str         r2, [r3, #44]         ;  2 clock cyles

well, the very first question here is which clock we are talking about ? Is it the Core Clock ? ... probably ... on the other hand if it is the Core Clock, what is the meaning of the Flash Clock ? And finally the real question: how much time the execution of these three instructions will take, if all the code is in the Flash ? More generally, how can I estimate the program execution time of this MCU under these conditions ? Is there any document describing the timing ?

( I understand that with pipelines and caches it is not obvious to estimate the exact execution time... which I hope is that there is a way to - relatively easily - determine a minimum / maximum range... in fact, behind my GPIO pins there is an address decoding circuit, and I would like to know which is the maximum propagation delay for this decoding stuff for that the coming operation targeting a NAND Flash chip would not come too early, when the Chip Select signal is not yet active. )

Thanks in advance

SOMOGYI Tibor

Outcomes