cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO output speed register setting

David_
Senior

How to set GPIO output speed register (slow, medium, fast, very fast) in accordance to SPI and the slower I2C, clock speeds respectively?   The data sheet specify in rise/fall time. Is it correct that the register actually set drive current?

SPI clock at 6MHz is 83ns high and 83ns low.  Should we aim to make rise/fall time a "certain percentage" of 83ns?  If so, how much?

Part is STM32WLE5JCI6TR,

SPI bus has two external devices. Pin capacitance is about 5pF per device, presumably the MCU alos count as one, plus 5pF for PCB. That will be 20pF.  When putting a scope X10 passive probe will add 15pF.  Total 35pF. Still under the 50pF on data sheet. SPI clock about 6MHz.

I2C has one external device. Clock is 100 to 400kHz.

Many thanks

10 REPLIES 10

Data sheet says, "The GPIOs can sink or source up to ±8 mA, and sink or source up to ± 20 mA (with a
relaxed VOL/VOH).".   There is no time value in this spec.  May be it refers to continuous current rating before the pad heat up and burn. 

On switching, push pull pin may output more than 20mA to charge or discharge the load (capacitance of receiving chip plus pcb stray capacitance)

On I2C, open drian configuration, rise time is limited by the pull up resistor, 4k7 and 10k means around half a mA.  Fall time for signal driven by the MCU at that time, depends on speed setting (drive current or slew rate)