
3. Progra ing the Microcontroller on your Motherboard
Your motherboard is fitted with a PICAXE-28X2 microcontroller that can hold a range of instructions to
drive various electronic components. The sets of instructions are called programs and writing the
instructions is called programming.
3.1 Installing the software
Programming computers or microcontrollers is done using programming languages. Computers which
are electronic can only understand the simplest of languages which is written in binary, that is 0s and
1s (or an electrical ON or OFF). As you can imagine, programming a computer entirely in 0s and 1s
would be very, very slow and tedious. So, higher level programming languages have been developed
to make this easier. There are hundreds of languages available, however our Microcontroller uses a
special programming language which has been written for it based on the BASIC programming
language. BASIC is easy to learn and remember.
To write programs, write programs, and to download them into the PICAXE microcontroller,
you need to install either the PICAXE Programming Editor or the cross-platform AXEpad
program.
3.2 Pin Numbers
The PICAXE motherboard has its connection pins labelled P0 to P15 but the PICAXE-28X2 uses a
different 'software terminology' than the 'hardware terminology'; a hardware connection to P2 is a
software connection to B.2, a hardware connection to P14 is a software connection to C.6 and so
forth.
This situation is very common in computer engineering where a general purpose programmable chip
is used with specific hardware and is very easy to deal with. All that is required is a table which maps
'hardware terminology' to 'software terminology' and you can go on using the hardware descriptions,
for example pin 1 (P1), which makes sense to you and the controlling software will understand what
you mean.
This table is implemented by using symbol commands and the complete set of pin mappings is as
follows:
symbol P0 = B.0 symbol P8 = C.0
symbol P1 = B.1 symbol P9 = C.1
symbol P2 = B.2 symbol P10 = C.2
symbol P3 = B.3 symbol P11 = C.3
symbol P4 = B.4 symbol P12 = C.4
symbol P5 = B.5 symbol P13 = C.5
symbol P6 = B.6 symbol P14 = C.6
symbol P7 = B.7 symbol P15 = C.7
There is another set of mappings for when the pins are used as inputs:
symbol IN0 = pinB.0 symbol IN8 = pinC.0
symbol IN1 = pinB.1 symbol IN9 = pinC.1
symbol IN2 = pinB.2 symbol IN10 = pinC.2
symbol IN3 = pinB.3 symbol IN11 = pinC.3
symbol IN4 = pinB.4 symbol IN12 = pinC.4
symbol IN5 = pinB.5 symbol IN13 = pinC.5
symbol IN6 = pinB.6 symbol IN14 = pinC.6
symbol IN7 = pinB.7 symbol IN15 = pinC.7
The details of the table and the mappings is not really important unless you want to get more deeply
involved in PICAXE programming generally. All you need to do is include the revelevent Symbol for
each pin your program uses at the top of the program. You can of course include the complete table of
Symbol definitions if you wish.
A complete list of PICAXE-28X2 mappings is included as program Picaxe28x2.bas on the CD-ROM
which may be cut and pasted into your programs as required.