Legs, pins & servos

russbow

Senior Member
Think I'm ready to go with my first "major" try but...

I am confused by the pin ( leg ) terminology and servo connection.
I did a search on the forum and found that a servo must not be connected via the ULN array ( I found that out cos it didn't work )

I am not happy about pulling the chip and sticking a bit of wire in the holder so how about using pin (leg?) 14, the In 3 pin (leg?). This is an input so has a pull down. I assume this wont have an affect on the servo. Using 28x1 pickaxe.

Do I need something like this:-

out 3 ( doesn't seem right cos there is an output 3 on pin ( leg?) 24)

servopos 3,75 to set servo position

Almost there but somewhat confused

Thanks,

Russ
 

hippy

Ex-Staff (retired)
In PICAXE parlance a "leg" is the physical leg of the chip. Leg 1 is top left when the notch is at the top for a DIP, then numbered incrementally counter-clockwise, Leg 28 at top right on a 28X1. "Pin" is what an I/O connection is in programming terms and is not usually the same number as the leg number.

Hardware manufacturers often use legs and pins to mean the same which quickly gets confusing hence the adoption of the two terms to mean different things on a PICAXE.

There are different pins on all PICAXE's - Some output only, some input only and some which can be either input or output. In addition, some commands can only use particular pins.

The SERVO command can only use the 'standard output pins', Output Pin0 to Output Pin7, which on a 28X1 are Leg 21 to Leg 28.

You will need to connect your servo to one of those pins / legs, the others cannot be used.
 

russbow

Senior Member
The standard 28 pin project bourd that came with the kit. Also tyiny it in with a breadbord and separate supply for the servo.

Looked at page 111 of manual 2

Terminology bugs me though
 

russbow

Senior Member
Thanks Hippy. That's sorted one thing out. Guess I've got to lift the array chip then. It will all be sorted when my ZIF socket arrives !!
 

BeanieBots

Moderator
If you are not happy fitting a link to the socket or soldering a connection direct to the board to pick up the direct output, then consider replacing the darlington array with a DIL resistor pack. They are available from Rev-Ed. The value is not critical but should be fairly low. 330R would be a good choice.

Have a look at the first picture here:
http://www.picaxeforum.co.uk/showthread.php?t=7760

The blue "chip" is a DIL resistor pack.
I've also soldered another row of SIL pins so that a 'standard' Futaba type servo plug can simply be plugged onto the board.
 
Last edited:

russbow

Senior Member
Thank you all so much for your help. I can now scan with the servo - I did poke a 330 ohm resistor in the IC socket. All is working !! Got the legs and pins sussed as well.

Next bit is motor control resulting from the "ping - blip" results. Should be fun.

Is it best practice to use SERVOPOS at the beginning of the routine and SERVO thereafter? I seem to get the same results using only SERVOPOS all the time. Must be a reason for the two different commands.

Russ
 

BeanieBots

Moderator
Other way around.
Use servo to setup the background servo pulses and then use servopos to update the position. Ideally, servo should only be executed once for each pin being used.
 
Top