2023-10-26 01:40 AM - last edited on 2023-10-26 05:16 AM by Peter BENSCH
I am using STM8S003F3.
If the supply voltage of STM8S003F3 is 3.3v, the ADC works well.
However, if you apply a supply voltage lower than 3.3V, the ADC will not work.
I hope the ADC works well at 3.0V.
For reference, I know that the minimum supply voltage of STM8S003F3 is 2.9v.
Is it possible to fix this problem by modifying the coding?
Below is my ADC coding.
version
* @file stm8s_adc1.c
* @author MCD Application Team
* @version V2.1.0
* @date 18-November-2011
* @brief This file contains all the functions/macros for the ADC1 peripheral.
void ADC_Config(void)
{
GPIO_Init(GPIOD, GPIO_PIN_5, GPIO_MODE_IN_FL_NO_IT);
ADC1_DeInit();
ADC1_Init(ADC1_CONVERSIONMODE_CONTINUOUS, ADC1_CHANNEL_5, ADC1_PRESSEL_FCPU_D2,
ADC1_EXTTRIG_TIM, DISABLE, ADC1_ALIGN_RIGHT, ADC1_SCHMITTTRIG_CHANNEL6,
DISABLE);
/* Enable EOC interrupt */
ADC1_ITConfig(ADC1_IT_EOCIE, DISABLE);
ADC1_Cmd(ENABLE);
/*Start Conversion */
ADC1_StartConversion();
}
2023-10-26 07:19 AM
> the ADC will not work.
In what way does it not work? Does it give wrong values (if so, how)? Does it reset? Does it wait for some flag to be set?