CodeWarrior MC9S08SF4 ADC Number of Conversions

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

CodeWarrior MC9S08SF4 ADC Number of Conversions

ソリューションへジャンプ
567件の閲覧回数
JimmyJames
Contributor I

CodeWarrior MC9S08SF4 ADC Number of Conversions

 

I am new to both Freescale & CodeWarrior - & loving it.

 

When setting the ADC component's "Number of Conversions", through the Component Inpector, does the code generated averages the result, or do you have to do that yourself. I looked at the generated code, but it didn't seem obvious where is it that they are calculating the average of the measurements. Since this is how the measurements are saved,

 

  RefSense_OutV[SumChan] += tmpTwreg.w; /* Save measured value */

 

But when it reaches the number of conversions, then it invokes the user event, 

 

      RefSense_OnEnd();                /* Invoke user event */  

  

However, nowhere can I see where the aveage of the measurements is being calculated.

 

Thanks.  

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
393件の閲覧回数
Jim_P
Contributor III

they are doing this smart.

 

for some systems, the boucing up and down between values can be of importance.

 

to get the ADC averaged value simply divide by the number of conversions.

 

to get a floating point value that has the resulting do floating point math. for the devide.

this acts to filter out the noise and give you the fractional remainder as fraction of a bit.

 

Jim P

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
394件の閲覧回数
Jim_P
Contributor III

they are doing this smart.

 

for some systems, the boucing up and down between values can be of importance.

 

to get the ADC averaged value simply divide by the number of conversions.

 

to get a floating point value that has the resulting do floating point math. for the devide.

this acts to filter out the noise and give you the fractional remainder as fraction of a bit.

 

Jim P

0 件の賞賛
返信