This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5255: What is the number of CPU cycles required to read one instruction from Flash?

Part Number: MSP430F5255

Hello.

I have a question.

What is the number of CPU cycles required to read one instruction from Flash?

Could you tell me the document or URL described this answer?

I can't find any information about that in the datasheet and user guide.

Regards,

uchida-k

  • Hello Uchida-k,

    It would depend on how the C code gets translated to assembly, but I estimate 1-3 clock cycles depending if your pointer is already loaded into the working registers or not.
  • Hi Jace H,

    Thank you for your reply.

    What is the "working register"?
    Does MSP430 have instruction cache which can reduce the time to read an instruction?
    Could you please tell me the reason why the time to read one instruction from Flash is not fixed?(1-3 cycles)

    Regards,

    uchida-k
  • Uchida-k,

    The working registers are R1-15 within the CPU. The actual reading of the Flash is only one cycle as is every other point in the memory map. Practically, it takes more as depending on where you are in your code, you have to load the correct addresses into the registers in order to read from somewhere.
    For example the MOV A,B instruction, takes what is at A and moves it to B. Typically B is a working register, say R15, that will later be moved somewhere else. A can be a working register or a fixed value. So it may take an additional instruction or two to move the wanted address into, say R14 to be given to the move instruction. It depends on how the assembly gets compiled. So MOV R14,R15 is the instruction that will be used assuming the correct addresses are loaded into R14 and R15.

    TL;DR: Technically, only one instruction cycle. Practically, could be a few more depending on how the assembler/compiler does it and where you are in your code.

  • Hi Jace H,

    Thank you for your reply.
    I understand very well.

    uchida-k

**Attention** This is a public forum