cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030C: SPI Slave at 13.5 MHz with GPIO_Speed = Low for EMI reduction?

MERSI
Associate III

Hello everyone,

I am currently working on a project using the STM32F030C, and I have a question regarding the GPIO speed configuration (slew rate) for SPI pins.

Here is my setup:

  • MCU: STM32F030C

  • Interface: SPI (configured as Slave)

  • SPI Clock Frequency: 13.5 MHz

To keep EMI (Electromagnetic Interference) emissions as low as possible, I was considering setting the GPIO output speed for the SPI pins (specifically MISO, since the MCU is the slave) to GPIO_Speed_Level_Low.

However, according to the datasheet (see attached screenshot), the "Low" speed setting is specified for a maximum frequency of 2 MHz.

My questions are:

  1. Is it practically possible to run a 13.5 MHz SPI signal with the GPIO speed set to Low, despite the datasheet specs?

  2. Does this pose a high risk of corrupted/poor communication due to the slew rate being too slow (e.g., degraded signal integrity, failing to meet setup/hold times for the master)?

  3. Has anyone here tried this approach to reduce EMI at similar frequencies, or is it strictly recommended to bump the GPIO speed to Medium/High for 13.5 MHz?

Any insights or shared experiences would be highly appreciated.

Thanks in advance!

 

image.png

image.png

2 REPLIES 2
waclawek.jan
Super User

> Does this pose a high risk of corrupted/poor communication due to the slew rate being too slow (e.g., degraded signal integrity, failing to meet setup/hold times for the master)?

Yes.

Note, that attempting to do this *may* appear to work; however, the pin's slew rate changes with temperature (and VDD) and also with process variation (i.e. every piece is slightly different) and the datasheet values are guaranteed worst case.

JW

Andrew Neil
Super User

@MERSI wrote:
  1. Is it practically possible to run a 13.5 MHz SPI signal with the GPIO speed set to Low, despite the datasheet specs?


Think about the numbers: 

13.5 MHz has a period of 77ns: that's not going to work with 125ns rise and fall times - is it?

You could easily try it, and observe with an oscilloscope what you get ...

But note @waclawek.jan's warning about test conditions and process variations.

 

In general, you should always do what the datasheet tells you - those are the guaranteed performance conditions.

 


@MERSI wrote:

the "Low" speed setting is specified for a maximum frequency of 2 MHz.


and you want to go at over six times that speed ?!

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.