ADC average values

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

ADC average values

1,931件の閲覧回数
Alexshea
Contributor III

@xiangjun_rong Hi, I used the code that you recommended for calculating the average temperature. However, after using that now I don't receive any temperature. Could you please check the code once again and help me resolve that problem. I added the whole project as you asked the last time.

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,876件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

you use the code:

#define TOTAL_AVERAGE_NUMBER 200
for (uint16_t i=0; i<TOTAL_AVERAGE_NUMBER; i++)
{
uivoltage=HW_ADC_Read(0);
temp=calcTemp(uivoltage);
totalTemp+=temp;

}

The above code takes a lot of time so that the core has not time to handle the interrupt.

Pls try to change

#define TOTAL_AVERAGE_NUMBER 2

and have a try.

BR

XiangJun Rong

1,856件の閲覧回数
Alexshea
Contributor III

@xiangjun_rong Hi, I tried what you said, but even setting #define TOTAL_AVERAGE_NUMBER 2 didn't solve the problem maybe because I don't have any interrupt in my code. Last time you recommended me not to use interrupt, since I'm using all the 8 adc channels. But, thanks for your help

0 件の賞賛
返信

1,910件の閲覧回数
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi 

@xiangjun_rong  is on leave. He will answer you next week when he gets back.

Thanks,

Jun Zhang

0 件の賞賛
返信

1,908件の閲覧回数
Alexshea
Contributor III

Thank you so much for letting me know. I'll wait for him 

0 件の賞賛
返信