
		General Embedded Libraries
			for
		Motorola 68HC11/68HC12


This is a collection of embedded libraries and examples of 68HC11/68HC12
programs in C, assembly to show how to use the GNU development chain.


IMPORTANT NOTE:   If you are new to the 68HC11/68HC12 or to using the
---------------   GNU development chain, read first and play first
		  with the 'hello' example.  Read 'hello/README' first.
		  Thank you.


The top level directories contain the following:

config		Configuration files to build everything.
bin		Binaries (HC11/HC12) after build
lib		Libraries after build
include		Public includes of the libraries
examples	Repository of examples
ada		Ada Examples and BSP
ainclude	Ada Includes and BSP
src		Embedded libraries (sources)
test		Collection of tests
testsuite	DejaGNU Testsuite

Libraries:
----------

Several libraries are integrated.  After they are built, the libraries
are located in 'lib' and their associated includes are in 'include' top
level directories.

libc		Embedded libc (sprintf, printf, strcpy, malloc, free, ...)

libbot		Robots library (MIT 6.270 board) by Duane Gustavus
		(IR dectector, PWM motor controller, interrupt driven SCI, 
		analog ports, ...)

libbsp		Board Support Package
		Provides low level SIO, eeprom and other functions (polling).

libebsp		Event Board Support Package
		Event and timer runtime; event driver board support.

libgel          Event Library

libutil		Utility library
		Persistent C++ class

libgdm		Graphical Display Manager Library
		128x64 display control library with drawing operations
		(lines, rectangles, circle,...)

Examples:
---------
Most of the examples require one or several libraries.  It is therefore
necessary to build the libraries before building the examples.


    Bootstrap Examples:
    -------------------
    These example fit in very low memory configuration.  They are intended
    to be uploaded with the 68HC11 bootstrap mode.

    boot_hello  C       Simple hello world
    booter	C	Simple loader that allows loading another program in
			memory
    checker	C	Check and return the memory configuration
    dumper	C	Dumps the memory on the serial line (in hex)
    blink	C	Blink program
    burner      C       Allows to program the eeprom


    Small examples:
    ---------------
    These examples require some memory on the board (< 4K).

    simple	C	Simple hello bootstrap program
    trap	C	Simple trap example
    timer       C	Timer example (68HC11 only; not yet ported to 68HC12)
    stack_depth	C,ASM	Computes the stack size used by a program
    primes	C	Prime Numbers computation
    analyzer	C	Simple logical analyzer
    freqmeter   C       Simple frequency meter
    pulse       C       Pulse generator (uses output compare interrupts)

    Larger examples:
    ---------------
    These examples require more memory than the others (> 4K).

    calculator	C	Calculator example (16, 32 or 64 bit)
    benchs	C	Benchmark programs (basic types, misc, floats)
    persist	C++	Persistent storage example using eeprom
    interpretor C++     Small interpretor (memory banks, far/near methods)

    Graphic examples:
    -----------------
    These examples use a 128x64 LCD display:

    hwtest      C       Hardware test for 128x64 LCD display
    lines       C       Draw lines, rectangles, circles on LCD display
    fractals    C       Draw various fractals on LCD display

Configuration:
--------------
The examples can be built for the following boards:

    bootstrap		Generic 68HC11 bootstrap (256 bytes)

    eeprom-512		Generic 68HC11 eeprom (512 bytes)

    m68hc11-cme11	Axiom Manufacturing CME11 EVBU
			(32K ram with Buffalo)

    m68hc11-6270	MIT 6.270 board

    m68hc11-32k		Generic board with 32K ram, 32K rom

    m68hc11-ebcs	SCz board, 8K ram

    m68hc12-axcmd12	Axiom Manufacturing CMD12 board
			(32K ram with Dbug monitor)

    m68hc12-Ipac	EMAC Inc, iPac 9S12DG128B board

The board is configured either by specifying it to the command line
or by updating the file config/board.def. For the first method,
type the following command:

	make TARGET_BOARD=m68hc11-cme11

Otherwise, in config/board.def change the line:

	TARGET_BOARD=

to put the board you selected.

To build everything, make sure the compiler is in your path and just type:

	make
      or
	make TARGET_BOARD=<board-name>


This produces several programs and executables:

	*.elf represent the 68HC11 program in ELF format. These file
	contain symbolic debug information. These are the file that
	GDB requires for debugging and executing the program.

	*.s19 represent the same program in S19 format (without debug info).

	*.b represent the program in binary (raw data).

To execute the program, .... you have some choice:

  Simulator:	m6811-elf-run <prog>.elf
	      or
		m6811-elf-run -v <prog>.elf

  Gdb Sim:	m6811-elf-gdb <prog>.elf
		(gdb) target sim
		(gdb) load <prog>.elf
		(gdb) run

  Gdb Buffalo:	m6811-elf-gdb <prog>.elf
  (CME11)	(gdb) set remotebaud 9600
		(gdb) target buffalo /dev/ttyS2
		(gdb) load <prog>.elf
		(gdb) run

  Gdb Dbug:	m6811-elf-gdb <prog>.elf
  (CMD12)	(gdb) set remotebaud 9600
		(gdb) target dbug /dev/ttyS2
		(gdb) load <prog>.elf
		(gdb) run

  Bootstrap:	Upload the program (either <prog>.elf, or <prog>.s19)
		with your favorite target manager.

  Prom:		Burn the <prog>.b in some prom.


Adapting to a new board:
------------------------
   See README.PORT
