asking for help

So while working or my project ,i’ve came across some difficulties one of them is that the potentiometer that i’m using “doesn’t work” ; it’s connected to A0 and keep getting 5 (BTW i’m using the map function to convert the 0-1023 scale to a 0-5 scale) no matter how i change it gives me the same result. So i was wondering what i did wrong so tried the same code in the arduino UNO and it worked but when i use it with the MEGA2560 it doesn’t .
And I keep getting thi message: PC=0x06C8. [AVR AD CONVERTER] Reference value = 0. [ARDUINO MEGA 2560#0001]
can anyone help ?

When are you getting the message? Where are you getting the message?
What value is your potentiometer? How is it connected?

What is your code? Please post it properly, including the use of the Arduino IDE autoformat feature and the use of code tags.

Much more information is needed.