mirror of https://gitee.com/gaohongy/stm32.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
2 years ago | |
---|---|---|
.. | ||
.settings | 2 years ago | |
Core | 2 years ago | |
Debug | 2 years ago | |
Drivers | 2 years ago | |
.cproject | 2 years ago | |
.mxproject | 2 years ago | |
.project | 2 years ago | |
ADC_Potentiometer Debug.launch | 2 years ago | |
ADC_Potentiometer.ioc | 2 years ago | |
Readme.md | 2 years ago | |
STM32F103C8TX_FLASH.ld | 2 years ago |
Readme.md
ADC
- (可选)配置RCC,High Speed Clock配置为Crystal/Ceramic Resonator
- (可选)Clock Configuration,PLL Source Mux选择HSE,X9,System Clock Mux选择为PLLCLK,APB1 Prescaler选择/2,ADC Prescaler选择/6
- 给PA5选择ADC1_IN5,在Analog,ADC1中
- 配置Continuous Conversion Mode为Enable,这样转换会一直进行,不用每次手动触发
- 配置Rank - Sampling Time为239.5Cycles,这样采样时间长,数据更稳定
- 配置USART2,Mode配置为Asynchronous,用于输出ADC数据
- 先HAL_ADC_Start打开ADC转换
- 再通过HAL_ADC_GetValue获得ADC结果