Loki Crosses the
Pond — Part 2
by Alan Marconett
In this second part of the Loki project, the
QwikFlash controller board and its control
softwaRE will be examined. This is a very useful
board for all kinds of robotic projects. I have two running
bots at this time and another one in the works!
In Part 1, we studied Loki’s mechanical construction from
PCB (printed circuit board) material. The controller board
mounts on top of the body.
Part 1 also mentioned that I was inspired to build Loki
because of his antics in walking and posturing. Another
reason I had for building Loki was to investigate subsumption
and behaviors. Simply put, behaviors are the actions taken
by a bot with given inputs. Loki will avoid an obstacle in its
path. Another behavior would be to follow (or avoid) a light
source. Subsumption is the inhibiting of one behavior by
another. However, more in-depth discussions of behaviors
and subsumption are beyond the scope of this article. I do
intend to port these ideas as ‘C’ functions into my hexapod
(Shelob), as well.
QwikFlash board populated with LCD (on Shelob).
50 SERVO 07.2008
Controller Board
Almost any controller board and processor can be
used on a robot this size. I had several bare QwikFlash
boards on hand I had purchased from the PICbook website.
This website ( www.picbook.com) supports the book
Embedded Design with the PIC18F452 Microcontroller
written by John Peatman. I’m currently using the 18F4620
PIC, although the 18F452 discussed in John’s book can be
used, and possibly even an old 16F877, as well (untested
and limited). See the CA1.PDF document on the PICbook
website for construction, bill of materials, block diagram,
and a schematic of this fine board. Note that no hex file or
code is planned for the ‘877 chip at present. A hex file is
currently available for the ‘4620 PIC implementation.
The Book
John’s book on the ‘452 is an excellent tutorial for
learning the workings of the 18F452, as well as the
18F4620 I used. And having a board to try out code on is
very helpful. Although John’s book uses assembly language
to test out the inner workings of the PIC, It is still quite useful
for C language developers and experimenters. Microchip
thought enough of the book to give out copies of it as
prizes for their seminar classes at the recent Embedded
Systems Conference. Other prizes were the ICD2 in-circuit
debugger and PIC start boards. (Now I have an additional
copy to pass along to my oldest son, who is also a
hardware engineer and is interested in the PIC.)
The QwikFlash board with a ‘4620 PIC runs at 40 MHz,
has 64K of Flash, 3986 bytes of RAM, and 1,024 bytes of
EEPROM. Plenty of I/O bits, counters, and timers too for
our use! To control Loki — or any other small bot — I added
connectors for four R/C servos, two Sharp GP2D12 IR