I am facing new problems everyday at embedded system. I have designed D-SMPS and put an stm32f103 to drive mosfets.I have tested micro controller and it works well while giving outputs as GPIO.It is seen at image. enter image description here I have given 1ms delay to see square wave.

But when it comes to use TIMER PWM , logic level is not correct. enter image description here

It is reducing to 1V. I have no idea why same pin gives different reaction at same point. enter image description here

Do you guys have any idea how it may happen?

  • \$\begingroup\$ Is your oscilloscope set up exactly the same way for each test (including which channel is "active")? Are the PWM pins driving anything? Is the port setup exactly the same? Can you go back and forth between GPIO and PWM and see this effect repeat? It is very strange to me, too -- I've used that part to drive motors, and it certainly didn't do that to me. \$\endgroup\$ – TimWescott Aug 25 at 19:51
  • 1
    \$\begingroup\$ The first signal is 250 Hz, the second is apparently 50 kHz. What happens if you toggle the pin as GPIO, but with 50 kHz frequency? \$\endgroup\$ – berendi - protesting Aug 25 at 19:57
  • \$\begingroup\$ Quite likely, one cannot drive a mosfet directly from a uP. One needs a mosfet driver for it. Not sure what you did as you showed half the circuit: it is at least missing the mosfets themselves... \$\endgroup\$ – Huisman Aug 25 at 20:27
  • \$\begingroup\$ @TimWescott Yes I set up the test system. And even I did not show remained circuit there are two L6388 Mosfet driver to drive full bridge topology. I would say that my hardware have some issue if logic level issue occurs at GPIO settings ,too. \$\endgroup\$ – emre iris Aug 25 at 20:53
  • 2
    \$\begingroup\$ Just a tip: when you capture oscilloscope pic, please take complete display which will cover, horizontal and vertical scale along with any other info displayed \$\endgroup\$ – Umar Aug 25 at 22:43

Which is the Pin you are worried about? Here is how you can go about finding the root cause.

  1. Make sure the power supply is stable. Measure the 3 V supply
  2. Make sure the GPIO pin is disconnected electrically from all the components. Remove series component if any or lift the MOSFET if it is connected.
  3. Drive a test frequency signal and monitor waveform (you have done it for 250 Hz)
  4. Enable PWM and drive it again with lower frequency
  5. Increase the frequency to higher value (actual value)
  6. PWM is a Digital output toggled at higher frequency. Hence, the Singal level on oscilloscope MUST reach 3.3V or the MCU VDD how much ever it is
  7. Please post complete schematics section and if the GPIO outmode is able to drive the signal to complete logic 1 and logic zero,there is no way a healthy MCU would fail to create the same logic 1 and logic 0 signal for PWM.
  8. I suspect that the pin is getting loaded but we will see when you share the complete schematics related to PWM pin part
  9. Pleas verify once that the probes are with high impedance DC coupling settings
  • 1
    \$\begingroup\$ This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review \$\endgroup\$ – Oleg Mazurov Aug 25 at 22:16
  • \$\begingroup\$ @OlegMazurov updated to actually help as answer \$\endgroup\$ – Umar Aug 25 at 22:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.