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.

Compiler/TMS320F280049: SFO initialization question

Part Number: TMS320F280049

Tool/software: TI C/C++ Compiler

 Hello, I am using SFO library for MEP calibration as recommended by TI. On the initialization routine provided on the sample project  hrpwm_ex2_prdupdown_sfo_v8 there is a portion of code that calls SFO(); function inside a while. I would prefer to provide some form of timeout for this routine as showed below, to avoid get stuck there if there is any issue. My questions is, what is the maximum number of iterations I should wait for inside this while??

Thanks in advance...

    cont=0;
    while(status == SFO_INCOMPLETE)
    {
        if(cont>MaxNumberSOFIterations){
            error();
        }
        else{
            status = SFO();
            if (status == SFO_ERROR)
            {
                error();    /* SFO function returns 2 if an error occurs & # of MEP */
            }
        }
        cont++;
    }