
How to Install and Configure IC 3.1 for UNIX Platforms.
1. INSTALLATION
Go to http://www.newtonlabs.com/ic and look for binaries for your
particular platform.
Assuming you've found the right binary set, and brought the .tar.Z
file to your UNIX machine, do the following:
(please replace ic_xxxx with the name of the file you actually got)
% uncompress ic_xxxx.tar.Z
% tar xvf ic_xxxx.tar
You now have the following directory structure:
ic_xxxx/bin: Has the following binaries
ic: Interactive C
dl: .s19 downloader
mon: monitor for 6811-based boards
ic_xxxx/libs: Has libraries for Rev 2.X, Rug Warrior, and Handy boards
The next step is to put these directories in their final resting
place. If you have priveliges on your machine, the best thing is
probably to put the binaries in /usr/local/bin and the libraries in
/usr/local/lib/ic. (The binaries come configured to expect libraries
in this location). Otherwise, if you want to put the binaries and
libraries somewhere else (such as in your home directory), you'll need
to re-configure the ic and dl executables (but don't worry, this is
quick and easy).
TO INSTALL IC IN /usr/local/bin and /usr/local/lib/ic:
(if you have the priveleges to do this, you probably don't need these
instructions :) )
% mkdir /usr/local/lib/ic
% cd ic_xxxx
% cp -p bin/* /usr/local/bin
% cp -rp libs/* /usr/local/lib/ic
TO INSTEAD INSTALL IC SOMEWHERE ELSE, SUCH AS YOUR HOME DIRECTORY:
(these instructions are for putting ic in ~/bin and ~/lib/ic. If you
want a different root directory, just type your directory in place of
~ for the following lines)
% mkdir ~/bin (Only needed if this directory doesn't alread exist)
% mkdir ~/lib (Only needed if this directory doesn't alread exist)
% mkdir ~/lib/ic
% cd ic_xxxx
% cp -p bin/* ~/bin
% cp -rp libs/* /usr/local/lib/ic
You'll need to read the next section on configuring ic, dl, and mon.
2. CONFIGURATION
You'll want to re-configure ic and dl (and possibly mon) if you want
to do any of the following things:
*) Use a different default library directory
*) Use a different default library file (do this if you're using the
Rug Warrior or Handy Board, for example)
*) Use a different default serial port than the one ic and dl come
with
Note that all of these options can be changed with command line
arguments instead; reconfiguration simply saves you from having to
give arguments that are the same every time.
To reconfigure these executables:
cd to the directory containing the executable
% cd /usr/local/bin (or ~/bin or wherever they are)
% ic -config
You will now be prompted to change various configuration strings in
ic. You can backspace the old and change it, or simply press RETURN
to keep an option the same.
Here are the different options, and what they do:
Default editor: emacs
This option is for an old feature and no longer has any effect.
Directory where libraries reside: /usr/local/lib/ic/
This is the location of your library files. If you put the
libraries somewhere other than /usr/local/lib/ic, change this.
Note that the path should keep a trailing '/' ! Also note that
home directory expansion isn't done on this path; if you
put ic in your home dir, be sure to type your entire path.
That is, type "/u/username/lib/ic/" rather than "~/lib/ic/".
Default library file (blank for none): /usr/local/lib/ic/lib_r22.lis
This is the default library file to load.
Default for the MIT 6.270 Rev 2.21 board: lib_r22.lis
Default for the Rug Warrior: lib_rw11.lis
Default for the Handy Board: lib_hb.lis
Change the path on this file if you changed the location of the
libraries.
Default serial device name (in the form /dev/*): /dev/ttya
Change this to the default serial port you'll want to use. (If
you might use different ones at different times, you can just
give the "-port /dev/xxx" command line argument to ic when you
run it).
Next, reconfigure dl:
% dl -config
Directory where libraries reside: /usr/local/lib/ic/
Same as for ic above. This is where dl looks for pcodexxx.s19
Default serial device name (in the form /dev/*): /dev/ttya
Same as for ic above.
Value to initialize config register to (hexadecimal value. 0C turns
off eeprom and rom: 0C
You should leave this as 0C unless you know what you're doing.
Bootstrap downloader (in .s19 format): SABC .... XYZ (about 500
characters of hexadecimal).
Don't change this unless you know what you're doing. This is the
.s19 representation of the default initial 256-byte bootstrap string.
3. SETTING UP SERIAL PORTS
Most UNIX machines are shipped with serial ports that are not, by
default, readable by mere users. This is for security, in case you
were to connect a serial terminal (or modem) to the serial port and
people log in to it.
However, for the IC system to work, the user needs to have complete
access to the serial port connected to the board. Presumably, if
you're connecting that serial port to the board, a terminal or other
device won't be connected to that same port.
To find out the security on your serial port, see if the port device
is world readable and writable. (Try ls -l /dev/xxxx where you got
xxxx from the configuration step above).
If the port isn't world readable and writable, someone with root
privelege will need to fix it.
4. Getting started with IC
4.1 Downloading Pcode:
You must first download the pcode interpreter to your robot board.
Connect it to the computer's serial port, and type:
dl pcoder22.s19 (for the MIT 6.270 Rev 2.X board)
OR
dl pcode_rw.s19 (for Rug Warrior)
OR
dl pcode_hb.s19 (for Handy Board)
If you need DL to talk to a serial port other than the default, do it like
this:
dl pcoder22.s19 -port /dev/xxxx
(where /dev/xxxx is the serial port you want to use)
DL has built-in help, if things aren't clear or aren't working.
If DL doesn't work, probably your board doesn't work or the serial
cable is configured improperly. The built-in help has some hints
for diagnostics if you're using the MIT Rev 2.X LEGO Robot board.
Once DL finishes, press the reset button and your board
should beep and display a message on the LCD screen. (If you hear
a beep but see no message, try adjusting the LCD contrast knob or try
resetting again).
4.2 Starting IC
Before starting IC, be sure your board is connected, and running
pcode (the LCD is on and the heart is beating).
To start IC, type
ic
If you need IC to use a different serial than its default,
you can run it with arguments like so:
ic -port /dev/xxxx
If your IC is configured for the 6.270 Rev 2.X board, but you want to use it
for the Rug Warrior or Handy Board instead, you can either reconfigure it
as described above, or simply call ic with the following arguments:
ic -lib /usr/local/lib/lib_rw11.lis For Rug Warrior
ic -lib /usr/local/lib/lib_hb.lis For Handy Board
If everything goes well, you should see libraries load, and get a
prompt like so:
C>
You can type any expression:
C> 2+2;
Returns 4
C> beep();
-- should make the board beep if it has a buzzer
C> printf("Hello world!\n");
-- should print Hello world! on the LCD screen
C> load music.c
-- loads the music library
C> { pp(); looney_tune(); }
-- plays pink panther on the buzzer, followed by a cartoon song
An online copy of the IC manual can be found at:
http://www.newtonlabs.com/ic
Your next steps might be to try some of the motor and sensor primitives,
and then to start writing functions. You'll want to use an editor;
emacs or vi are common choices. To load (or reload) files you've
written in your editor, simply type
C> load filename.c
from IC.
Back to the Interactive
C home page
Back to the Newton Labs Academic/Research Home Page