Questions tagged [pwm]

PWM (Pulse-width modulation) is a technique for controlling power to electrical devices, made practical by modern electronic power switches.

468 questions
14
votes
3 answers

Arduino Uno PWM pins conflict

I built this motor shield based on the L298N chip to control two motors of a tank. It uses pins 5 and 6 for one motor, and pins 10 and 11 for the other. While trying to add a TSOP 4838 in order to control the tank with an IR remote I noticed that…
binar
  • 1,197
  • 1
  • 11
  • 24
11
votes
4 answers

Controlling a servo with raspberry pi using the hardware PWM with wiringPi

I tried controlling the servo with softPwm using the wiringPi Library but this made the servo stutter. Therefore I want to use the hardware PWM pin on the Raspberry Pi (GPIO18) with the wiringPi library. But I don't understand how to set the…
user2543697
  • 143
  • 1
  • 2
  • 6
9
votes
4 answers

How to achieve zero duty cycle PWM in AVR without glitches?

I'm trying to use hardware PWM on ATmega2560, using TC0 (an 8-bit timer), in Fast PWM mode. I need to dynamically adjust the duty cycle, and this includes zero duty cycle. However, this does not appear to be easy or even possible. Quoting the…
Ambroz Bizjak
  • 7,809
  • 1
  • 38
  • 49
6
votes
3 answers

Modulate complex signal on all gpio

I need a signal at the output of the GIPO of approximately this shape.(sub-pulse in pulse) How can this be implemented using PWM on PI? Im trying do it with RPIO,but his ancient GPIO pinout maybe not working for my Rpi 3 b+. from RPIO import…
Dmitrii
  • 93
  • 10
5
votes
4 answers

Programming a PWM in an Arduino Mega ATmega2560 micro-controller

I'm trying to enable a PWM on an Arduino Mega (ATmega2560), but I'm facing to some issues. First, I'm trying to program this in Ada. I desire to use the three Timer3 channels with FastPWM, so I wrote procedure Main is begin -- Nullify Timer3…
Rego
  • 1,118
  • 1
  • 18
  • 40
4
votes
1 answer

Raspberry: how does the PWM via DMA work?

I read that the driver for "Software PWM" is running somehow on the PWM-HW and acessing all GPIOs without using the CPU. Can someone explain how that works? Is there a second processor in the Raspberry Pi used for PWM and PCM module(is there a…
Jonny
  • 241
  • 3
  • 10
4
votes
2 answers

How to use MS-IoT Lightning to set/get PWM with Raspberry Pi2?

I'd like to get Frequency and Duty Cycle of two PWM signals (i.e. PWM inputs) and set them for another one (i.e. PWM output) depending on inputs. These PWM signals have a Duty Cycle of 50%, while their Frequency range is from 1kHz to 20kHz. I…
Lorenzo R.
  • 133
  • 9
4
votes
2 answers

dsPIC33 updating PWM duty and frequency

I am trying to control a H-bridge converter using one PWM generator for each diagonal (PWM1 and PWM4 in my case). I want to be able to control both frequency and duty cycle. To do so, I generate a trigger interrupt at the beginning of PWM4 period,…
3
votes
1 answer

STM32 PWM DMA only works properly if I re-init every time I transfer, otherwise drops first few pulses

As the title says, if I don't include the call to HAL_DMA_Init(&hdma_tim2_ch1) in WS2812_DMA_Stop, my first transfer works fine but all subsequent transfers are missing the first (1-4, usually 3) pulses. DMA settings: hdma_tim2_ch1.Instance =…
Erik Johnson
  • 858
  • 1
  • 7
  • 29
3
votes
1 answer

How do I use pwm-beeper module in Linux Kernel?

I have set my PWM driven beeper up as per the Linux device tree documentation. I see that this results in an extra input device in /sys/class/input: root:/sys/class/input/input0# ls capabilities device event0 id modalias …
Adam Lee
  • 2,983
  • 7
  • 35
  • 47
3
votes
1 answer

What are the steps to set up Pulse Width Modulation on the Raspberry Pi 3 using arm assembly?

I'm working on a Raspberry Pi 3 (RPi3) bare-metal assignment for school and I am trying to get my assembly code to change the brightness of each diode in the RGB LED. In simple, I am trying to get Pulse Width Modulation (PWM) to work on my RPi3…
Miguel Aragon
  • 148
  • 1
  • 9
3
votes
2 answers

PWM on BeagleBone Black (v4.14)

There is very little information how to configure the Beaglebone for PWM on newer versions of the kernel. Past instructions for interfacing with PWM through the slots file are obsolete, as the slots file and bone_capemgr are disabled in v4.14 of the…
dgund
  • 3,459
  • 4
  • 39
  • 64
3
votes
2 answers

Drawbacks of delay

With the following: Serial.begin(9600); I am printing two values: Serial.print(Input); Serial.println(Output); delay(100); I am measuring temperature and PWM signal. What are the drawbacks of using delay?
Dinesh
  • 41
  • 3
3
votes
0 answers

Raspberry PWM Output with Pi4J

My target is to code a GUI in Java where with which the user can output a PWM signal over one of the Hardware-PWM Pins of the Raspberry 3. Doing so, the user should be able to select the length of a whole pulse (in ms), the length of the duty cycle…
Jas On
  • 51
  • 8
3
votes
1 answer

Arduino PWM fading led with avra

I'm writing Arduino UNO (=ATMega328P-PU) programs in assembly to save memory, so I use avra.exe (same as atmel studio's avrasm32) to compile and avrdude to upload, and simple programs like blinking run fine. But now i tried to half-bright a LED with…
Frazzo
  • 371
  • 2
  • 10
1
2 3
31 32