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.

AM6442: PRU instruction "CALL"

Part Number: AM6442

Hi

 

It seems that there is a instruction "CALL" for PRU, but couldn't find the details about it at https://www.ti.com/lit/ug/spruij2/spruij2.pdf

 

- What is this instruction for?

- Please let me know the link that contains the information about this instruction?

 

Thanks and Best regards,

Tsurumoto.

  • CALL is a pseudo instruction which is replaced with jump and link instruction

    Example from compiler listing :

          77        ; Synchronize IEP and PWM counters
          78 00000028                         CALL    FN_SYNC_IEP_PWM
    1         00000028 000000230000DD!         JAL     R29.w2, FN_SYNC_IEP_PWM

    PRU compiler does not understand CALL pseudo instruction unless you declare it as macro.

    Use JAL instruction to jump to a subroutine/function. The register of the return address can be selected and can be different for each function call.

        JAL   r20.w2, function_label

    ...

    function_label:

    ...

       JMP r20.w2

    JAL is described in the PRU assembler instruction PDF you referenced.

    I am attaching 2 poster which shows register usage in different IO modes and various broadside accelerators.

    - Thomas

    Broadside Functions.pdfPRU_IO summary.pdf

  • Thanks, Thomas