Part Number: TMS320F2810
Hello.
Sorry. I do not know English and I use translate.google.com
Help me pls.
Block 1.
1)*CMPR1 = PWM_duty; // write new PWM duty cycle
2)ADC_result = *ADCRESULT0; // store ADC reading
3)ADC_input = ADC_result ^ BIT15; // bipolar input
4)*PIEACK = PIEACK_GROUP3; // acknowledge PIE group 3
5)*EVAIFRB = 0x0001; // reset T2PINT flag
Block 2.
/* input offset removal */
1)ADC_input = (ADC_result >> 4) & 0x0FFF; // unsigned scaled input
2)AvgSumDelta = ADC_input − *(AvgRec.dptr); // signed reading difference
3)AvgSum += AvgSumDelta; // adjust running sum
4)*AvgRec.dptr = ADC_input; // replace oldest value
5)NextIntPoint(&AvgRec); // modify data pointer
6)InputOffset = (int)(AvgSum >> 7); // scaled offset
7)NormInput = (ADC_input − InputOffset) << 4; // normalised ADC reading
1. What does it mean? (Block1 lines 2 and 3) && (Block2 lines 1 and 2).
Why were the lines Block 1 lines 2 and 3 ? If ADC_input changed in Block 2.
2. Why is linearization simply an addition? Not Linear interpolation ?
Thank you.