This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cant read ADC on port 1

Hi

I need some help figuring out how to read the ADC on port 1 (channels 16-23) of an ST10F276. I am using the uVision simulator.

So far I can only read channels 0-15 (port 5). The following is the test code that I am using. I think that it should read from channel 16 (port 1.0) of the GUI peripheral window, but it reads from channel 0.

To clarify that a bit more, the uVision simulator provides a GUI for the ADC with 24 channels. I am assuming that channels 0-15 are for port 5 and 16-23 are for port 1.

Thanks for any help.

void main ( void )
{

//XPEN = 1; // XPEN is in SYSCON, set in START167.A66. //XPERCON |= 0x0800; // set XMISCEN. set in START167.A66. XP1DIDIS = 0x00FF; // protect analog from digital disturbances //initialize port 1 XMISC |= 1; // ADCMUX = 1; set bit 0 to make P1 analog input port. ADCON |= 0xB000; // Sets sample time of 30us (maximum possible), // enables A2D, fixed single conversion mode, channel 0 // enable conversions ADCON &= ~BIT6; // enables ADC ADST = 1; // start 1st ADC

while(ADBSY); // verify ADC is not busy

while(1);

}

0