ADC average values

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

ADC average values

1,242 次查看
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,187 次查看
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,167 次查看
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,221 次查看
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,219 次查看
Alexshea
Contributor III

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

0 项奖励
回复