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.

HVPSFB中Q格式转换的问题



TI工程师,你好! 我在读HVPSFB源代码的时候有一些困惑,在HVPSFB-main.c中第866到870行有下面的语句: // Voltage setting calculated by: // Vref = Gui_VfbSet * iK_Vfbout, where iK_Vfbout = 1/K_Vfbout (i.e. inverse K_Vfbout) // view and set following variable in Watch Window as: // Gui_VfbSet = Q10 (Used as Q15 below) Vref = ( (long) Gui_VfbSet * (long) iK_Vfbout ) >> 5; // (Q15 * Q14) >> 5 = Q24 我的问题是,Gui_VfbSet是Q10格式,使用使用作Q15格式,并没有执行右移,这样用对吗? 我在观察窗口中发现,如果把Vref设置为Q20格式,则观察值与实际值相当,这个Vref是Q24格式吗? 急需您的帮助!