Hello
Some things to check, that may help in debugging.....
Are the VRH and VRL ATD reference voltages in spec?
When the code runs, do any of the CCF bits in ATDSTAT1 get set?
Does the SCF flag in ATDSTAT0 get set?
If the flags indicate a conversion has completed, check the contents of the ATDDRH/L registers after conversion.
Do these contents make sense? Do they make sense applying full scale and zero at the input pin?
ATD0CTL5 = 0xB8
Why does the code write a "1" to ATD0CTL5[3]? This bit is unimplemented.
ATD0CTL4[[7]=SRES8. In the code this is clear for 10-bit resolution.
ATD0CTL5[7] = DJM. In the code this is set, for right justified, but only the ATDDRL register is used, thus the 2 most significant bits are ignored. Is this intended?
DPB