CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 12:43:51 GMT
content-type: text/html; charset=utf-8
cf-ray: 965c398badbbc1a6-BLR
cf-cache-status: DYNAMIC
cache-control: private
set-cookie: prov=55520d42-310a-4001-b6bf-db41889af745; expires=Mon, 27 Jul 2026 12:43:51 GMT; domain=.stackexchange.com; path=/; secure; httponly
strict-transport-security: max-age=31536000; includeSubDomains
vary: Accept-Encoding
content-security-policy: upgrade-insecure-requests; frame-ancestors 'self' https://stackexchange.com
x-clacks-overhead: GNU Terry Pratchett
x-frame-options: SAMEORIGIN
x-request-guid: 415a5e28-9dc1-466f-bd06-df6d5a409298
x-worker-origin-response-time: 444000000
x-dns-prefetch-control: off
set-cookie: prov=55520d42-310a-4001-b6bf-db41889af745; Path=/; HttpOnly; Domain=stackexchange.com
set-cookie: __cf_bm=uHCBxSzOknk0ZmsH.ix4OsSsJ_.jxuttlgx7YmnNY70-1753620231-1.0.1.1-XmGLZ7gEh_pEvZPbSRV1dwJy3F5vCs4NVTQQIpHPXVgvRRjb6ltO80DiCmLlpJ15kpUypsNeLWemrCl.KTJ46iq3NtQhosIWt1NojUrmo2Y; path=/; expires=Sun, 27-Jul-25 13:13:51 GMT; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=YMdCwtnQey3bN56hBbs18rdvd9zetvYkKi7N81KtTWs-1753620231456-0.0.1.1-604800000; path=/; domain=.stackexchange.com; HttpOnly; Secure; SameSite=None
server: cloudflare
content-encoding: gzip
Newest 'pwm' Questions - Arduino Stack Exchange
Skip to main content
Stack Exchange Network
Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack ExchangeTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsQuestions tagged [pwm]
PWM is a form of signal modulation that allows digital output to approximate an analog signal. Use this for questions about using the PWM pins (marked with ~).
498 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
2
votes
1
answer
159
views
ESP32 LED PWM fade not working?
Not sure if this belongs more in an electronics SE, but I'll give this a try.
I'm trying to use an ESP32-C3 and an NPN transistor (2N5551) to PWM drive an LED (values below). I'm trying a simple fade, ...
0
votes
1
answer
142
views
STM32 PWM on standard GPIO pins
I'm using an STM32F407ZET6 with the Arduino core support in PlatformIO. CPU has an external 8MHz crystal running at 168MHz. I have a project where I'm already using UART1, I2C1, SPI2 and SDIO (1Hz ...
0
votes
1
answer
60
views
ESP32 Timers - Controller Crashes Above 240 kHz, Duty Cycle Becomes Unstable
I'm trying to generate three synchronized signals on ESP32 for a device that requires precise timing. However, when I increase the frequency above 240 kHz, the controller crashes, and the duty cycle ...
1
vote
1
answer
130
views
Problem with ATTiny85 sketch to start and stop firing a camera on a PWM signal from RC receiver
I am trying to start a camera firing at a fixed interval on a long servo pulse, stop it firing on the next long pulse, start it again on the next long pulse, etc. I use an interrupt to detect if the ...
1
vote
1
answer
84
views
Arduino Mega 2560 + DRV8871: Motor Not Moving with PWM Control
I'm using an Arduino Mega 2560 to control a DRV8871 motor driver connected to a DC brushed motor. The setup includes:
Three buttons: UP, DOWN, and FAST
One limit switch input, where the upper and ...
1
vote
2
answers
75
views
Translating PIC PWM settings to ATMega328P
I'm trying to get some C code that runs on a PIC18F, working on an Arduino '328P. It uses an 8-bit timer, PWM, and a LUT to generate sine waves. I hope to get it going using Timer2 on a Nano.
The PIC ...
1
vote
1
answer
139
views
Does changing the prescale for Timer 0 or Timer 2 affect the micros() function?
I am using an ATTiny88 to drive a PWM device. First of all, digging through the literature, it's hard to tell what the differences between the ATTiny85 and ATTiny88 are, and the vast majority of ...
-1
votes
2
answers
161
views
I need two (25 and 30 kHz) pwm output on a nano
How do I create a second output with a different frequency?
void setup() {
const byte DRIVEa = 3; // Timer 2 "B" output: OC2B
pinMode (DRIVEa, OUTPUT); // driver a.
TCCR2A = _BV (...
0
votes
1
answer
45
views
Does an ISR pause PWM?
I have a Nano producing a PWM output from one of its pins. This PWM signal cannot stop as it drives a filament for a VFD display(if it stops, nothing shows). However, I need to capture the pulses from ...
0
votes
2
answers
228
views
Translating analogWrite() into PWM duty cycle formula
We can use the function analogWrite(int x) for digital pins which support PWM because any microcontroller has a built in PWM generator.For given x and for Arduino Uno which is the formula to calculate ...
1
vote
1
answer
55
views
What prescaler to use for finer control?
I'm using a UNO to generate a 10 kHz PWM signal. I need finer duty cycle variation.
The prescalers supported are 1, 8, 32, and 64.
void setup()
{
pinMode(3,OUTPUT);
TCCR2A = bit (WGM20) | bit (...
-1
votes
2
answers
875
views
I need a 10KHZ PWM signal from pin 3 and 11 using timer 2
The op of pin 11 should be inverse of pin 3. I used digitalreadfast and digitalwritefast and used simple if else. But the delay is high as 10us. What should i do?
I found this code in forum but its ...
-1
votes
1
answer
136
views
Unable to find PCA9685 module when using the I2CScanner library: no servo movement
I am trying to use an Adafruit PCA9685 servo driver module with an ELEGOO Mega 2560 board.
I am supplying the servo driver board with 5 V and tested all the wires to make sure. I tested the servo ...
-1
votes
1
answer
145
views
How to output two PWM signals, one of 50% duty cycle, the other 25% duty cycle, from an Arduino Uno?
I need to output two PWM signals, one of 50% duty cycle, the other 25% duty cycle, from an Arduino. Feed both signals into the 2 channels of a PicoScope and measure:
a) the time difference between the ...
0
votes
1
answer
86
views
Use TCC1 timer to generate PWM on personnal board built with SAMD21E18A
I'm trying to generate a PWM signal from TCC1. I have a personnal board built with SAMD21E18A. I want to use pin 27 PA30, in my variant.cpp I have this line:
{ PORTA, 30, PIO_PWM, PIN_ATTR_DIGITAL|...
- The Overflow Blog
-
-
- Featured on Meta
-
-
Related Tags
arduino-uno × 168
led × 55
timers × 53
motor × 45
arduino-mega × 45
servo × 40
analogwrite × 28
frequency × 28
arduino-nano × 26
interrupt × 17
atmega328 × 17
pins × 15
programming × 15
power × 12
attiny × 12
audio × 12
current × 11
arduino-ide × 11
analogread × 11
i2c × 10
c++ × 10
adafruit × 9
esp32 × 9
transistor × 8
mosfet × 8
more related tags
Hot Network Questions
- The Russian president is struggling to pass a law now. Then, how much power does Kremlin have to initiate a congressional decision?
- Do TeX engines support Shavian OpenType fonts?
- Rec Letter from Professor (who I haven't done research with) or from Work Supervisor
- Time Machine backup disk not writeable any longer
- What is the best way to bevel these corners without these deformations showing?
- Why does Gaza Humanitarian Foundation (GHF) not distribute more food in Gaza?
- Heretofore I think I have been using 'heretofore' incorrectly
- Are classified documents subject to a subpoena in discovery?
- Not being introduced to the team – should I ask for it?
- How can I turn the text in a PNG file back into text layer?
- What Isp can be gotten from a napthalene (mothball) hot gas thruster? Did it work in space?
- Will this work as an XOR gate?
- Class for validating code in different Conda environments with PyTorch
- leftmargin in enumerate
- In Fantastic Four 2025 shouldn't this thing have taken years?
- Shared-Memory Queue Implementation in C
- Moving multiplying cells away
- Symbols for A.P. Morse's book in Set Theory
- How should one pronounce plural French-derived German words?
- Extensions of diagonalizable, respectively multiplicative-type, groups
- Kepler's first law proof error - can anyone help me see what the error is?
- Not your ordinary affix riddle
- How to put commutative symbol in a commutative diagram?
- Has the Silver Surfer's clothing (or lack thereof) ever been addressed in the comics?