cancel
Showing results for 
Search instead for 
Did you mean: 

Clock pins when running on internal clock

ER7
Associate II

Is it ok to leave the pins floating ?

Any other recommendation ?​

2 REPLIES 2

No different than any other pin. Leaving it floating is generally not advised (especially if you care about consumption).

It's best to ground the unused pins through a 10K pull-down resistor and set them as analog inputs to disable the Schmitt triggers on the pins (which are required when the pin is in the default digital input state).

AN3430 ( https://www.st.com/content/ccc/resource/technical/document/application_note/77/74/4f/da/9b/9c/43/e7/DM00033348.pdf/files/DM00033348.pdf/jcr:content/translations/en.DM00033348.pdf ) recommends this:

  • At the startup of the application:
  1. Enable all GPIO clocks
  2. Configure all I/Os in analog input mode
  3. Disable all GPIO clocks
  • In the main application:
  1. Enable the required GPIO clock
  2. Configure the required I/Os on the application
  • I/O configuration trick:
  1. If the user application just needs the I/Os to configure it as a peripheral alternate function in order to output or input signals (no read or write from/to GPIO registers), we recommend disabling the associated GPIO clock of the used I/Os after configuration. In this case I/O signals are still available and we optimize the GPIO current consumption by disabling its clock.
  • I/O toggling frequency:
  1. When configuring the I/O, pay specific attention to the I/O speed value configured in OSPEEDR (2 MHz, 10 MHz, 25 MHz, 50 MHz and 100 MHz). Current consumption is as high as the I/O toggling frequency, so, to optimize current consumption, OSPEEDR should be configured with the lowest possible value.
ER7
Associate II

​Thanks !

I forgot to mention in my question that i meant "floating" in hardware aspect

Regarding the analog input - of course !

Thanks anyway ! :)