Arduino Forum

Using Arduino => Interfacing w/ Software on the Computer => Topic started by: sebaalbert on Jan 15, 2013, 04:53 pm

Title: Firmata and PWM
Post by: sebaalbert on Jan 15, 2013, 04:53 pm
Hi,

I have a (simple ?) question : how can i set all pwm pins in pwm outputs ?

I control my arduino Mega from an application and can not send pwm on pin 1,2.
It seems to be something in firmata, but is there an existing firmata to free pin 1 and 2 for pwm ?

Cheers.

Sebastien

Title: Re: Firmata and PWM
Post by: PaulS on Jan 15, 2013, 05:46 pm
Pin 1 is the Serial pin. It is not a PWM pin.
Title: Re: Firmata and PWM
Post by: sebaalbert on Jan 15, 2013, 06:32 pm
And could never be, i guess, as pin0 ?
Title: Re: Firmata and PWM
Post by: PaulS on Jan 15, 2013, 06:53 pm
Quote
And could never be, i guess, as pin0 ?

I'm not sure what that means. Pins 0 and 1 are the hardware serial pins that Firmata uses to talk to the PC or other device driving it.

They are not PWM pins in any case.
Title: Re: Firmata and PWM
Post by: super_kittens on Jan 16, 2013, 09:50 am
Quote
Pins 0 and 1 are the hardware serial pins that Firmata uses to talk to the PC or other device driving it.


That's right.  There are only a certain amount of pins that are PWM capable.  That's because the timers that have the PWM module have certain pins assigned to them (you will find those pins in the datasheet labeled, for example, OCR0A).

The PWM pins are labeled on the Arduino board with a little squiggly line beside the pin number.
Title: Re: Firmata and PWM
Post by: PaulS on Jan 16, 2013, 02:08 pm
Quote
The PWM pins are labeled on the Arduino board with a little squiggly line beside the pin number.

Not on a Mega.  8)
Title: Re: Firmata and PWM
Post by: super_kittens on Jan 16, 2013, 07:41 pm
Yeah you're right.  I see it's pins 2-13 only.  http://arduino.cc/en/Reference/AnalogWrite