SPRACO5 September 2019 F29H850TU , F29H859TU-Q1 , TMS320F280021 , TMS320F280021-Q1 , TMS320F280023 , TMS320F280023-Q1 , TMS320F280023C , TMS320F280025 , TMS320F280025-Q1 , TMS320F280025C , TMS320F280025C-Q1 , TMS320F280040-Q1 , TMS320F280040C-Q1 , TMS320F280041 , TMS320F280041-Q1 , TMS320F280041C , TMS320F280041C-Q1 , TMS320F280045 , TMS320F280048-Q1 , TMS320F280048C-Q1 , TMS320F280049 , TMS320F280049-Q1 , TMS320F280049C , TMS320F280049C-Q1 , TMS320F28384D , TMS320F28384D-Q1 , TMS320F28384S , TMS320F28384S-Q1 , TMS320F28386D , TMS320F28386D-Q1 , TMS320F28386S , TMS320F28386S-Q1 , TMS320F28388D , TMS320F28388S , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
The scale factor optimization (SFO) library is used to compute the appropriate MEP scale factor in a background loop. As discussed in Section 2.1, HRPWM utilizes MEP technology for accurately positioning the falling edge, but, the MEP step size varies based on worst case process parameters, operating temperature and voltage. In order to maintain a constant a mapping function between encoded and decoded value, the correct MEP scaling factor needs to be known to the transmitter software. That is why the SFO calibration is always active in the background loop to compensate for any variations in temperature, pressure or any external factors. The background SFO calibration loop in the application code is shown below:
while(1)
{
while(status == SFO_INCOMPLETE)
{
status = SFO();
if(status == SFO_ERROR)
{
error(); // SFO function returns 2 if an error occurs & #
// of MEP steps/coarse step exceeds maximum of 255
}
else if (status == SFO_COMPLETE)
status = SFO_INCOMPLETE;
}
} // end infinite for loop