EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: alireza7 on July 28, 2018, 05:06:00 pm

Title: stm32 gpio speed
Post by: alireza7 on July 28, 2018, 05:06:00 pm
hi

 what does the GPIO_Speed setting do?

GPIO_Speed_2MHz  /*!< Low speed */
GPIO_Speed_25MHz /*!< Medium speed */
GPIO_Speed_50MHz /*!< Fast speed */
GPIO_Speed_100MHz

does it change the gpio pin slew rate? or it changes propagation time of gpio pin?

Title: Re: stm32 gpio speed
Post by: Muxr on July 28, 2018, 05:13:14 pm
My understanding is, it does improve the slew rate at the expense of power use and noise being generated by the circuit.

So unless you really need it for a specific reason it's best to use the slower speed.
Title: Re: stm32 gpio speed
Post by: alireza7 on July 28, 2018, 05:20:43 pm
My understanding is, it does improve the slew rate at the expense of power use and noise being generated by the circuit.

So unless you really need it for a specific reason it's best to use the slower speed.

but it's some how odd to me.
how can a digital gate  change its slew rate during operation time??
Title: Re: stm32 gpio speed
Post by: Muxr on July 28, 2018, 05:26:22 pm
My understanding is, it does improve the slew rate at the expense of power use and noise being generated by the circuit.

So unless you really need it for a specific reason it's best to use the slower speed.

but it's some how odd to me.
how can a digital gate  change its slew rate during operation time??
Not only can it change the slew rate it can completely change the mode of operation from using push-pull to open-drain, as well as the configuration of built in pull-ups and pull-downs.

The integrated circuit (STM32) can have this capability. I don't know the exact implementation details on how they accomplish it but I don't think it's that hard to believe that its capable of doing it.

Perhaps ask in the Microcontroller's section. Maybe someone knows the answer.
Title: Re: stm32 gpio speed
Post by: ataradov on July 28, 2018, 05:37:37 pm
I'm just guessing here, but when you select slow or fast mode on Microchip SAM MCUs there is an observable change in the pin series resistance. My best guess is that the idea here is to have an RC filter formed by that variable resistor and the line capacitance.

Again, just guessing and would be interested to know the details myself.

My observation method may not be perfect either. All I did is set the pin as an output driven to 0 and measure the resistance from the pin to ground using a multimeter. Since there is only two settings in SAM MCUs, the results are hard to interpret. May be you can do the same measurement on the STM32?
Title: Re: stm32 gpio speed
Post by: ogden on July 28, 2018, 05:47:11 pm
My understanding is, it does improve the slew rate at the expense of power use and noise being generated by the circuit.

So unless you really need it for a specific reason it's best to use the slower speed.

but it's some how odd to me.
how can a digital gate  change its slew rate during operation time??

FPGA's offer even more trickery with I/O's. If you wanna know how they possibly do it - read patents (https://patents.google.com/?q=output&q=slew+rate&oq=output+slew+rate)

Most likely this is how they do it (https://patents.google.com/patent/US5623216A)
Title: Re: stm32 gpio speed
Post by: Simon on July 28, 2018, 06:16:04 pm
Please don't double post, it is highly disrespectful to people helping you that are not aware of the other thread: https://www.eevblog.com/forum/microcontrollers/stm32-gpio-speed-128753/msg1707167/#msg1707167 (https://www.eevblog.com/forum/microcontrollers/stm32-gpio-speed-128753/msg1707167/#msg1707167)