18X Pin Naming?

retepsnikrep

Senior Member
18x pin naming

Looking at the pinout diagrams in the getting started manual all the picaxes except the "18" variants have logical numbering for the input pins.

But the "18" chips have

Input 0
Input 1
Input 2
Input 6
Input 7

Why this bizzare numbering and not Input 0 - 4?
 

BeanieBots

Moderator
Later on when you get to know the device better, you'll actually find that using those numbers actually makes life easier.
The PICAXE range of micros use an internal set of registers which are 8 bits wide. Each BIT represents an input or an output. They are usually numbered from 0 to 7. The limited number of pins means you can't have a full set of both inputs and outputs at the same time.
If you write an 8 number down in binary, it would look something like this:-
%11000000
If you look at the first two BITs, they are both "1".
Their positions are 7 and 6.
If that was sent to the outputs, it would turn on outputs 7 and 6.

A similar method is used for the inputs. However, only inputs which map to positions 0,1,2,6 & 7 actually exist.

If these were called 1,2,3,4 & 5, it would get VERY confusing.
 

Dippy

Moderator
A PICture paints a thousand words, so if BB's exp was a bit wordy then check the picture below.
Compare it to the 18X pinout.
See how the 18X description ties up with the PIC port numbers? (RA.. and RB..)

They could have called it something different but that's life.
 

Attachments

westaust55

Moderator
18X Pin Naming

Further to what Beaniebots has already said, the attached diagram from the relevant PIC datsheet (ref PICAXE manual 1 page 12 under the heading "PICAXE chip labels" for PIC types) may help you understanding the numbering and physical layout.
 

Attachments

Top