Electronic – STM32 GPIO Speed

stm32

Why do we need to set speed for GPIO Output pins in STM32?

Just for remind :

For Input pins, The STM32F4 Reference Manual on page 278 says that:

The data present on the I/O pin are sampled into the input data register every AHB1 clock cycle.

So for the GPIO pins when they are used as INPUT, speed is Constant and equals to AHB1 Clock.

But if they are configured as Output we have to set their speed, So the question is what does it mean to a pin to have several speed modes when its is configured as Output?

Best Answer

STM32F4-Refrence Manual in page 278 says that "The data present on the I/O pin are sampled into the input data register every AHB1 clock cycle"

This text is referring to input pins, not outputs.

The output speed register only affects pins which are configured as outputs. It controls the slew rate (drive strength) used for the output. Using an excessively high speed may cause ringing and EMI on outputs, so it is important to use the minimum speed required for your application.