Skip to main content
MJavi.1
Associate II
June 5, 2023
Solved

Is there a zero crossing detector inside the stm32 itself?

  • June 5, 2023
  • 1 reply
  • 3682 views

Is there a zero crossing detector inside the stm32 itself?

I am using a stm32f334R8

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

Well, the STM32F334 may only process voltages between 0...VDD, for 5V-tolerant GPIOs also 5V signals under consideration of special instructions.

A real zero crossing detection is only possible if you shift the signal to be detected by an offset and use it to feed one of the three included comparators, for example. Alternatively, you can also do the zero crossing detection externally and feed it in digitally.

Does it answer your question?

Regards

/Peter

1 reply

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
June 5, 2023

Well, the STM32F334 may only process voltages between 0...VDD, for 5V-tolerant GPIOs also 5V signals under consideration of special instructions.

A real zero crossing detection is only possible if you shift the signal to be detected by an offset and use it to feed one of the three included comparators, for example. Alternatively, you can also do the zero crossing detection externally and feed it in digitally.

Does it answer your question?

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.
MJavi.1
MJavi.1Author
Associate II
June 5, 2023

Yeah very useful

Actually i want impelement a pll. By finding the phase shift between the pwm signal and the output of current transformer(ct) that i put on the output of my inverter.

Do you have any idea how can i find the phase shift just using ct signal?

Without measring voltage.

Peter BENSCH
Technical Moderator
June 5, 2023

Well, it should be no problem to measure the PWM with a timer (frequency, possibly also duty cycle) and then measure the time shift of the CT signal. The phase shift can then be calculated from the time shift relative to the PWM frequency.

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.