■ FIGURE 3.
Two-digit
display pinout.
between the 20M2 processor and the
two-digit LED display seem to make no
sense at all! Logically, it would seem to
be much more sensible to connect the
port B pins to one of the display’s
digits, and to connect the port C pins
to the other digit. However, I did a fair
amount of searching on line, and I
wasn’t able to locate a two-digit LED
display with pins that were arranged in
any logical fashion. I did find several
displays that had the pinout that’s
shown in Figure 3, so I decided to see
if I could lay out a stripboard circuit
for that pinout in a logical fashion.
As you might guess, my stripboard
kept getting larger and larger, and was
a mess! I then realized that I could
abandon logic, just make the simplest
connections possible, and straighten
out the mess in software. I also
discovered that I could make the
stripboard circuit much smaller and
simpler if I used two separate
stripboards (one for the 20M2, and
one for the LED display) and plugged
them together in a “sandwich.”
The second weird thing you
probably spotted on the schematic is
my little note: “A.0 & Sout are the same
pin!” Let me explain: When I first started
designing the LED-2x7 circuit, I needed
one more output than was available on
the 20M2 in order to implement all
the functions that I wanted to include.
Amazingly enough, I remembered that
three or four years ago, there was a
thread on the PICAXE Forum in which
“Hippy” and “Technical” (two members
of RevEd’s technical support team)
explained how it was possible to use
the 20M’s SerOut pin as a general-purpose output pin by “peeking” and
“poking” certain registers (internal
memory locations) in the 20M.
16 February 2012
ABCDEFGHI JKLMNOP
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
I searched the
PICAXE Forum archives,
found the thread, and tried
to take the same approach
with the 20M2. After a
couple of frustrating
hours, I posted a request
for help on the forum. As
usual, the response was
swift and to the point.
“Technical” explained that
there’s an easier way to
accomplish the same
thing with the 20M2
processor. The PICAXE
compiler recognizes “A.0”
as an undocumented
name for the Serial Out
pin, and accepts a few
undocumented “pseudo”
commands, including high
A.0, low A.0, and Serout
A.0. These are called
“pseudo” commands
because the compiler simply replaces
them with the necessary “peeks” and
“pokes” that had eluded me. High A.0
and low A.0 were exactly what I
needed, and I subsequently
discovered that toggle A.0 also works.
I also discovered that symbol LED
= A.0 does not work (i.e., it produces
a syntax error) which a subsequent
question to “Technical” confirmed. In
any case, I now had the additional
(pseudo!) output pin that I needed. Even
if you decide not to construct the LED-
2x7 board, there may come a time
when you need one more output on a
20M2 processor, so you may want to
make a note of this information.
As an aside, none of this is
necessary on any of the other M2
processors; they all include a “real”
name for the Serial Out pin, so you
LED Board
ABCDEFGHI JKLMNOP
20M2 Board
■ FIGURE 4. Top views of the layouts
for the two LED-2x7 stripboards.
can just use that name. For example,
on the 08M2, you can write high C.0
to light an LED on the Serial Out pin.
UNDERSTANDING THE
20M2 STRIPBOARD
LAYOUT
Figure 4 shows the top view of
the layouts for both stripboards; let’s
begin with the 20M2 board.
Connectors J1 through J4 are three-pin, right-angle female I/O connectors.
The pinout of J1 matches the Dallas-Maxim DS18B20 temperature sensor.
If a project doesn’t include
temperature sensing, I/O pin C. 7 is
available for any other I/O function