Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
arduino:arduino_timer [2020/12/02 23:19]
admin
arduino:arduino_timer [2020/12/02 23:27]
admin
Line 4: Line 4:
  
 Set PWM frequency for pin D5 & D6 Set PWM frequency for pin D5 & D6
- +
    TCCR0B = TCCR0B & B11111000 | B00000001;    // set timer 0 divisor to 1 for PWM frequency of 62500.00 Hz    TCCR0B = TCCR0B & B11111000 | B00000001;    // set timer 0 divisor to 1 for PWM frequency of 62500.00 Hz
    TCCR0B = TCCR0B & B11111000 | B00000010;    // set timer 0 divisor to     8 for PWM frequency of  7812.50 Hz    TCCR0B = TCCR0B & B11111000 | B00000010;    // set timer 0 divisor to     8 for PWM frequency of  7812.50 Hz
Line 59: Line 59:
 One can find a detailed explanation here:\\ One can find a detailed explanation here:\\
 [[http://r6500.blogspot.com/2014/12/fast-pwm-on-arduino-leonardo.html|Fast PWM on Arduino Leonardo ]]\\ [[http://r6500.blogspot.com/2014/12/fast-pwm-on-arduino-leonardo.html|Fast PWM on Arduino Leonardo ]]\\
 +[[https://github.com/R6500/Leonardo/blob/master/FastPWM.ino]]\\
  
 ---- ----