Started by October 5, 2003
 Hello, I'm using the PIC16f818 and have a question that probably has an obvious answer. I'm reading a value on the 10-bit ADC and need to convert it according to the equation y = 1.953(ADC value) - 1000. Is this as it seems? Do I need to multiply by 1953 (a 16*16 bit mulitply), divide by 1000 (a 32/16 bit divide) and do a double precision subtraction. Seems like a lot of code. Am I missing anything obvious before I start using the Microchip routines to code this? Thanks, Tim
 If that is really the result you need, I don't think you are missing anything. Realize, that carrying the 10 bit accuracy through to the solution, results in a theoretical error of less than 0.1 percent. A lot of work, but an accurate result. In the real world, you only need to be as accurate as is necessary to get the job done. Chad --- tjroland2002 <> wrote:> Hello, > > I'm using the PIC16f818 and have a question that probably has an > obvious answer. > > I'm reading a value on the 10-bit ADC and need to convert it > according to the equation y = 1.953(ADC value) - 1000. > > Is this as it seems? Do I need to multiply by 1953 (a 16*16 bit > mulitply), divide by 1000 (a 32/16 bit divide) and do a double > precision subtraction. Seems like a lot of code. Am I missing > anything obvious before I start using the Microchip routines to code > this? > > Thanks, > > Tim __________________________________