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.

ads1230 interfacing 8052

Other Parts Discussed in Thread: ADS1230

Dear Bob,

   As from your information i tried different averaging techniques for adc.And finally i tried one moving average method it seems fine and easy.It uses floating point.But i need your suggestion to know,that how much efficient it is.My averaging looks like:

long mov_avg(void)

{

ave_data=datas();   //updated ADC value(new sample);

diff=(ave_data - run_avg)/4;  //diff is a float datatype(run_avg is previous average);

run_avg += diff; //adding or subtracting the difference to or from run_avg;

ave_data = run_ave; //ave_data is an int datatype;

return(ave_data);

}

This program take much settling time.So i think the "run_avg" need to replace with current sample if there is a large step change,am i right.But how much difference  should i take.So if i m taking the difference should i include the "standard deviation" of ADC.Then what is the "standard deviation" for ADS1230.

Please give me some suggestions,..expecting your valuable reply..

Thank you

by Ajit..

  • Ajith,

    Floating type arithmetic usually takes a long time (processor cycles).  If you can tolerate the LSB potentially being lost (like noise), you can keep everything as int type and right shift the result by 2 (divide by four).  You have to be careful with negative values so that they sign extend properly.

    One thing you could do with a step change, is reset the running average to the new data and start the averaging again from that point.

    Best regards,

    Bob B