xvman / arduino-pwm-frequency-library

Automatically exported from code.google.com/p/arduino-pwm-frequency-library
0 stars 0 forks source link

PWM not working on pin 6 and 11 #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by sno...@jens1.no on 1 Apr 2013 at 1:31

GoogleCodeExporter commented 9 years ago
The 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

Original comment by martina....@gmail.com on 21 Jun 2013 at 7:23

GoogleCodeExporter commented 9 years ago
One 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)

Original comment by martina....@gmail.com on 24 Jun 2013 at 9:41

GoogleCodeExporter commented 9 years ago
Dear 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

Original comment by leroyle...@gmail.com on 31 Jan 2014 at 6:28

GoogleCodeExporter commented 9 years ago
^ 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

Original comment by kinza.mo...@gmail.com on 20 Feb 2014 at 9:47