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.

623 B

ADC

  • 可选配置RCCHigh Speed Clock配置为Crystal/Ceramic Resonator
  • 可选Clock ConfigurationPLL Source Mux选择HSEX9System Clock Mux选择为PLLCLKAPB1 Prescaler选择/2ADC Prescaler选择/6
  • 给PA5选择ADC1_IN5在AnalogADC1中
    • 配置Continuous Conversion Mode为Enable这样转换会一直进行不用每次手动触发
    • 配置Rank - Sampling Time为239.5Cycles,这样采样时间长,数据更稳定
  • 配置USART2Mode配置为Asynchronous用于输出ADC数据
  • 先HAL_ADC_Start打开ADC转换
  • 再通过HAL_ADC_GetValue获得ADC结果