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
2
votes
1 answer

Can't initialize PWM on dsPIC33F

I'm probably just having a can't-see-the-forest-for-the-trees moment with one of these registers, but I can't get the PWM working on the dsPIC33FJ32MC102 microcontroller (warning: big PDF) I'm playing around with. I've followed both the datasheet…
BB ON
  • 251
  • 1
  • 3
  • 15
2
votes
2 answers

Setting high speed PWM on ATtiny85

I am having trouble setting up high speed PWM on my ATtiny85. I need to use the PCK, at a speed of 400 kHz. I believe that I have followed the data sheet correctly, but for some reason, the timer interrupt flags are not working. If I program the…
zmink1
  • 55
  • 1
  • 8
2
votes
2 answers

How to control a motor with atmega 32 pwm

I have been for some time on how to control a motor (control its speed) with fast pwm mode with my atmega32. I need to use the 8-bit Timer0, because i have other uses for the other counters. I think I know how to inialise the timer for this…
user2149122
  • 171
  • 1
  • 3
  • 14
2
votes
2 answers

stm32f405 generate trigger signal pwm

I'm trying to generate a phase shift PWM signal using three timers. TIM1 is used as reference(Running at 1MHz) TIM3 is used as a trigger to phase shift TIM4 TIM4 is used to generate the phase shifted signal triggerd by TIM3 To Sum up: TIM1 ---…
Jonny Schubert
  • 1,393
  • 2
  • 18
  • 39
2
votes
0 answers

How convert iOS core motion in PWM

I would use my Iphone accelerometer and gyro coupled with Arduino. For my project I need to provide data to arduino code about iphone accelerometer and gyro (roll, pitch, yaw) in the PWM 'format'. I have read some iOS documentation and from iOS core…
murgy
  • 21
  • 3
1
vote
2 answers

Set PWM frequency on Arduino Mega using Timer2 in "phase & frequency correct" (mode 5)

Using my Arduino Mega 2560 I am trying to generate a PWM signal where I can change both PWM frequency and Duty Cycle. For that I decided to use Timer2 OC2A output. The code is the following one: void setup() { //…
rodolaf
  • 29
  • 5
1
vote
0 answers

Trouble activating PWM on PA6 of Orange Pi One using DTSO and WiringOP

I'm attempting to activate PWM on pin PA6 of an Orange Pi One board. I've tried using a Device Tree Blob Overlay (DTBO) and accessing the sysfs interface, as well as using the WiringOP library, but I'm encountering issues. I'm using Armbian…
1
vote
0 answers

Timer 3 PWM generation works but doesn't rotate the servo

I have been building a 6 degree of freedom industrial robot using stm32f091rc taking advantage of multiple timers to generate pwm pulses to rotate the robots' joint angles and to do forward and inverse kinematics. One problem is that even though my…
persona
  • 70
  • 7
1
vote
2 answers

Minimize CPU usage for software PWM in the Raspberry PI

I want to generate some 4 software PWM signals on GPIO pins (5, 6, 19, and 26) on the Raspberry Pi 4B using the pigpio library (which is in C). I want to generate a PWM frequency of 8 kHz. I was able to successfully move and control the motor with a…
BhavinT
  • 338
  • 1
  • 10
1
vote
0 answers

Dead-band module not working properly for EPWM1 (TMS320F28335)

I am working on vector control of PMSM. I've got a problem with the dead-band module, and I don't understand what I'm actually doing wrong here. The register setting for EPWM modules 1 and 2 is given as follows: For EPWM module 1 configuration …
1
vote
0 answers

Noctua Fan not Responding to PWM Signal

I recently got a Noctua Redux PWM fan and hooked it up to my Raspberry Pi and tried to control it via PWM signals. I tried as many Python scripts online as I could find, modifying the frequency and changing the pin. My fan is hooked to GPIO 18 (pin…
3DCoded
  • 13
  • 1
  • 6
1
vote
1 answer

stm32: PWM generator with 1/20 pulses

I'm struggeling on setting up a STM32-F429ZI MCU (Nucleo 144 board) to generate following PWM pattern: First channel with a variable frequency and 50% duty cycle - at least I've got this working - Second channel giving a pulse with each 20th pulse…
NativeMode
  • 13
  • 2
1
vote
1 answer

How can I connect a buzzer to the raspberry pi pico using C/Rust?

I have a raspberry pi pico and a buzzer which I connected to GPIO15. I can get it to buzz and play a few notes using MicroPython and Thony like this: from machine import Pin, PWM from utime import sleep buzzer = PWM(Pin(15)) tones = { "C5":…
NaniNoni
  • 155
  • 11
1
vote
0 answers

Why is TIM1 PWM Generation CH1 triggering input compare on TIM3

I'm very new to embedded SW development and I'm trying to understand as much as possible by realizing simple code for a STM32G031C6T6 MCU, so probabily this is a stupid question but I can't find the answer anywere. First I set up channel 1 of TIM1…
1
vote
1 answer

STM32F103 PWM with timer and DMA for WS2812 interrupt function constantly called

I am trying to make my own driver for WS2812 LEDs with a timer generated PWM and a circular DMA buffer for conserving memory. I managed to get the right timings, however, looking at the signal with a logic analyzer, I notice that two main things go…
Marius
  • 39
  • 3