
4
revolution
Revolution Education Ltd. Web: www.picaxe.co.uk
Version 1.3 04/11
AXE401.PMD
AXE401 PICAXE-28X2 Shield Base
2.0 PICAXE-28X2 shield base input/output pins
The PICAXE system provides great flexibility over individual pin use, and most pins
can be configured to be used as a digital input or output, ADC analogue input or
touch sensor input. Therefore the PICAXE system does not need separate ‘analogue’
and ‘digital’ headers, as most pins can be either. Some pins also have additional
special hardware functionality, such as PWM or serial or SPI interfacing.
The PICAXE shield base has been very carefully designed to be compatible with
almost all existing shields. Other PIC microcontroller orientated shield bases we
have seen seem to have been designed without much thought for shield
compatibility, as they simply wire the three i/o headers in sequence to the PIC
microcontroller ports A, B and C. Although this may be the initial obvious route, it
actually means that a large number of shields are then not compatible because, for
instance, they require a hardware PWM or SPI special function which is now
allocated to a completely different pin to the normal shield layout!
Therefore the PICAXE shield base has been very carefully laid out to ensure the
special functions match the existing shield normal layout wherever possible. This
gives support for a much larger range of shields (e.g. PWM, UART and SPI functions
are on the same pins as expected).
To ensure a logical naming system can still be used, the PICAXE-28X2 compiler
accepts the normal shield position numbers in the formal S.X, where X is the shield
pin name (the original PICAXE pin name may also still be used if preferred).
e.g.
the shield header pins are named
S.A0 to S.A5, S.0 to S.13
the shield input pin variables are named
pinS.A0 to pinS.A5, pinS.0 to pinS.13
So users can select to use either the normal PICAXE pin name (e.g. ‘high B.4’) or the
shield position nickname (e.g. ‘high S.A5’) in their program. Both act exactly the
same way within the compiler. Naturally you can also rename the pins to easier to
remember names such as ‘high red_LED’.
Vref (A.3)
Gnd
S.13 (C.3)
S.12 (C.4)
S.11 (C.5)
S.10 (C.2)
S.9 (C.1)
S.8 (C.0)
S.7 (B.7)
S.6 (B.6)
S.5 (B.5)
S.4 (B.1)
S.3 (B.0)
S.2 (B.2)
S.1 (C.6)
S.0 (C.7)
(A.0) S.A0
(A.1) S.A1
(A.2) S.A2
(A.3) S.A3
(B.3) S.A4
(B.4) S.A5
Reset
3V3
5V
Gnd
Gnd
Vin (9-12V)
Vin (9-12V)
USB Cable
AXE401 PICAXE-28X2 Shield Base