■ FIGURE 1.
■ FIGURE 2.
Modified LCD cable.
Now ... you have to be very careful when doing this, as
too much solder can cause the socket (on female connectors) to become clogged and not fit onto a pin header. The
easiest way to prevent clogging is to solder these connectors the same way we would solder SMD components on a
PCB: Put a drop of liquid flux on the crimped joint, put a
tiny bit of solder on the tip of your iron, and then touch the
iron to the crimped connection. The flux will clean
everything and the solder will wick into the connection and
make it permanent. The reason for the liquid flux on the
joint is that applying the solder to the iron will boil off any
flux in the solder. Clean the connector with a bit of 99%
alcohol or flux remover and then protect it with heat shrink
tubing or a box connector designed for the crimp sockets.
READ THE CARD
Figure 3 shows the connections between the reader
and the SX. What you’re probably wondering is where the
pull-ups are — as they are clearly not visible in Figure 1. For
the experiment, I’m using the SX’s internal (weak) pull-ups.
I think this is okay to do because I’m using such short
connections. If we decide to install a card reader into a
project where the connections are more that a foot long or
so, we should use external pull-ups.
The SX/B compiler makes enabling the pull-ups on any
given pin very simple — all we have to do is add the word
PULLUP to the end of a PIN declaration.
PIN RB.0 INPUT PULLUP
PIN RB.1 INPUT PULLUP
PIN RB.2 INPUT PULLUP
PIN RB.3 INPUT PULLUP
PIN RB.4 INPUT PULLUP
Figure 1 shows the setup on my desk for experimenting
with the card reader. The reader has a seven-pin connector
with male post headers, so I made jumper wires with a
female connector on one end and a male pin on the other;
the female end goes to the
reader, the male end gets
plugged into the SX-Tech
board — a nice, low-cost
setup for experimenting with
For output, I’m using a
4x20 serial LCD. Since there
are no male post headers on
the SX-Tech board, I modified
the LCD cable to give it male
pins on one end; this lets me
plug it into power and any
I/O point on the SX that I
desire. Figure 2 shows how I
modified the standard LCD/
Servo cable from Parallax
to work with a solderless
breadboard. Okay, we’re
ready to code.
With the connections out of the way, we can look at
the signals from the reader (all are active-low):
■ FIGURE 3. Card
March 2008 97