2.1 设置极性为1时,采样数据不稳定:
初始化代码过程如下:
- MX_GPIO_Init();
- MX_SPI2_Init();
- MX_TIM2_Init();
- /* USER CODE BEGIN 2 */
-
- HAL_Delay(100);
- /* µÈ´ýÉϵçÎȶ¨£¬µÈ»ù×¼µçѹµç·Îȶ¨, BSP_ADS1255_Init() ÄÚ²¿»á½øÐÐ×ÔУ׼ */
- BSP_ADS1255_Init();
- ADC_ID = BSP_ADS1255_ReadID();
- BSP_ADS1255_Config(ADS1255_GAIN_2, ADS1255_10SPS); /* ÅäÖÃADC²ÎÊý£º ÔöÒæ1:1, Êý¾ÝÊä³öËÙÂÊ 100Hz */
-
- HAL_TIM_Base_Start_IT(&htim2);
-