I have followed all the steps as you mentioned. Still didn't get any response.
Here I'm attaching my code so that you may find any mistake.
//Clock has taken from PLL settings(driver already written) and my CPU clock is 180MHz.
In errata sheet it is mentioned that keep all ports in digital mode and then asked to use analog when needed.
Function to keep digital mode and disable clock for ADC:
void disable_all_adc()
{
IOCON->PIO[0][10]|=(1<<8);
IOCON->PIO[0][11]|=(1<<8);
IOCON->PIO[0][12]|=(1<<8);
IOCON->PIO[0][15]|=(1<<8);
IOCON->PIO[0][16]|=(1<<8);
IOCON->PIO[0][31]|=(1<<8);
IOCON->PIO[1][0]|=(1<<8);
IOCON->PIO[2][0]|=(1<<8);
IOCON->PIO[2][1]|=(1<<8);
IOCON->PIO[3][21]|=(1<<8);
IOCON->PIO[3][22]|=(1<<8);
IOCON->PIO[0][23]|=(1<<8);
SYSCON->PDRUNCFG[0]|=(1<<9)|(1<<10)|(1<<19)|(1<<23);
}
Function to initiate ADC:
void adc_init(void)
{
SYSCON->AHBCLKCTRL[0]|=(1<<13); //IOCON power up
disable_all_adc(); //disable function calling
SYSCON->PDRUNCFG[0]&=~(1<<9)|(1<<10)|(1<<19)|(1<<23); //powering up ADC and related pins
SYSCON->PDRUNCFG[1]&=~(1<<3);
delay(20000); //To generate atleast 20uS delay
SYSCON->AHBCLKCTRL[0]|=(1<<27); //Enabling clock
SYSCON->PRESETCTRL[0]&=~(1<<27); //Clearing reset
ADC0->SEQ_CTRL[0]|=(1<<31); //Enabling sequence A
ADC0->CTRL|=0x02; //Clock division by 3: 60MHz returns
ADC0->CTRL&=~(1<<8); //Synchronous mode selected.
ADC0->CTRL|=(1<<9)|(1<<10); //12 bit resolution
ADC0->CTRL|=(1<<12)|(1<<13)|(1<<14); //TSAMP 9.5ADC clock cycles
ADC0->SEQ_CTRL[0]&=~(1<<31); //Disabling sequence
ADC0->SEQ_CTRL[0]|=(1<<0)|(1<<31); //Channel 0 selection and enabling ADC-A seq
ADC0->SEQ_CTRL[0]&=~(1<<27); //Disabling burst mode
SYSCON->PDRUNCFG[0]&=~(1<<6); //powering up internal temperature senor
ADC0->INSEL=0x03; // Selecting temperature sensor to ADC0
IOCON->PIO[0][11]&=~((1<<8)|(1<<3)|(1<<2)|(1<<1)|(1<<0)); //IOCON Inactive mode,inverting disabled
IOCON->PIO[0][11]&=~((1<<5)|(1<<4)); //Analog mode
}
That's how initialization done.
In main function :
int main()
{
clock_init(); //Driver code.(It's working fine)
adc_init(); //Calling adc initialization
while(1)
{
ADC0->SEQ_CTRL[0] |= (1<<26); // start conversion
if(scan<=samples) //Scan and samples(200) are variables
{
while(((ADC0->SEQ_GDAT[0])&(1U<<31))!=1);
result+= (ADC0->DAT[0]>>4)&0xFFF;
}
scan++;
if(scan==samples)
{
out = (float) ((result *3.3)/4095);
scan=1;
}
}
}