I was referring to AN3943 - which provides details of ATO algorithm. We require to generate C code using HDL coder from simulink to flash to the target(kinetis). We tried first by modelling this algorithm in simulink using all floating point operations. It works fine. Next we wanted to convert this to fixed point and we got into trouble. We are using external ADC(AD7606) to read the quadrature inputs. So we fixed the input data type to fixdt(1,16,15). sine/cosine functions within simulink was used. The results after fixed point conversion is erratic. Please provide advise for the same.