Hi team:
I have some questions about the ADC program of F2812, wish you can help me:
DatQ15 = (AdcRegs.ADCRESULT1>>1)&0x7FFF; // Convert raw result to Q15 (unipolar signal)
Tmp = (int32)p->Ch2Gain*(int32)DatQ15; // Tmp = gain*dat => Q28 = Q13*Q15
p->Ch2Out = (int16)(Tmp>>13); // Convert Q28 to Q15
1, DatQ15 = (AdcRegs.ADCRESULT1>>1)&0x7FFF;
// This program is to Convert the ADCRESULT1 raw result to Q15 (unipolar signal), but why it need to move the data one bit to the right? And why it &0x7FFF?
2, Tmp = (int32)p->Ch2Gain*(int32)DatQ15;
// Why convert TMP to Q28?
p->Ch2Out = (int16)(Tmp>>13);
// Also why convert ch1out to Q15?
Best regards