大家好: 我的ADC初始化如下: void Adc_Init(void) { ADC_InitTypeDef ADC_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; RCC_APB2PeriphClockCmd(RCC_APB2Periph_ADC1 , ENABLE ); //ʹÄÜADC1ͨµÀʱÖÓ RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOA , ENABLE ); //ʹÄÜHGPIOAͨµÀʱÖÓ RCC_ADCCLKConfig(RCC_ADCCLK_PCLK_Div4); //ÉèÖÃADC·ÖƵÒò×Ó4 48M/4=12,ADC×î´óʱ¼ä²»Äܳ¬¹ý14M //PA5 ×÷ΪģÄâͨµÀÊäÈëÒý½Å GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AN; //Ä£ÄâÊäÈëÒý½Å GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL ; GPIO_Init(GPIOA, &GPIO_InitStructure); ADC_DeInit(ADC1); //¸´Î»ADC1,½«ÍâÉè ADC1 µÄÈ«²¿¼Ä´æÆ÷ÖØÉèΪȱʡֵ ADC_StructInit(&ADC_InitStructure); /* Configure the ADC1 in continous mode withe a resolutuion equal to 12 bits */ ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b; ADC_InitStructure.ADC_ContinuousConvMode = ENABLE; ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None; ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; ADC_InitStructure.ADC_ScanDirection = ADC_ScanDirection_Upward; ADC_Init(ADC1, &ADC_InitStructure); // ADC_InitStructure.ADC_Resolution = ADC_Resolution_12b; //ת»»¾«¶È // ADC_InitStructure.ADC_ContinuousConvMode = DISABLE; //µ¥´Îת»»Ä£Ê½ // ADC_InitStructure.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_None; //ת»»ÓÉÈí¼þ¶ø²»ÊÇÍⲿ´¥·¢Æô¶¯ // ADC_InitStructure.ADC_DataAlign = ADC_DataAlign_Right; //Êý¾ÝÓÒ¶ÔÆë // ADC_InitStructure.ADC_ScanDirection = ADC_ScanDirection_Upward; // ADC_Init(ADC1, &ADC_InitStructure); ADC_ChannelConfig(ADC1, ADC_Channel_5 , ADC_SampleTime_71_5Cycles); ADC_GetCalibrationFactor(ADC1);//ADCУ׼ ADC_Cmd(ADC1, ENABLE); //ʹÄÜÖ¸¶¨µÄADC1 /* µÈ´ýADRDY falg */ while(!ADC_GetFlagStatus(ADC1, ADC_FLAG_ADRDY)); /* ADC1 regular Software Start Conv */ ADC_StartOfConversion(ADC1); //¿ªÆôÈí¼þת»» } 现在运行后发现,ADC脚输出3.7V电压,不知道为什么? |
【STM32F0开发日志/评测/笔记】+互补PWM波的产生
STM32F030 PB14和PB15无法输出PWM求助
【STM32F030探索套件】序列之五 外部中断
【STM32F0开发日志---二】+ucosii.2.92移植在STM32F030
上传个STM32F0+5110+内部温度传感器的菜鸟实例
【STM32F030探索套件使用问题】STM32F030 SPI方式驱动ST7565LCD失败
求一份STM32F051 I2C驱动LCD 12864的例程
STM32F0 M0 向结构体赋值进入HardFault异常
STM32F0 ADC-DMA方式采集2路数据时出现问题
STM32F030C8T6,TIM16定时慢很多问题?