I wrote a program to interface a joystick with ADC10. During Debug, it's found that the content of ADC10MEM doesn't change (constant 0x0006), which means that it reads an invalid value somewhere but I cannot figure out where is wrong with my code. Could someone please help me with that? Thank you.
The code is here.
The whole process is reproduced in this video (Sorry for the low quality. I took it by myself):