Skip to main content
RShah.2
Associate
March 2, 2020
Question

I am trying to configure PWM on Nucleo-F334R8 and I am getting PWM on the scope. As per Scope, PWM output is not clean square wave.

  • March 2, 2020
  • 3 replies
  • 2569 views

When Pulse is high, I can see the deviation of 140mv in output voltage instead of clean 3.3V.

Also, I tried different frequencies and Counter Period but no change in waveform.

On inspection it looks like that output pin is ramping down and again going high. and this goes on for entire high pulsewidth.

Kindly let me know how do I clean the PWM output?

Edit:

  1. I used external pullup of 4.7k but because of that I had spikes in negative pulsewidth.
  2. I used Internal Pull Up resistor in push-pull mode but it made the waveform worse.
  3. PWM was configured for around 1.9Khz frequency.
  4. Maximum Output speed was set to Low and High to no change in output.

pics are attached herewith.

This topic has been closed for replies.

3 replies

waclawek.jan
Super User
March 2, 2020

Power supply is clean? What board is this? All ground pins are connected?

JW

RShah.2
RShah.2Author
Associate
March 2, 2020
  1. I am using just USB as power supply. I am using same usb with other Arduino Board and Waveform is clean in PWM.
  2. Board is Nucleo-F334R8.
  3. I am using board in default condition.

Let me know for any further information.

Edit: I connected the board to Wallmount 5V supply but there was no change in waveform quality.

berendi
Principal
March 2, 2020

Which pin is that?

Check the board schematics, is perhaps something else connected to the pin on the board?

Read out and check all relevant GPIO and timer registers values, and/or share them here.

Laurent Ca...
Senior III
October 16, 2020

Dear @RShah.2​ 

Do you have still this problem to solve?

And just in case, if not, do not hesitate to share the final solution you found.

Best regards

Laurent Ca...

Laurent Ca...
Senior III
October 26, 2020

Dear @RShah.2​ 

I guess you don't have to solve this problem anymore, therefore I consider this thread closed.

If not, feel free to reopen it by posting an answer.

Best regards

Laurent Ca...