Skip to main content
HDaji.1
Senior
September 16, 2021
Solved

Tutorial on OPAMP and ADC

Is there any good tutorial on using OPAMP and ADC together, esp. on G4 Nucleo board?

This topic has been closed for replies.
Imen.DBest answer
ST Technical Moderator
September 16, 2021

Hello @HDaji.1​ 

Have a look at this AN5306 Application note Operational Amplifier (OPAMP) usage in STM32G4 Series.

Refer also to this presentation of the STM32G4 OPAMP.

I hope these resources are helpful for you.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks

3 replies

Imen.DBest answer
ST Technical Moderator
September 16, 2021

Hello @HDaji.1​ 

Have a look at this AN5306 Application note Operational Amplifier (OPAMP) usage in STM32G4 Series.

Refer also to this presentation of the STM32G4 OPAMP.

I hope these resources are helpful for you.

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

Imen

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
HDaji.1
HDaji.1Author
Senior
September 18, 2021

Hi @Imen DAHMEN​ ,

I have read those two documents, which well cover some tech details for OPAMP. However, there is no practical sample codes on how to use them.

In the software package for G4 MCU series, there is one sample of using HAL API to link DAC and OPAMP.

What I need is to connect OPAMP to internal ADC, can you give a step-to-step guide on how to do it in IOC UI?

HDaji.1
HDaji.1Author
Senior
September 20, 2021

For example, I want to use OPAMP and ADC1 to monitor a voltage source value based on ADC_GainCompenstaion example.

In the IOC UI, I cannot connect OPAMP1 to ADC1 (PGA internally connected is disabled), so I select OPAMP3. According to G4 reference manual, OPAMP3_VOUT is internally connected to ADC1_IN12. There are two pins: PA1 for VINP and PB2 for VINM0.

My question is how to set non-inverting mode.

And I should link VINP pin to the voltage source, is it correct? How about VINM0 pin, just leave it because of non-inverting mode?