

TCCR2B = TCCR2B & B11111000 | B00000111 // for PWM frequency of 30.64 HzĬode for Available PWM frequency for D5 & D6:
#Arduino uno code#
So to achieve frequency lower or higher than the default frequency on PWM pins, a one-line code you can use to change frequency on PWM pins of Arduino Uno is given below:įOR ARDUINO UNO: Code for Available PWM frequency for D3 & D11: There are many projects in which we require high-frequency pulses, One such project is a Buck-Converter.

For example, 1Khz is nothing when it comes to an S.M.P.S. But these default frequencies are not suitable for High-frequency circuits. Now, these frequencies are optimum for low-frequency applications like fading an LED. Here is the default frequency of each PWM pin of Arduino UNO:
