User’s Guide
9-2. USING THE C PROGRAM LANGUAGE
The program for the Bioloid was programmed in C and loaded with the Boot
Loader. In order to write such a program, you will need to know how to program
in C and you should also have some CPU hardware background. This is beyond the
scope of this manual, thus we recommend you refer to other references for such
information.
In this section we will learn about the Boot Loader and what part of the memory it
is located at. We will also learn how much of the memory a user can use for
programming.
Memory Map The CM-5 uses a CPU called the Atmega128. This CPU has 128 Kbytes of flash
memory. The CM-5 divides the flash memory into several sections, as shown in
the table below.
Address Item Function
0X00000
~
0X0BFFF
Bioloid
program
Location of the program that operates the
Bioloid
0X0A000
~
0X0DFFF
User area
Location of the user made behavior control
program
0X0E000
~
0X1DFFF
Motion Data Area for storing motion data for the robot
0X1E000
~
0X1FFFF
Boot Loader
Location of the “Boot Loader” program
for verifying the download and memory
status, etc.
When the power is applied, the “Boot Loader” located at address 0x1E000
executes. The file Bioloid_VerXXX.hex is loaded on to the 48 Kbyte user area,
starting at Address 0X00000. You can see that the executable file of the user
created C program has to be loaded at address of 0.
There is a compiler called AVR-GCC for creating the C program that you can use
for free. This will be explained in more detail in chapter 9-3.
TIP Learning how to use C to operate the CM-5 is learning about microprocessors.
Studying robotics and studying the microprocessor are two different things.
Starting from using the IN, OUT commands in the microprocessor may not be an
efficient way to operate a robot. A robot should be considered as a system, not
from the level of a device or a board. When we make a homepage with a PC we
119