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.

DRV8412EVM的问题



在2xDC直流有刷电机的实例中,有段代码很不理解:

      IFdbk1b=_IQ15toIQ((AdcResult.ADCRESULT1<<3)-_IQ15(0.5))<<1;   

      IFdbk1a=_IQ15toIQ((AdcResult.ADCRESULT0<<3)-_IQ15(0.5))<<1;   

      IFdbk1 = (IFdbk1a - IFdbk1b) >> 1;

1、为什么结果寄存器要执行<<3操作? 这是要干嘛?  我理解_IQ15(0.5)是个偏移量。那么为什么最后将IQ15转换到IQ24了,还要执行<<1操作??

2、IFdbk1为什么要执行>>1操作啊?