This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

例程BLDC3_1中ADC采样模块的疑问



        int16 DatQ15;
        int32 Tmp;

        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

大佬们程序如上,AD采样不应该是采样进来存到寄存器吗,怎么最后没有寻进去,还有Tmp = (int32)p->Ch2Gain*(int32)DatQ15;这句的作用是什么呢?