Page 48 - Amphibionics : Build Your Own Biologically Inspired Robot
P. 48
Amphibionics 03 3/24/03 8:11 AM Page 27
Chapter 3 / Microcontrollers and PIC Programming
ning machine code at 4 million cycles per second. The PIC 16F84
is equipped with two input/output (I/O) ports, port A and port B.
Each port has two registers associated with it. The first register is
the TRIS (Tri State) register. The value loaded into this register
determines if the individual pins of the port are treated as inputs
or outputs. The other register is the address of the port itself. Once
the ports have been configured using the TRIS register, data can
then be written or read to the port using the port register address.
Port B has eight I/O lines available and Port A has five I/O lines.
For example, the first robot project in the book details the con-
struction and programming of a robotic frog. This project will use
the same main controller circuit board as the hexapod robot fea-
tured in the book Insectronics so that readers who have built the
Insectronic robot will be able to jump right into this project. The
frog will be using all eight I/O lines of Port B and all five lines of
Port A, as shown in Figure 3.2.
FIGURE 3.2
Frogbotics main
controller board
schematic.
27