I would love to see the whole code with ADCIN. Sometime if you play with some ADC registers, and you place them Before or After the DEFINEs, it may end-up with unexpected results.