Hi Adam, =20 > If you continue to use your current design I believe you'll obtain the = accuracy you need=20 > except for the temperature compensation issues. The simple fact is that= unless you calibrate=20 > onsite at the current temperature, you may be off by as much as 0.8 deg= rees just due to=20 > temperature variations. Using the 213 moderates it somewhat since the m= easurement is=20 > relative - you could say that a little compensation is built into the d= uty cycle modulation. =20 Thanks for pointing that out. I found a design note on Analog's site on h= ow to embed temperature information in a PWM output using a TMP36. The on= ly problem is that I can't order samples of it or order it from Farnell i= n a SOT23 package, so I'll use a TMP37 instead. It has 20mV/=B0C instead = of the 10mV/=B0C the TMP36 has. Now if I only could figure out how T2 is = related to the voltage over Rset :). =20 > In my case I used 4.7uF caps and a 1.2Mohm resistor on the 213. This gi= ves about a one=20 > second response time to changes, and counting the duty cycle at around = 250kHz (ie, the=20 > counter increments 250k times per second to find the size of the pulse)= gave me the 0.1=20 > degree resolution I needed. Since this device is expected to be re-zero= ed before each use I=20 > didn't need to worry about temperature compensation. =20 Just to see if I understand, T2 is 104kHz with Rset 1.2Mohm, right? How e= xactly do you calculate the resolution? Since I've got to know the exact = angle the sensor has in relationship to the earth and because I can't be = sure it will be on a flat surface when in use, I can't rezero it before e= ach use. =20 > Then it gets interesting. Unfortunately this part of the exercise is le= ft up to the reader. You=20 > can simply use those numbers directly, but the duty cycle is formed fro= m a triangle wave,=20 > which complicates matters when you need high accuracy. Further, doing a= n inverse tangent=20 > function (ATAN2) is not trivial in an 8 bit microcontroller. In my case= I used a calculation, but=20 > a table with interpolation would likely be easier for the lower end mic= ros, and if done well will=20 > give you the needed accuracy. =20 How exactly does it complicate things when needing high accuracy? I can u= se pretty much any =B5C I want (well, as far as I'm able to program it of= course), because size isn't really a problem for the =B5C board. So I mi= ght use a PIC18 so that I can use a high order Taylor approximation (well= , that or a big lookup table). =20 > Check out the documents on analog's site. They have some good algorithm= s. Yes, indeed, I've found some interesting stuff. =20 > I assumed that long wire length given the environment my device is goin= g into would cause=20 > too many problems with noise to get the needed accuracy. Further I was = using 3.3v which=20 > gives a poor signal to noise ratio on the line. I never tried it though= , and it may work out just=20 > fine depending on the environment, cable, etc. I put a small microcontr= oller next to it which=20 > did all the timing, and sent a simple checksummed data and clock signal= to the display=20 > where the real calculations are done. =20 Oh, then I think I'll probably be fine, because there won't be a lot (if = any) noise and I'll also be using 5V. =20 > Good luck! Thanks, Anthony Website: http://members.lycos.nl/anthonyvh =09 --------------------------------- Do you Yahoo!? Yahoo! Mail - now with 250MB free storage. Learn more. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist