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.

TMS320F28379D: Variable change after executing one line of code

Part Number: TMS320F28379D


Hello,

I have a strange behavior while executing this line of code:

div = (float)(ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV << 1);

when I step over this line, variable div is 4.0

when I execute this line of code after

sysclkToInClkError = ((mult / div) - ((float) ctr1 / (float) dTMR2_INP_CLK_CTR));

the div changes, it must remain unchanged but div = 8.93...

could you figure out what is the problem please,

the complete is the following:

        mult = (float) (pCfg->kCC.u16SysPllMult_Imult) + (float) (pCfg->kCC.u16SysPllMult_Fmult) / 4;

        if (!ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV)
        {
            div = 1;
        }
        else
        {
            div = (float)(ClkCfgRegs.SYSCLKDIVSEL.bit.PLLSYSCLKDIV << 1);
        }

        /* compute the error */
        sysclkToInClkError = ((mult / div) - ((float) ctr1 / (float) dTMR2_INP_CLK_CTR));

Regards,

S.Tarik