Trying to get all 6 pwm outputs on a UNO to run the same frequency.
my testing sketch
include <PWM.h>
int32_t frequency = 3500;
void setup() { InitTimers(); SetPinFrequency(3, frequency); SetPinFrequency(5, frequency); SetPinFrequency(6, frequency); SetPinFrequency(9, frequency); SetPinFrequency(10, frequency); SetPinFrequency(11, frequency);
pwmWrite(3, 50); pwmWrite(5, 50); pwmWrite(6, 50); pwmWrite(9, 50); pwmWrite(10, 50); pwmWrite(11, 50); }
void loop() { delay(100000); }
This works and gives output on port 3,5,9,10 but not on 6 and 11
same result on an genuine UNO R3 and an UNO R1(clone/compatible)
using: Arduino PWM Frequency Library v_05.zip Arduino 1.0.3
Comment #1
Posted on Jun 21, 2013 by Grumpy BirdThe same happens to me, i'm trying to use pin 11 (timer2) on arduino uno R3) and it's not working, on pin3 (that is on timer2 too) works fine
Comment #2
Posted on Jun 24, 2013 by Grumpy BirdOne more information, the return value of SetPinFrequencySafe on pin 11 will be set on false, on pin 3 result return true (and on this one it works fine)
Comment #3
Posted on Jan 31, 2014 by Happy KangarooDear all,
I have the same problem like you guys. I would like to set the frequency of the pwm of pin11, but the library seems not to work. Have you allready found a solution to this problem?
Hope to hear from you. Thanks in advance!
Kind regards,
Jeroen Zegers
Comment #4
Posted on Feb 20, 2014 by Happy Rhino^ what i have found after reading enough material that when you use this library (commands of setpinfrequency etc) you have to sacrifice 1 or 2 pwm ports so thats why you are not getting output on the said pins. source:http://forum.arduino.cc/index.php?topic=117425.0
Status: New
Labels:
Type-Defect
Priority-Medium