Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 368

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 ~).

4 votes

can i give a vcc to 14v?

Since PWM pins are digital outputs, the maximum output voltage is VCC. …
Ignacio Vazquez-Abrams's user avatar
2 votes
Accepted

Why can't the OCR1A register be set to 1 to get a 8MHz PWM?

Because then you only have 1-bit PWM. And there aren't an awful lot of applications for 1-bit PWM. …
Ignacio Vazquez-Abrams's user avatar
9 votes
Accepted

Arduino PWM malfunctioning

Pin 11 is shared between both PWM and SPI. By activating SPI you've disabled PWM from working on that pin. Either use another PWM pin instead, or switch to software SPI on different pins. …
Ignacio Vazquez-Abrams's user avatar
0 votes
Accepted

Can PWM break a DC motor?

Provided that the voltage specs of the motor are not violated, no. However, the inductance of the motor stands a very good chance of destroying the switch unless an appropriately-rated flyback diode i …
Ignacio Vazquez-Abrams's user avatar
3 votes

Simple Speed question - Mapping PWM values

They're the value to pass to analogWrite() in order to generate a PWM waveform with an appropriate duty cycle. But don't bother writing your own algorithm, just use map(). …
Ignacio Vazquez-Abrams's user avatar
1 vote

Converting Random Binary Data to PWM Signal

Count the amount of time a signal is high over a certain period, and use the ratio of on time to period as the duty cycle for the PWM signal. …
Ignacio Vazquez-Abrams's user avatar
2 votes
Accepted

Is crystal mandatory on attiny84?

Only if you need crystal accuracy. If the internal RC oscillator is accurate enough then feel free to use it instead.
Ignacio Vazquez-Abrams's user avatar
1 vote
Accepted

PWM timers, channels and pins

It's the (1<<COM4D1) that enables pin 6, or more specifically OC4D for timer output. You cannot use A0 instead, since there is no output compare capability on that pin; only pins 13, 5, 10, 9, 6, and …
Ignacio Vazquez-Abrams's user avatar
2 votes
Accepted

32u4 timer 4 pwm frequency help

We need to: Pick a suitable prescaler to get close to the desired cycle length Fine-tune the value in TOP in order to get an exact value Assuming this is a 16MHz Leonardo, and we have Fast 10-bit PWM … |= _BV(CS43) | _BV(CS41); TCCR4D &= ~(_BV(WGM41) | _BV(WGM40)); TC4H = 624 >> 8; OCR4C = 624 & 0xff; And then you set COM4xn and PWM4x to appropriate values for whichever pin(s) you want to output PWM
Ignacio Vazquez-Abrams's user avatar
3 votes

Can a timer be used in both CTC and (fast) PWM mode simultaneously?

CTC and PWM are distinct modes of operation. … However, more advanced PWM modes, specifically mode 7 for 8-bit timers and modes 14 and 15 for 16-bit timers, allow specifying an arbitrary timer duration in OCRxA or ICRx while still allowing PWM operation …
Ignacio Vazquez-Abrams's user avatar
3 votes

Arduino PWM Frequency - Pros and Cons of Modifying

A PWM frequency of 490Hz means a period of approximately 2.041ms. This allows a high period of 2ms, which is the maximum pulse length required by a large number of inexpensive servos. …
Ignacio Vazquez-Abrams's user avatar
7 votes
Accepted

Does millis() conflict with the PWM pins associated with timer 0?

They do not conflict as millis() strictly reads the immediate value in TCNT0 whereas PWM via timer 0 uses the hardware's ability to compare the value of TCNT0 with the values in OCR0x without affecting …
Ignacio Vazquez-Abrams's user avatar
8 votes
Accepted

Does the square-wave nature of PWM dictate how much resistance you need?

With a PWM signal this duration is directly linked to both the frequency and the duty cycle of the signal. …
Ignacio Vazquez-Abrams's user avatar
2 votes

Confusing Arduino Leonardo PWM

Pins 9,10,11 should be working off TIMER 1 which all use the same pre-scaler, so I dont know how 9 and 10 can have one frequency, and 11 have a different frequency. Unless D11 is configured as OC …
Ignacio Vazquez-Abrams's user avatar
2 votes
Accepted

ATTiny to drive LEDs

The ATtiny85 is an 8-pin AVR device with 3 PWM channels available in DIL and SO packages. The Arduino core can be downloaded from arduino-tiny. …
Ignacio Vazquez-Abrams's user avatar

15 30 50 per page