Skip to main content
Explorer
April 2, 2025
Solved

AN5306,STM32G431: OPAMP output connected to both ADC's internal channels and external pins

  • April 2, 2025
  • 2 replies
  • 560 views

屏幕截图 2025-04-02 090425.png

在本文的第 32 页,图 38 显示了双电机控制应用的概述。

其中 OPAMP2 通过内部多路复用器连接到 ADC2IN16,

它还输出到外部引脚 PA6,该引脚通过附加线路连接到 ADC1IN1/PA0。

Translation:

"On page 32 of this article, Figure 38 shows an overview of a dual motor control application.

Where OPAMP2 is connected to ADC2IN16 via an internal multiplexer,

it also outputs to external pin PA6, which is connected to ADC1IN1/PA0 via additional lines."

屏幕截图 2025-04-02 090412.png

但是,我无法理解这是如何完成的,我也无法在 CUBEMX 中配置它。

第 10 页的图 12 描述了多路复用器的功能,

它不能同时向 ADC 和外部引脚输出信号。

谢谢。

Translation:

"However, I cannot understand how this is done, and I cannot configure it in CUBEMX.

Figure 12 on page 10 describes the function of the multiplexer,

It cannot output a signal to both the ADC and an external pin at the same time.

Thank you."

    This topic has been closed for replies.
    Best answer by Igor Cesko

    Hello Hakuki_Riumiya,

     

      There is a mistake in the Figure 38. The input to ADC2 must be taken from PA6 pin and not from the internal OPAMP2 output.

    Correct schematic is like this:
    Figure38 corrected.png

     

    In CubeMX : it is possible to configure this correction like described above - but you must enable "Pin Stacking" on the PA6 pin (right clock on PA6 pin) - to be able to connect multiple functions on PA6 (ADC2_IN3 + OPAMP2_VOUT):
    Pin stacking.pngADC and OPAMP on same pin.png



     

     

      Regards

                                 Igor

    2 replies

    ST Employee
    April 2, 2025

    Hello Hakuki_Riumiya,

     

      There is a mistake in the Figure 38. The input to ADC2 must be taken from PA6 pin and not from the internal OPAMP2 output.

    Correct schematic is like this:
    Figure38 corrected.png

     

    In CubeMX : it is possible to configure this correction like described above - but you must enable "Pin Stacking" on the PA6 pin (right clock on PA6 pin) - to be able to connect multiple functions on PA6 (ADC2_IN3 + OPAMP2_VOUT):
    Pin stacking.pngADC and OPAMP on same pin.png



     

     

      Regards

                                 Igor

    Explorer
    April 2, 2025

    hello,lgor Cesko

    In fact, the error in document AN5306 is not correct, right?

    It is still the first edition,Rev1-May 2019.

    Thank you for answering this question for me.

     Regards

                  Hakuki

    ST Employee
    April 2, 2025

    Yes - there is a mistake.

    We should correct it in the AN5306.

      Regards

                                 Igor