Motorola 68HC12B32, 68HC12BC32, CME-12B-BC User Manual

0 (0)
Motorola 68HC12B32, 68HC12BC32, CME-12B-BC User Manual

CME-12B/BC

Development Board for Motorola 68HC12B32 and 68HC12BC32 Microcontrollers

xiom anufacturing

ä ã 2000

2813 Industrial Ln. Garland, TX 75041 (972) 926-9303 FAX (972) 926-6063

 

email: Gary@axman.com web: http://www.axman.com

CONTENTS

 

GETTING STARTED ............................................................................................

3

Installing the Software.....................................................................

3

Board Startup ..................................................................................

3

Support Software ............................................................................

4

Software Development ....................................................................

4

TUTORIAL............................................................................................................

5

Creating source code......................................................................

5

Assembling source code .................................................................

6

Running your application ................................................................

7

Programming Flash EEPROM.........................................................

8

MEMORY MAP .....................................................................................................

9

CONFIG SWITCH ...............................................................................................

10

MEM-SEL JUMPERS .........................................................................................

10

PORTS AND CONNECTORS ............................................................................

11

LCD_PORT ...................................................................................

11

KEYPAD........................................................................................

11

MCU_PORT ..................................................................................

12

CAN_PORT...................................................................................

12

COM1 SERIAL PORT ...................................................................

13

J2 ..................................................................................................

13

BUS_PORT...................................................................................

13

BDM-IN .........................................................................................

14

EVU Compatibility Jumpers...........................................................

14

TROUBLESHOOTING .......................................................................................

15

Code Execution ......................................................................

16

TABLES..............................................................................................................

17

TABLE 1. LCD Command Codes .................................................

17

TABLE 2. LCD Character Codes..................................................

17

TABLE 3. D-Bug12 Monitor Commands.......................................

18

2

GETTING STARTED

The Axiom CME-12B/BC single board computer is a fully assembled, fully functional development system for the Motorola 68HC12B32 and BC32 microcontrollers, complete with wall plug power supply and serial cable. Support software for this development board is provided for Windows 95 and NT operating systems and DOS.

Follow the steps in this section to get started quickly and verify everything is working correctly.

Installing the Software

1.Insert the Axiom 68HC12 support disk in your PC. If the setup program does not start, run the file called "SETUP.EXE" on the disk.

2.Follow the instructions on screen to install the support software onto your PC.

3.The flash programming utilities require you to specify the board you are using. You should select either “CME-12B32” or "CME-12B/BC" for this board.

Board Startup

Follow these steps to connect and power on the board. This assumes you're using the provided AXIDE or AX12 terminal program (installed in the previous section) or a similar communications terminal program on your PC. If you're using a different terminal program than the one provided, set it's parameters to 9600 baud, N,8,1.

1.

Make certain the CONFIG SWITCH is set as follows:

 

 

 

 

 

 

 

 

 

 

 

 

 

1

2

3

4

5

6

7

8

 

 

 

ON

ON

ON

ON

OFF

ON

OFF

OFF

 

2.

Connect one end of the supplied 9-pin serial cable to a free COM port on your PC.

 

Connect the other end of the cable to the COM1 port on the CME-12B/BC board.

3.

Apply power to the board by plugging in the power adapter that came with the system.

4.

If everything is working properly, you should see a message to “PRESS KEY TO START

 

MONITOR…” in your terminal window. Press the ENTER key and you should see:

D-Bug12 v2.0.2

Copyright 1996 - 1997 Motorola Semiconductor

For Commands type "Help"

>_

5.Your board is now ready to use! If you do not see this message prompt, or if the text is garbage, see the TROUBLESHOOTING section at the end of this manual.

3

Support Software

There are many useful programs and documents on the included HC12 support disk that can make developing projects on the CME-12B/BC easier. You should browse the disk and copy anything you want to your hard drive. See the README.TXT file for a description of what is included.

The flash programming utilities communicate with the board via its COM1 port and the supplied cable. These programs also include a simple Terminal for interfacing with other programs running on the CME-12B/BC, such as the D-Bug12 and information from your own programs that send output to the serial port.

Also on the disk is a free assembler, example source code, and other tools to get you started.

Software Development

Software development on the CME12B32 can be performed using either the DBUG12 monitor utility installed in EPROM (sockets U6/U7), the DBUG12 monitor programmed into the internal

Flash EPROM or a Background Debug Module (BDM) connected to the BDM-IN connector. Any of these tools can be used to assist in creating and debugging your program stored in either internal RAM ($800-$C00) or external RAM (U4/U5 see Memory Map).

After satisfactory operation running under a debugger, your program can be written to the Internal Flash Memory by relocating its start address to $8000 and programming it using either the included programming utilities or a BDM. Your program will then run automatically whenever the board is powered on or RESET is applied.

Option jumpers and switches on the board allow for easy transition from one memory type to another and restoring an operating monitor.

4

TUTORIAL

This section was written to help you get started developing software with the CME-12B/BC board. Be sure to read the rest of this manual as well as the documentation on the disk if you need further information.

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 CME-12B/BC board using any language that compiles to Motorola 68HC12 instructions. Included on the software disk is a free Assembler and also a freeware C compiler and Basic compiler.

You can write your source code using any ASCII text editor. You can use the free EDIT or NOTEPAD programs that come with your computer. A better code editor can be downloaded at: http://www.winedit.com. 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 CME-12B/BC 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 $1000. When finished debugging, you must change these ORG statements so that your program is moved to a valid EEPROM area - somewhere after hex 8000. Do this by putting an ORG $8000 in front of your Program CODE. Data may remain where it is or be moved down to internal RAM starting at ORG $800. You must also program the STACK register somewhere at the top of your available RAM, for example hex BFF. Do this with this instruction as the first instruction in your program code: LDS #$0BFF.

A look at the example programs on the disk 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 D-bug12 monitor environment will be slightly different than code written for stand-alone operation. The monitor contains interrupt and RESET vectors that your code must provide when it's no longer running under the monitor. See the Programming Flash EEPROM section for more information on this.

5

Assembling source code

An example program called “HELLO.ASM” is provided under the \EXAMPLE directory.

You can assemble your source code using command line tools under a DOS prompt by typing:

AS12 HELLO.ASM –LHELLO

Most compilers and assemblers allow many command line options so using a MAKE utility or batch file is recommended if you use this method. Run AS12 without any arguments to see all the options, or see the AS12.TXT file on the disk.

The programming utilities provided with this board also contain a simple interface to the free assembler. Use it by selecting "Build" or “Assembler” from the menu. This will prompt you for the file to be assembled.

DO NOT use long path names (> 8 characters). The free assembler is an old DOS tool that does not recognize them.

If there are no errors in your source code, 2 output files will be created:

HELLO.S19 a Motorola S-Record file that can be programmed into memory HELLO.LST a common listing file which shows the relationship between source

and output

The listing file is especially helpful to look at when debugging your program. If your program has errors, they will be displayed and no output will be generated, otherwise the listing file will be displayed.

If you prefer a windows integrated programming environment – try the Motorola MCU-EZ tools. Refer to the MCU-EZ documentation on the disk for more information.

Also, a port for the free GNU C compiler and tools for the HC12 is in the works and may be finished as you read this. Check www.axman.com or :

http://home.worldnet.fr/~stcarrez/m68hc11_port.html

6

Loading...
+ 12 hidden pages