warnke.doug.001

ADC ISSUE

Discussion created by warnke.doug.001 on May 24, 2017

Hello,

I'm using the STM8AL Discovery board. Im trying to get the ADC working using the ST drivers. When I initialize the code Nothing shows up in the ADC registers. Below is my initialization code:

 

/* --- ADC --- */
// Initialize the IO
GPIO_Init(GPIOA,GPIO_Pin_6,GPIO_Mode_In_FL_No_IT);

 

// Initialize the ADC
ADC_Init(ADC1, ADC_ConversionMode_Single, ADC_Resolution_12Bit, ADC_Prescaler_2);
ADC_SamplingTimeConfig(ADC1, ADC_Group_SlowChannels, ADC_SamplingTime_96Cycles);

// Enable ADC1
ADC_Cmd(ADC1, ENABLE);

 

// Enable ADC1 Channels 0
ADC_ChannelCmd(ADC1, ADC_Channel_0, ENABLE);

 

// Enable ADC Interrupt
ADC_ITConfig(ADC1, ADC_IT_EOC, ENABLE);

 

Yet none of the ADC registers are getting written with my Initialization.

 

Does anyone know what could be causing this? 

 

Regards,

 

Doug

Outcomes