From 664c61026ee0f67525a9501a13033cff9ef7b200 Mon Sep 17 00:00:00 2001 From: Maximilian Grau Date: Mon, 1 Nov 2021 16:56:31 +0100 Subject: [PATCH] Reduce SPI signal speed --- cubemx/Core/Src/spi.c | 2 +- cubemx/voc-sensor.ioc | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cubemx/Core/Src/spi.c b/cubemx/Core/Src/spi.c index af3b4e8..8845976 100644 --- a/cubemx/Core/Src/spi.c +++ b/cubemx/Core/Src/spi.c @@ -82,7 +82,7 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* spiHandle) GPIO_InitStruct.Pin = GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; GPIO_InitStruct.Alternate = GPIO_AF5_SPI2; HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); diff --git a/cubemx/voc-sensor.ioc b/cubemx/voc-sensor.ioc index f87477d..d1c2a82 100644 --- a/cubemx/voc-sensor.ioc +++ b/cubemx/voc-sensor.ioc @@ -93,10 +93,16 @@ PB11.Signal=GPIO_Output PB12.GPIOParameters=GPIO_Label PB12.GPIO_Label=DisplayCS PB12.Signal=GPIO_Output +PB13.GPIOParameters=GPIO_Speed +PB13.GPIO_Speed=GPIO_SPEED_FREQ_MEDIUM PB13.Mode=Full_Duplex_Master PB13.Signal=SPI2_SCK +PB14.GPIOParameters=GPIO_Speed +PB14.GPIO_Speed=GPIO_SPEED_FREQ_MEDIUM PB14.Mode=Full_Duplex_Master PB14.Signal=SPI2_MISO +PB15.GPIOParameters=GPIO_Speed +PB15.GPIO_Speed=GPIO_SPEED_FREQ_MEDIUM PB15.Mode=Full_Duplex_Master PB15.Signal=SPI2_MOSI PinOutPanel.RotationAngle=0