0

I am new to working with STM32 Microcontrollers. When I analyze the SPI Communication I get the clock signal, which you can see in pic 1 below. The clock is jumping between a frequenzy of 1.333 MhZ and 2 Mhz. I also used STM32DUINO with a basic Arduino SPI snippet and testet it with the Arduino Uno. With the Uno the clock is working properly. I also changed the SPI Channel of my STM32 board from SPI1 to SPI3. Both isn't working.

I used the normal configurator which CubeIDE has (Pic 2). Here is my STM32CubeIDE code:

  HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET);
  HAL_Delay(10);
  HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_RESET);
  HAL_SPI_TransmitReceive(&hspi3,(uint8_t *) 0xA1, (uint8_t *) spi_buf, 1, 100);
  HAL_GPIO_WritePin(GPIOA, GPIO_PIN_4, GPIO_PIN_SET);

SPI on Nucleo-H743ZI

SPI Settings

Thank you for your help in advance!

kanduko
  • 1
  • 2
  • 1
    It can be a sampling problem. Please see this question: https://stackoverflow.com/questions/65438405/stm32-hse-unstable-frequency – Tagli Dec 28 '20 at 18:13
  • That's it! Thanks! But I still have the problem, that I don't see the 0xA1 on the analyzer but a 0xB5. But that's another question. :D – kanduko Dec 28 '20 at 18:29
  • Maybe it's the Phase setting. Try changing it in the analyzer settings. – Tagli Dec 28 '20 at 19:38

0 Answers0