Hello to all,
Is there any function that can accurately delay the CLA in F28377S for a specific amount of time like the DELAY_US ?
If not, do you have any suggestions on how would I implement this?
Thanks,
Alexandros
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.
Hello to all,
Is there any function that can accurately delay the CLA in F28377S for a specific amount of time like the DELAY_US ?
If not, do you have any suggestions on how would I implement this?
Thanks,
Alexandros
As expected, executing the raw DELAY_US() function inside the CLA doesn't work. Does anyone know if there is a simple solution to this or do I have to write a cla assembly function?
Thanks, Alex
Hi Alex,
DELAY_US wont work on the CLA. that function is written in C28x assembly. you will have to write something in CLA assembly. It probably wont be very cycle accurate
; \brief CLA delay function ; \param[in] N counter in MR0 ; ; This function basically loops "N" times ; cycles (SYSCLK) = 2(prologue) + 8*N + 4(epilogue) ; .global _delay_cla .sect "Cla1Prog" _delay_cla: .asmfunc MMOVIZ MR1, #0 ; decrement value MMOVXI MR1, #1 _delay_cla_loop: MSUB32 MR0, MR0, MR1 ; set ZF when MR0 is 0 MNOP MNOP MNOP MBCNDD _delay_cla_loop, NEQ MNOP MNOP MNOP MRCNDD UNC MNOP MNOP MNOP .endasmfunc
You can probably define this in a .asm file and declare a prototype "void delay_cla(int32_t N);" in a header file that will be included by the CLA. It should take 2+4+8N sysclk cycles, so you would have to define a macro that translates microseconds to "N"