5
TUTORIAL
This section was written to help you get started with the specifics of the CME11E9 software
development process. Be sure to read the rest of this manual for further information. Also,
you should see the 68HC11 reference manual and other documentation on the CD.
The following sections take you through the complete development cycle of a simple "hello
world" program, which sends the string "Hello World" to the serial port.
Creating source code
You can write source code for the CME11E9 board using any language that compiles to
Motorola 68HC11 instructions. Included on the CD is a free Assembler and also a freeware
C compiler. Inexpensive or free compilers are also available for Basic and Forth languages.
See the www.axman.com web page for more information.
You should write your source code using a standard ASCII text editor. Many powerful code
editors are available or you can use the free EDIT or NOTEPAD programs that come with
your computer. Once your source code is written and saved to a file, you can assemble or
compile it to a Motorola S-Record (hex) format. This type of output file usually has a .MOT,
.HEX or .S19 file extension and is in a format that can be read by the programming utilities to
be programmed into the CME11E9 board.
It's important to understand your development board's use of Memory and Addressing when
writing source code so you can locate your code at valid addresses. For example, when in
"debug" mode, you should put your program CODE in External RAM. In assembly language,
you do this with ORG statements in your source code. Any lines following an ORG
statement will begin at that ORG location, which is the first number following the word ORG,
for example:
ORG $2000
.
You must start your DATA (or variables) in a RAM location unused by your program, for
example: ORG $1040. When finished debugging, you must change these ORG statements
so that your program is moved to a valid EEPROM area - somewhere after hex E000. Do
this by putting an ORG $E000 in front of your Program CODE. Data may remain where it is
or be moved down to internal RAM starting at ORG $0000. You must also program the
STACK register somewhere at the top of your available RAM, for example hex 1FF. Do this
with this instruction as the first instruction in your program code: LDS #$01FF.
A look at the example programs on the CD can make all of this clearer. If you're using a
compiler instead of an assembler, consult the compiler documentation for methods used to
locate your code and data.
Source code created to run under the buffalo monitor environment will be slightly different
than code written for stand-alone operation. The buffalo monitor contains interrupt and
RESET vectors for example, your code must provide these when it's no longer running under
the monitor. See the
Programming External EEPROM
section for more information on this.