Understanding pin descriptions in the manuals (in particular PWM pins)

dvd

New Member
I am trying to understand the pin descriptions of the picaxe microcontrollers. In particular, I am trying to understand which pins support the servo command.

As far as I know, servos take PWM commands to set their positions. Hence, I assume that pins labeled PWM should support the servo command – and only those pins. So, looking at the 14M2, this should be B.2, B.4, C.0 and C.2. Only those pins are labeled as PWM in the documentation. However, blocky allows selecting pins B.0 to B.5 (and only those – no C.0 and C.2) for the servo commands. What is more, this seems to work as well: I can hook up a servo to B1 and run it.

So, there seems to be a mismatch between blocky and the manual, or not?

How should I read the pin descriptions in the manuals? Or more directly relevant: how do I know which pins support the various input/output commands like read_analog, setting and reading binary states and controlling servos?
 

erco

Senior Member
Trust the manual and editor. Servo and pwm are different commands and protocols. Servo works only on port B pins, pwm are spread around, some port B, some C. They use the same timer and conflict in most cases, so don't expect to use servo and pwm together.
 

hippy

Technical Support
Staff member
Welcome to the PICAXE forum.

Servo control pins and PWMOUT pins are not the same. Servo commands can be directed to certain output pins, PWMOUT can be directed to certain output pins, sometimes pins may support one or the other and occasionally both.

If you are using servos you can ignore the PWMOUT pins; they are additional functionality not part of the servo functions.

So, just to confirm; the 14M2 can control servos on any of its B.0 through B.5 pins.
 

dvd

New Member
Thank you all for the replies.

Is there a table available that shows which commands are supported by which pins? I guess this must be available as it is programmed into the blocky software. So, I'd like the reverse of what blocky does: for a given pin, what functions are supported.

Now I am typically cycling back and forth between my circuit diagram and the blocky editor to confirm which pins will support which functions. However, that is very tedious and error prone.
 

hippy

Technical Support
Staff member
Is there a table available that shows which commands are supported by which pins?
PICAXE Manual 1 has pinouts which shows the functions of each pin, from which the commands supported can be inferred.

Servo pins aren't explicitly listed but are mostly B pins.
 

stan74

Senior Member
It's confused me. On 28x2 4 pins c.x and b.x work for pwm but servo is an interrupt and uses certain timers and pwm is software it seems not hardware pwm and it gets confusing and the manual can be confusing..to me. On top you got both pwm on c.x run at same speed but b.x pwm is independent. On same chip I used every 20 ms interrupt from timer 0 and pulseout in the interrupt to maintain servo.not picaxe though
 
Top