Calculating average values of ADCs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Calculating average values of ADCs

850 Views
Alexshea
Contributor III

@xiangjun_rong Hi, I tried what you said to calculate average values of adc channels, but when I use for loops, I don't receive any adc values. You told me to set #define TOTAL_AVERAGE_NUMBER 2, but even setting it 2 didn't help. I don't use adc interrupt in this code, since  all the 8 adc channels are used and it seems that the for loops don't work either. Could you please once again check my code and help me resolve this issue.

Thanks in advance, 

Alex

Labels (1)
0 Kudos
Reply
2 Replies

803 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Sorry for the delay.

I suggest you use interrupt mode to read ADC result instead of polling mode, the ADC polling mode wastes a lot of time for the core.

Hope it can help you

BR

XiangJun Rong

0 Kudos
Reply

796 Views
Alexshea
Contributor III

@xiangjun_rong Hi, thanks for the answer. Well, I've tried interrupt before, but I was able to work with only 2 ADCs and when I activated the third ADC the code stopped and locked and didn't execute. I didn't know what to do. I was wondering if you modify my code and add interrupt I can't work with interrupt while using all ADC channels myself

0 Kudos
Reply