With 1 2.5V reference (again), you could hypothetically do a divide and conquer approach. Set the VRef+ to 2.5V, do the conversion. If the result is < 1023, it is < 2.5V, and you have your number. If it is >= 1-23, then set VRef- to 2.5V, and do another ADC, If the result is exactly 0, then the input is exactly 2.5V.... This assumes that the input does not change between the first and second ADC. In essence, you add a bit to the ADC to get an 11bit conversion. There are bound to be other small errors that creep in though, and your conversion quality may not be increased to a reliable 11 bit process (ADC performance may in fact decrease). It would probably be equally accurate to just ignore the 2.5V reference, and do a full range ADC (0-5V), and then multiply by 2 to get the ADC scaled to the 2048 bit output resolution. Rolf Andre Abelian wrote: > Tom, > > Previews guy did it by using pic internal ADC. Another problem is > that the design is already done and I can't change it. > Can you explain more detail ? > > thanks > > Andre > > > Tom Sefranek wrote: > > >> Your looking for a 12 bit (11bits actually) A-D. >> Then some bit manipulation. (Math). >> >> Andre Abelian wrote: >> >> >> >> >>> Rolf, >>> >>> thanks for your replay. Using Vref is very good idea but in my case the >>> situation is lot more >>> complicated. This is how it should be: >>> >>> 0-2,4v output 0-1023 with 2's complement format and enable a bit >>> 2.6-5.0v output 0-1023 disable the bit. While it is in between 2,5v >>> should output 0 >>> >>> any idea? >>> >>> thanks for your help >>> >>> Andre >>> >>> >>> >>> >>> >>> >>>> Andre Abelian wrote: >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>> Hi to all, >>>>> >>>>> I need to convert ADC 0-2,5v result to 0-1023 output to uart. >>>>> I am kind of lost how to do this should I add result x 2? >>>>> any help will appreciate. >>>>> >>>>> thanks >>>>> >>>>> Andre >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> You need to get 2.5V on the Vref+ pin, and use that for the 10bit >>>> conversion. The challenge is then to get a 2.5V reference.... ;-) >>>> >>>> On PIC18 devices see the ADCON1 register bits VCFG0 and VCFG1 >>>> >>>> on PIC16's see the ADCON1 register's PCFG bits. >>>> >>>> Rolf >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>> >>> >>> >> >> >> > > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist