Other Parts Discussed in Thread: AMC1305L25
Tool/software: Code Composer Studio
Hello
I have a question during the example operation.
example = fcl_f2838x_tmdxiddk_cpu1.project
(use : tmdxiddk279d (Motor driver eval) , tms320f28388 control card (mcu eval) )
In the SDFM setting function filter settings.
OSR = 128 , sinc3 , shift bit = 7
Referenced TRM., I know that.
However, the example uses 6 bits. (source code below.)
Why is it different?
// ****************************************************** // Sinc filter Module // ****************************************************** // Configure Data filter module's filter type, OSR value and enable / // disable data filter. // 16 bit data representation is chosen for OSR 128 using Sinc3, from // the table in the TRM. // The max value represented for OSR 128 using sinc 3 // is +/-2097152 i.e. 2^21. // To represent this in 16 bit format where the first bit is // sign shift by 6 bits. SDFM_enableFilter(SDFM1_BASE, (SDFM_FilterNumber)flt); SDFM_setFilterType(SDFM1_BASE, (SDFM_FilterNumber)flt, SDFM_FILTER_SINC_3); SDFM_setFilterOverSamplingRatio(SDFM1_BASE, (SDFM_FilterNumber)flt,127); //COSR = 127 +1 -> OSR = 128 SDFM_setOutputDataFormat(SDFM1_BASE, (SDFM_FilterNumber)flt,SDFM_DATA_FORMAT_16_BIT); SDFM_setDataShiftValue(SDFM1_BASE, (SDFM_FilterNumber)flt,6); //OSR = 128, SINC3 , 6? TRM = 7;