Hello, and welcome to the forum.
If you wish to use continuous conversion mode, the ADCSC1 register should be written only once, perhaps within the initialisation, to start the first conversion. If you write to this register when a new conversion has already started, that conversion will be aborted. I wonder if this is the problem that you are observing? The initialisation code should also set the ADCCFG register, as well as the pin control register APCTL1, both prior to starting the conversions.
The main loop might contain the following code for continuous conversion mode -
for ( ; ; ) {
__RESET_WATCHDOG();
while (!ADCSC1_COCO); // ADC conversion complete?
PTBD = ADCRL; // output 8bit ADC to Port B
...
}
However, for polling operation I might generally choose not to use continuous conversion, but to explicitly start each new reading following processing of the previous reading. The ADCCFG and APCTL1 registers would still need to be setup during during initialisation.
for ( ; ; ) {
__RESET_WATCHDOG();
ADCSC1 = 0; // Commence new conversion Ch0
while (!ADCSC1_COCO); // ADC conversion complete?
PTBD = ADCRL; // output 8bit ADC to Port B
...
}
Since each write to the ADCSC1 register will start a new reading (and abort the previous one) it is good practice to simultaneously write all bits of the register, rather than set or clear individual bits.
Finally, note that it is pointless to enable pullups on a dedicated output port.
Regards,
Mac