The last item was to configure
the SPI settings from the terminal —
perhaps the world’s tiniest and
simplest user interface. I created a
small set of commands to set the
various operating modes and printed
out a very short menu to the
terminal. This is shown in Figure 12.
Upon reset, the menu is displayed
and the program waits until you enter
a command, which either sets the
mode of the SPI bus or initiates
operation. The monitoring proceeds
until the user resets the processor
(through a power cycle).
Future
Expansion
FIGURE 11.
I2C functionality could be added
to the system quite easily by tweaking
the hardware for the SPI port to
include appropriate pull-ups and
updating the software to read the I2C
protocol. The prototype boards allow
easy rip-up and replace so this would
not be a big deal.
The current processor only has
256 bytes of RAM, but other devices
are available up to 1,024 bytes and
an internal oscillator of 32 MHz.
Moving into the PIC 18F family or
perhaps an Arduino would allow for a
much more powerful system.
So, that concludes the SPI
monitor project. Full details are
available on the website if you
want to construct your own.
There is plenty of opportunity
for improvement if you have any
ideas. SV
FIGURE 12.
User interface
menu.
CCS Compiler
www.ccsinfo.com
Microchip
www.microchip.com
Sources
BoardworX System
www.boardworxsystem.com
Project Details
markmitchell@mx2
systems.com
40 SERVO 06.2011