1
\$\begingroup\$

The PIC model I have is PIC24FJ128GA010. My question how many clock cycles does the RETURN instruction consume? The datasheet says 3(2), what does that mean?

\$\endgroup\$
5
\$\begingroup\$

There is some information in the 24F Programmer's Reference Manual, which is always a good place to go if you need to understand individual assembly language instructions.

On page 48 we find the following table, which is a slightly more useful version than the one in the datasheet:

enter image description here

On page 11 there is a small hint at the exception processing mechanism:

2.1.1.6 EXCEPTION PROCESSING

The 16-bit MCU and DSC devices have a vectored exception scheme with support for up to 8 sources of non-maskable traps and up to 246 interrupt sources. In both families, each interrupt source can be assigned to one of seven priority levels

So it seems if there is a non-masked trap or interrupt waiting it will only take 2 cycles for RETURN to finish and begin to service the relevant code. If the return is going to "normal" code then it will take 3 cycles.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.