Im wiring up a STM32L4R5QII6 and am not sure what to do with the OPAMP1_VINM pin. Pin PA7 can be configured as either the OPAMP2_VINM function or the SPI1_MOSI function. The latter is needed so that takes care of that one easy.

PIN PA1 has the function to be OPAMP1_VINM or ADC1_IN6. According to the reference guide, the opamp can be disabled. If we were to disable the opamp what would the proper thing to do with the input be? I've read that for unused opamps you should terminate them properly like configuring them as a follower. Is this the same for a disabled opamp? Im not entirely sure what that means, do they become unpowered? I haven't been able to find anything in the datasheet or the reference guide that helps me.

If we were to configure this pin as ADC1_IN6, should this pin be grounded. Looking at this post I believe I should but it also says there are some pins that may not need to be. Again, cant find much information on these pins. We also are not planning to use the ADC so I think we can leave these floating.

Datasheet: https://www.st.com/content/ccc/resource/technical/document/datasheet/group3/98/80/dc/e5/f8/4b/4b/a3/DM00366448/files/DM00366448.pdf/jcr:content/translations/en.DM00366448.pdf

Reference guide: https://www.st.com/resource/en/reference_manual/dm00310109-stm32l4-series-advanced-armbased-32bit-mcus-stmicroelectronics.pdf


1 Answer 1


Your question doesn't make sense since the opamp is in an MCU. All that stuff has been taken care of for you by the MCU designers.

Just because an MCU pin is labelled as an opamp input doesn't mean it goes only to the op-amp nor does it mean it's actually connected to the opamp if you set the opamp input to be connected to something else (like an internal reference).

Same goes for pins labelled ADC or any peripheral.

If you don't need something on a pin, just don't configure that pin to be that thing. If you don't need an ADC channel, don't enable it.

By default you can just set it to be a GPIO output and set it to a known value if the pin is left disconnected on the PCB, just like most any other unused MCU pin...though they are usually set to be inputs on power-up just so they don't fry something or themselves.

  • \$\begingroup\$ Except for some usually not very noticeable exceptions... Be sure to have a close look to the initial values of those mode registers... \$\endgroup\$
    – Arsenal
    May 14, 2020 at 15:50
  • \$\begingroup\$ So on the datasheet it says PA1 can be configured with additional functions OPAMP1_VINM or ADC1_IN6. Like you said, I don't have to, if I don't need either just set it as a GPIO output and leave disconnected. But there is actually a physically separate pin labeled OPAMP1_VINM (page 83) that says its an input only pin with no alternate functions. So I suspect this pin is actually hardwired to the opamp input.. no? \$\endgroup\$
    – Michael
    May 15, 2020 at 18:37
  • \$\begingroup\$ @Michael That's interesting. I've never noticed such a pin. However, look on 27.3.4 Figure 187 of the reference manual. You should be able to just configure that opamp input to an internal signal. VINM doesn't mean it is always connected to the opamp so much as it means that it is the only thing it can connect to. Although it is configured to be connected to the opamp on power up. \$\endgroup\$
    – DKNguyen
    May 15, 2020 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.