estimating program execution time

cancel
Showing results for 
Search instead for 
Did you mean: 

estimating program execution time

Jump to solution
76 Views
Contributor III

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

Labels (1)
Tags (1)
1 Solution
7 Views
NXP TechSupport
NXP TechSupport

Hi SOMOGYI Tibor,

   Thank you for your interest in NXP Kinetis product, I would like to provide service for you.

   The code execute time is the core clock, not the flash clock.

   The flash clock is used to clock the flash memory, it is not the code execute time, just the flash module operation clock.

   So, if you want to test your asm code, you need to use the core clock to calculate it.

   About the detail execute time, I recommend you use the systick to test it.

   Actually, in our KL25 sample code, it has the method for your reference.

   Please check my attached some code for your reference.

Wish it helps you!

  If you still have question about it, please kindly let me know.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

2 Replies
8 Views
NXP TechSupport
NXP TechSupport

Hi SOMOGYI Tibor,

   Thank you for your interest in NXP Kinetis product, I would like to provide service for you.

   The code execute time is the core clock, not the flash clock.

   The flash clock is used to clock the flash memory, it is not the code execute time, just the flash module operation clock.

   So, if you want to test your asm code, you need to use the core clock to calculate it.

   About the detail execute time, I recommend you use the systick to test it.

   Actually, in our KL25 sample code, it has the method for your reference.

   Please check my attached some code for your reference.

Wish it helps you!

  If you still have question about it, please kindly let me know.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

View solution in original post

7 Views
Contributor III

Hi Kerry,

Thank you for your prompt feedback... and for the reference code. I'll follow your advice and write a short test program applying your systick based method to measure the execution time on my platform.

Cheers

Tibor