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.

TMS570ADC采样

在用TMS570   ADC将采集的结果为啥要进行左移然后在减去一个值,减去的这个值是如何得到的?

下面的计算是用12bit的AD,采集一个电流值,采样电阻为0.002欧姆,将电阻两端的电压放大80倍后送入ADC引脚,

adc_current_gain_A = 0.0000305176

 obj->adcData.I.value[0] = ((obj->AdcResults1[0].value<<4)-obj->cal_offset_A)*obj->adc_current_gain_A; //ileg1.ImeasA_f;

想问两个问题

1、在用TMS570   ADC将采集的结果为啥要进行左移然后在减去一个值,减去的这个值是如何得到的?

2、adc_current_gain_A = 0.0000305176,这个gain值又是怎样得到的呢?

  • 左移四位,相当于乘以个16。

    I*0.002*80=0.16I

    我猜测是乘以个16,最后要除个100了。这样方便计算,省去了浮点型的计算。

    obj->cal_offset_A应该是个固定的偏移值,输入为0的时候的电流值

    obj->adc_current_gain_A 看命名是个电流增益,需要对照实际电路来看。