Skip to main content
ledi001
Associate III
August 26, 2019
Question

Problems with using SPI and I2C together

  • August 26, 2019
  • 3 replies
  • 1156 views

Hi,

i am using a NUCLEO STM32L412 board and i want to use SPI and I2C together.

Every bus works for itself - this is OK.

But when i measure the signals, i get SPI clock signal on SDA and vice versa the SDA Signal on SPI SCK. I initialized with CubeMx.

Here my connections:

PA12 - SPI1 MOSI

PA11 - SPI MISO

PA5 - SPI SCK

PB6 - I2C SCL

PB6 - I2C SCL

Attached a scope image (SPI CLK = channel 2)

This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
August 26, 2019

>>NUCLEO STM32L412 

Which ONE, the 64-pin NUCLEO-L412RB or 32-pin NUCLEO-L412KB?

Check what code CubeMX generated, and the Alternate Function associated against each pin vs documentation in the Data Sheet.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
ledi001
ledi001Author
Associate III
August 26, 2019

It is the 32-pin...

S.Ma
Principal
August 26, 2019

check the schematics, there maybe some solder bridge options and maybe an "arduino" LED on SCK which may drop the voltage amplitude.