0
\$\begingroup\$

I doubt if the way I am converting the logical level is correct and if it is the best way to do this.

The PWM_1 signal comes from a STM32F4 microcontroller. When PWM_1 = logic level 1 I have 3.3V. When PWM_1 = logic level 0 I have 0V.

I need PWM_1's 3.3V to be converted to 0V in OUT_1 and PWM_1's 0V to be 5V on OUT_1 output.

As the SN74HC04D logic port is being powered with 5V it only recognizes logic level 1 when it has 3.5V in the input (according to the datasheet). So I need to do the logical conversion from 3.3V to 5V.

I would not want to use an integrated circuit for this, so I thought of that circuit with Mosfet-n.

I wonder if this is the best way to convert logical level without using integrated circuit.

enter image description here

\$\endgroup\$
3
  • 1
    \$\begingroup\$ What is the frequency of the PWM signal? \$\endgroup\$ Oct 29, 2019 at 13:00
  • \$\begingroup\$ PWM frequency is 20KHz. \$\endgroup\$ Oct 29, 2019 at 13:01
  • \$\begingroup\$ I'd use an SN74LVC1T45 level translator. Not sure why you need to do without IC's, it will certainly take more board space to do this with discrete components, and cost more. \$\endgroup\$ Oct 29, 2019 at 13:03

2 Answers 2

1
\$\begingroup\$

Just replace the 74HC04 with 74HCT04 and you don't need any other components. It will accept 3.3V levels and output 5V levels.

\$\endgroup\$
1
  • \$\begingroup\$ Excellent answer. Analyzing the 74HCT04 datasheet, I noticed that it recognizes logic level 1 with values above 2V. Thank you very much. \$\endgroup\$ Oct 29, 2019 at 13:19
0
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$
3
  • \$\begingroup\$ You should mention that this circuit also inverts the PWM signal so the duty factor is changed. \$\endgroup\$ Oct 29, 2019 at 14:17
  • \$\begingroup\$ @ElliotAlderson That's actually in the OP's requirements. \$\endgroup\$ Oct 29, 2019 at 14:56
  • \$\begingroup\$ OK, I see, you are replacing the inverter as well, not just performing level conversion. You could improve your answer with a bit of text to explain it. \$\endgroup\$ Oct 29, 2019 at 15:06

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.