Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/09/03 14:00
Read: times


 
#36031 - RE: 12-bit adc
Hi Michael


I have used that filter code (that I posted above) blindly for quite a while ,but have had no problems with it...
Anyway..
I re-wrote the code to the method which you use , then burnt them both to a chip to see what the difference would be when filtering the same data taken from an ad1286.

There was no difference in the data put to the LCD..
And on the downside, your scheme uses twice as much RAM...
but on the upside , it saved a whopping 1k of memory when 4 filters are used at the same time.
So a big thanks to Michael...

the code I used was...

U16 mk_filter0(U16 value){

flt1_sum -= flt1[flt1_index]; //subtract oldest
flt1_sum += value; //add newest
flt1[flt1_index]=value; //store new
flt1_index++; //increment index
if(flt1_index>15)flt1_index=0; //wrap if needed
return((flt1_sum/16)); //divide by number of table elements
}





List of 16 messages in thread
TopicAuthorDate
12-bit adc            01/01/70 00:00      
RE: 12-bit adc            01/01/70 00:00      
RE: 12-bit adc            01/01/70 00:00      
RE: 12-bit adc            01/01/70 00:00      
RE: 12-bit adc            01/01/70 00:00      
RE: 12-bit adc            01/01/70 00:00      
RE: 12-bit adc            01/01/70 00:00      
RE: 12-bit adc - Mike            01/01/70 00:00      
RE: 12-bit adc - Mike            01/01/70 00:00      
RE: 12-bit adc - Erik / Steve            01/01/70 00:00      
RE: 12-bit adc - Erik / Steve            01/01/70 00:00      
RE: 12-bit adc            01/01/70 00:00      
RE: 12-bit adc / Rob            01/01/70 00:00      
RE: 12-bit adc / Rob            01/01/70 00:00      
RE: 12-bit adc / Rob            01/01/70 00:00      
RE: 12-bit adc / Rob            01/01/70 00:00      

Back to Subject List