Page 1 of 1
Arduino Mega 2560
Posted: Tue Sep 11, 2012 9:37 am
by trisbillers
HI, All,
I have an issue with the PWM Output not working on my Arduino mega 2560.
I have tried different output pins and setting and have not been successful. Could someone please help me in resolving this issue.
I have attached My code, and every thing apart form the PWM is running fine on our hardware.
any help would be appreciated.
Thanks
Tristan
Re: Arduino Mega 2560
Posted: Thu Sep 13, 2012 11:02 am
by Benj
Hello Tristan,
I've just tried the Mega 2560 and the PWM is working fine. Which PWM channel are you using? It could be that the numbering of the PWM channels is maybe not as you are expecting. I think PWM channel 2 should be connected to Arduino Digital Pin 4. If you like I can make a list of all the Mega's PWM pins and what they relate to on the Arduino hardware.
Re: Arduino Mega 2560
Posted: Fri Sep 14, 2012 12:06 pm
by dazz
Hi
This may help , if it helps save the fcd , then pop it in your fcd folder and choose the new device, it lists the pwm pins ie pwm(1) pwm(16) etc on the chip view(see screenshots here
http://www.matrixmultimedia.com/mmforum ... ins#p37017), also note that in flowcode you have 16 pwm pins instead of 14, also please bear in mind the pwm channels are numbered as per the atmel datasheet not the arduino standard, also one to note is 2 pwm channels (1 and 5) are shared on pin pb7 so if you selected channels 1 and 5 you would only get 1 to work as they share a pin not sure why just atmels wierd way of doing things)
Regards
Dazz
p.s benj you can add the attached to the master fcd file if you want so there the standard fcd and the one showing pwm)

Re: Arduino Mega 2560
Posted: Fri Sep 14, 2012 11:23 pm
by trisbillers
Thanks for the replies guys..
What you have said is now making sence, As I was going buy what was on the arduino board and not the chip.
I am on the iPad at the moment so when I get back to the pc I will take a look at what you send me dazz.
Thanks guys.