Skip to main content
KKIM.6
Senior
November 10, 2022
Solved

Is there any way to read the comparator's output voltage without connecting the output pin to the ADC?

  • November 10, 2022
  • 3 replies
  • 1949 views

I know the microcontroller has built-in comparators and I'm trying to use it as a transimpedance amplifier. So, I want to test the comparators but the Necleo-WB55 developer kit doesn't have built-in comparators.

 0693W00000WI0LNQA1.png0693W00000WI0LrQAL.pngSo, I have to test it on my custom board with the STM32WB55VGY6TR microcontroller.

However, there is two big concern.

The one is that I didn't connect any output pin of the comparator to ADC in my custom board.

The other is that ADC cannot read negative voltage but the transimpedance amplifier is inverted OP-AMP. So, the output could be negative.

So, I have a question here.

Is there any way to read the comparator's output voltage without connecting the output pin to the ADC? (or is the microcontroller designed already for this purpose? because I found that it is not mandatory to assign the output pin in STM32cubeMX.

If not, can I connect the output pin to the ADC even though the comparator may generate a negative voltage?

This topic has been closed for replies.
Best answer by Peter BENSCH

You cannot use a comparator as a transimpedance amplifier. Unlike operational amplifiers, comparators have no phase compensation, which makes them completely unstable in the analogue range.

So you will have to implement the transimpedance amplifier externally and then you can also use the first, non-inverting circuit to stay in the positive range.

Regards

/Peter

3 replies

Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
November 10, 2022

You cannot use a comparator as a transimpedance amplifier. Unlike operational amplifiers, comparators have no phase compensation, which makes them completely unstable in the analogue range.

So you will have to implement the transimpedance amplifier externally and then you can also use the first, non-inverting circuit to stay in the positive range.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
KKIM.6
KKIM.6Author
Senior
November 10, 2022

Oh. I understood.

Thanks for your reply.