how to feed 1v? is that any voltage regulator available for 1v.what about the -ve side.
Well, anyway you like really. The simplest way is a voltage divider but then the stability and accuracy of you reading depends on the stability of the powersupply rail, which it does when you're using the Vdd/Vss for Vref anyway.

The voltage supplied to Vref- is what will equal a returned value of 0 from the ADC, the voltage supplied to VRef+ is what will equal a returned value of 1023 from the ADC. So by feeding 1V to Vref- and 5V to Vref+ the ADC's 10 bits gets divided across 1-5V instead of 0-5V as is the case when you use Vss/Vdd as reference. (As long as you use 5V supply of course). Read up on the ADC section of the datasheet for details about the ADC.

I can't help with your problem as I have absolutely no idea how you've coded it.

/Henrik.