LCDtoLCD.py). It’s available for
downloading at the article link along
with the second program
( Cylon15.bas) that we’ll be using this
month. The RazzPi-LCDtoLCD.py
program is fairly lengthy and may
seem a little daunting at first, but the
documentation that’s available on my
website includes a fairly thorough
discussion of the most important
points. By making minor changes in
the variable and pin definitions, you
can also use the RazzPi-LCDtoLCD.py
program with the Pi stripboard
interface that we developed earlier.
The RazzPi- 20 PCB
The RazzPi- 20 PCB is a complete
PICAXE project board that accepts
either a 20X2 or 20M2 processor
(see Figure 11). Two of the
processor’s I/O pins (C.0 and B. 6)
are connected to the Pi’s GPIO pins
15 and 14, respectively. As a result,
the PICAXE processor can
communicate serially with the Pi,
without any additional wiring. I chose
to connect those two PICAXE I/O
pins so that a 20X2 or 20M2
processor will be able to use their
hserin and hserout commands to talk
to the Pi.
Figure 12 is a photo of a
complete PICAXE-Pi breadboard
setup, including the RazzPi-LCD and
RazzPi- 20 boards. In the figure, you
can see how the processor’s hserout
pin (C.0) is connected to the Pi’s RxD
pin (GPIO 15), and its hserin pin
(B. 6) is connected to the Pi’s TxD pin
(GPIO 14).
All PICAXE M2-class processors
also support the hserout and hserin
commands, but the corresponding
20X2 commands include more
powerful features. Also, eight of the
Pi’s GPIO pins remain available for
breadboard circuits, and there’s a
good amount of room for installing
peripheral components, as well.
Before moving on, there’s one
final point I want to mention about
the hserout and hserin commands.
You don’t have to use them. If you
feel more comfortable with the more
traditional (and simpler) serout and
serin commands, they also can be
used with pins C.0 and B. 6,
respectively.
As I mentioned at the beginning
of this article, if you’re not interested
in PICAXE-Pi projects, the RazzPi- 20
(and RazzPi- 14) boards can be used
in pure PICAXE projects, as well.
Refer back to the photo in Figure 11
and note the two three-pin headers
just to the left of the programming
connector.
In the photo, each three-pin
header has a two-pin jumper that’s
connecting the header’s upper two
pins. When the jumpers are in this
position, pins C.0 and B. 6 are
connected to the two pins in the
upper-left corner of the RazzPi- 20.
Since the two upper-left pins can be
inserted into the GPIO 15 and 14
positions on the RazzPi-LCD header,
this is the way to configure the
Razzpi- 20 when you are using it in
conjunction with the RazzPi-LCD
board and a Pi.
On the other hand, if you want
to use the RazzPi- 20 board in a pure
PICAXE setup, all you need to do is
move the two two-pin jumpers down
so they connect the lower two pins
on each of the three-pin headers.
In that configuration, pins C.0
and B. 6 will be connected to the
appropriate positions on the port B
and port C headers at the lower edge
of the RazzPi- 20 board.
Before moving on, a few
additional points are worth
mentioning about the PICAXE-Pi vs.
pure PICAXE configurations of the
RazzPi-20:
• If you’re using the RazzPi- 20 in
a PICAXE-Pi project that involves
serial communications, don’t forget
that pins C.0 and B. 6 will not be
available on the port B and port C
headers.
• In PICAXE-Pi projects, you
aren’t limited to serial
communications. By connecting the
necessary RazzPi- 20 pins with the
appropriate pins on the RazzPi-LCD
breadboard header, you can easily
implement I2C or SPI
communications as well.
November 2014 17
■ FIGURE 12.
Complete
PICAXE-Pi setup.
Part Label
Capacitor, .01 µF, 1206 SMD .01 µF
Diode, 1N4148 4148
Header, male, two-pin (three pieces) H1, H2, H3
Header, male, three-pin (two pieces) C.0, B. 6
Header, male, eight-pin (two pieces) H4, H5
IC socket, 20-pin, machined IC1
Resistor, 1K, 1206 SMD 1k
Resistor, 10K, 1206 SMD 10k
Resistor, 22K, 1206 SMD 22k
Stereo jack (tall) Stereo jack
■ FIGURE 13. RazzPi- 20 Parts List.