Seems like you're saying that you went with what I listed as option (2). = =20 Which I have started doing as well. I'm also doing an interpolated looku= p=20 like you. Read 16 samples of 10 bits, continuously summing them (so I ha= ve=20 16 bits now), then lookup the table (256 values) for the upper 8 and the=20 upper 8 + 1. Then interpolated proportionally based on the lower 8. I'v= e=20 found that only 3 or 4 bits on the lower is enough, but overkill is fine. I'm using a 16F872 though, and have room for 512 lookup values, so consid= ering=20 that. Cheers, -Neil. On Thursday 31 July 2003 01:56, Bob Axtell scribbled: > I know what you are getting at. I had a similar situation. > > In my case, I was extracting 24bit strain-guage values and calculating = the > engineering > value (weight in kg). The math was bewildering and took too much time. = The > strain-guage and the PIC / A/D involved formed a UNIT as far as the HOS= T > was concerned. > The problem was that I had errors from so many different sources that t= he > math was Min/Max (the possible solutions, rather than an ACTUAL solutio= n). > Here's what solved everything: > > A test fixture was fabricated that subjected our SENSOR/PIC unit under > known pressures at fixed points. For example, a value at 00.1Kg was app= lied > and the PIC measured results captured (from the PIC) and stored on a lo= cal > HOST computer. For each value from 00.1kg to 99.9kg the values were > extracted automatically (using a hydraulic press to ensure constant for= ce). > Then the PIC was loaded with a 1000-place PGM MEM table, using almost 1= K of > program memory space. The 24b value was shaved so that the LS 10 bits w= ere > ignored except that when the table was built, were round up or down to = the > next useable bit. Loading this table became a permanent part of that UN= IT, > and it took a few minutes to upload and FLASH in the values. But it onl= ty > had to be done ONCE. > > When a value was received, the lookup routine rummaged through the list > until it discovered what UPPER and LOWER values the value received. The= re > were two versions of this software, i.e. a 4-digit version (99.99kg) an= d a > heavier 6-digit version for larger strain-guages (9999.99kg). To obtain= the > last digit value between the upper and lower points, we took the LS 10b= its > and cranked on them to interpolate the last digit. In that way, only a > 1000-place table was needed so it easily fit into a 2K PIC16F876. > > Sounds complicated, but is the easiest way home because it compensates = for > EVERYTHING in the UNIT: PIC, resistors, strain-guage, 24b A/D converter= , > local 5V supply, and bad teeth. It worked VERY well. > > --Bob -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads