FIGURE 3. Lid with holes cut.
The first version of the code allowed a straight
dumping of the SPI contents to the terminal. Now, we will
add a very simple menu to accommodate some simple
configurations to complete the unit.
Hardware
The first thing to do is to drop the circuit board into a
box. I found a small inexpensive box from Hammond and
decided to mount the board in the lid. Having the great
benefit of hindsight, it probably would have been wiser to
have figured out hole positions and such before building
the circuit, but where is the fun in that? I decided to
remove the connectors for the SPI ports and the UART, and
place them on the other side of the board. This way, the
board could be mounted in the lid with the connectors
passing through holes in the lid. This approach provides a
secure and convenient way to mount the board and still
access the connectors easily.
I chose headers with locking ramps for the SPI and
UART connectors in a mostly self-defense choice since I
have inserted too many un-keyed connectors backwards in
my history and generally did not enjoy the results. Also,
since the connectors that plug in here are color-coded clips,
I did not want to confuse things by allowing more than one
orientation.
The replacement of the headers required a little bit of
rewiring because I flipped them to the other side of the
board and moved the position of two of them to have a
better layout in the lid. This was managed quite easily and
quickly. This is shown in Figure 1 and Figure 2.
Next, I laid out and drilled holes in the lid so that the
connectors would pass through, and I also created
mounting holes for the board. I found some appropriate
locations for some 4-40 screws in the board corners and
drilled holes in that. Assembly of the box was as simple as
securing the 4-40 screws through the mounting holes in the
lid, tightening a nut on the inside to act as a standoff for
the board, and placing the board in place. I then secured it
with another nut on each screw. Figure 3 shows the lid
FIGURE 4.
Cable
entry and
inside view.
after cutting. The oval slots were made with drill holes and
I milled the slot between the holes with a Dremel milling
bit, my drill press, and some patience.
There are basically two more wired connections to the
board from the outside world which are the power supply
connections and the RS-232 port. Both of these were
handled by drilling holes in the side panel, passing a cable
through the panel with a grommet clinching the cable. I
chose to solder these wires directly to the existing pins to
save a connector, since this was to be a fairly permanent
installation. Figure 4 shows a view of this.
The connectors were configured the same as they were
originally, just oriented in different locations. Figure 5
shows the new positions. Operation is the same as in last
month’s article (Part 1) with respect to connector
attachment and configuration.
I made a label using the ExpressPCB circuit board layout
tool and printed it onto label material. The label was placed
FIGURE 5. Connector locations,
pin-outs, and label diagram.
SERVO 06.2011 37