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.

TMS320F2800157: How SysCtl_delay take effect?

Part Number: TMS320F2800157


Tool/software:

Hi Expert

In the DSP development customer use SysCtl_delay(), the assembly is below, could you please share with the assembly, which register is changed to realize the delay function? How can user observe the operation in CCS?

Thanks

Joe

  • Hi,
    SysCtl_delay() is an assembly macro. You can find the code in the driverlib sysctl.c file if you want to look at it.

    Thanks

  • Hi Prarthan

    the assembly is below, but I cannot find the _SysCtl_delay definition and which register to control the delay cycle:

    Could you please kindly help to explain the _SysCtl_delay in register level? or it is just a software delay?

    Thanks

    Joe

  • Hi,

    As you can see that the function calls following assembly functions : 

    SUB ACC, #1 -->  subtract accumulator 

    BF offset, GEQ --> Branch fast with greater than or equal to condition

    LRETR --> Long Return Using RPC

    You can check disassembly to see the same and check CPU user guide for confirmation.

    Hence In my understanding software configuring hardware to implement delay function.

    Thanks.

  • Hi Prarthan

    Could you please help to check is there any specific register to realize the sysctl_delay() function or it is just realized by a general function cpu register?

    thanks

    Joe

  • Joe,

    As explained before, I will repeat again

    SUBB is a cpu instruction that subtracts the ACC (Accumulator) register in CPU Core register. The accumulator register is set by value passed to delay function.

    Then after decrementing the accumulator check for the accumulator is greater than or equal to zero if not then branch and continue execution.

    So this is just a efficient software implementation of the delay function.

    Thanks