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.

CCS/AWR1642: AWR1642:About Task_sleep

Part Number: AWR1642
Other Parts Discussed in Thread: IWR1642

Tool/software: Code Composer Studio

Hi,

I use AWR1642 and IWR1642.I have 2 questions:

question 1:

Now i want to achieve task delay,I konw Task_sleep(1); 

The function is One millisecond delay, but i want to 1us delay.

The fun is not work!

So,i try the following methods:

uint8_t i = 0;

for(i = 0;i < 1; i++);

I know this function is microsecond delay,  but it's not work in demo, I can see the program is work,but the radar is not work, and the EVM's electricity is not jump.(The current jumping indicates that the radar is working).

Here's my program:

uint8_t i = 0;
while(1)
{
mcal_GpioPullUp(3);
mcal_GpioPullUp(4);
for(i = 0; i<1;i++);
// Task_sleep(1);
mcal_GpioPullDown(3);
mcal_GpioPullDown(4);
for(i = 0; i<1;i++);
// Task_sleep(1);
}

I guess the program has been optimized out of the for loop.

How do I achieve microsecond delay???

question 2:

I want to comment the "System_printf" statement, There is no macrodefinition involved?

Thank you,

  • Hi,

    Rregarding the microsecond delay I recommend you search the e2e forum for similar questions. It is a standard feature in embedded programming

    It is also possible to add inline assembly NOP instructions.

    Please do some research

    thank you
    Cesar