Motorola MCU 68HC912, MCU DG128, MCU CMD912x, MCU 68HC912D60, MCU DT128 User Manual

0 (0)
Motorola MCU 68HC912, MCU DG128, MCU CMD912x, MCU 68HC912D60, MCU DT128 User Manual

CMD912x

Development Board for Motorola 68HC912 MCU’s

68HC912D60/ DG128/ DT128 and MC9S12DP256

xiom anufacturing

ä ã 2000

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

 

email: Sales@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

BDM OPERATION................................................................................................

9

MEMORY MAPS.................................................................................................

10

PM12DP256 Memory Map.....................................................................

10

PM12DG128 / PM12DT128 Memory Map .............................................

11

PM12D60 Memory Map .........................................................................

12

OPTION SWITCHES ..........................................................................................

13

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

13

COM SWITCH .......................................................................................

13

MODE SWITCH.....................................................................................

14

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

15

PRU PORT ............................................................................................

15

PRU PORT CONNECTOR ....................................................................

16

MCU_PORT 1........................................................................................

16

MCU_PORT 2........................................................................................

17

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

17

ANALOG PORT.....................................................................................

18

COM1 ....................................................................................................

18

COM2 ....................................................................................................

18

CAN1 - 4 PORTS...................................................................................

19

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

20

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

20

TB1 and J6 Power .................................................................................

21

BDM PORT............................................................................................

21

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

22

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

24

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

24

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

24

TABLE 3. Mon12 Monitor Commands ..................................................

25

TABLE 4. I/O Signal Connection Reference .........................................

26

2

GETTING STARTED

The Axiom CMD912X single board computer is a fully assembled, fully functional development system for the Motorola 68HC912D60/ DG128/ DT128 and MC9S12DP256 microcontrollers, complete with wall plug power supply and serial cable. Support software for this development board is provided for Windows 95/98 and NT operating systems.

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 CD 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. You should at minimum install the AxIDE for Windows software.

3.The programming utility “AxIDE” requires you to specify your board. You should select "912-xxx" version of your development board.

Board Startup

Follow these steps to connect and power on the board for the default Monitor operation. This assumes you're using the provided AxIDE utility (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.

Set the CMD912x board CONFIG SWITCH as follows:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

2

 

3

 

 

4

 

5

 

 

 

 

 

 

ON

ON

 

OFF

OFF

 

OFF

 

 

 

 

2.

Set the PM12Dxx module MODE SWITCH as follows:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Module

 

 

1

2

 

 

3

4

5

 

 

 

PM12D60

 

 

ON

ON

 

OFF

x

x

 

 

 

PM12DG128

 

ON

ON

 

OFF

 

 

 

 

 

PM12DT128

 

ON

ON

 

OFF

 

 

 

 

 

PM12DP256

 

ON

ON

 

ON *1

OFF

OFF

 

Note 1: DP256 mask set 1K79X and earlier requires Expanded Wide Emulation Mode.

3.Verify CMD912x board COM-SWITCH position 1 is ON.

4.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 CMD912X board.

3

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

6.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:

Axiom MON12 - HC12 Monitor / Debugger > _

7.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.

Support Software

There are many programs and documents on the included HC12 support CD you can use with the CMD912X board. You should install what you want from the main menu then browse the disk and copy what you like to your hard drive.

At minimum, you should install the AxIDE program. This flash programming utility communicates with the board via its COM1 port and the supplied serial cable. This program also includes a simple terminal for interfacing with other programs running on the CMD912X and information from your own programs that send output to the serial port.

Also on the disk are free assemblers, the GNU C/C++ compiler tools for HC12, example source code, and other useful software. The introductory tutorial in this manual uses the free

AS12 assembler integrated into the AxIDE program. This is a simple assembler with limited capability. For a more powerful assembly tool, install the Motorola MCUez program from the CD. This will allow you to used PAGED memory in your application.

Software Development

Software development on the CMD912x can be performed using either the Mon12 monitor utility installed in EPROM (sockets U6/U7), a third party debugger (NoICE, CodeWarrior, etc.) or a Background Debug Module (BDM) connected to the PM12xx Module BDM PORT connector. Any of these tools can be used to assist in creating and debugging your program stored in RAM (see Memory Map).

After satisfactory operation running under a debugger, your program can be written to Internal Flash Memory by changing the PM12xx Module MODE SWITCH settings and programming it using one of the included programming utilities. Your program may l then run automatically whenever the board is powered on or RESET is applied.

Option switches on the board allow for easy transition from operating monitor or debugger and user code.

4

TUTORIAL

This section was written to help you get started developing software with the CMD912X 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 CMD912X board using any language that compiles to Motorola 68HC12 instructions. Included on the software disk is a free Assembler.

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. 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 and programmed into the CMD912X 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 locate the code 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 $4400. You must start your DATA (or variables) in a RAM location unused by your program, for example: ORG $4000.

In “debug mode” you’ll be using a debugger utility (Mon12,NoICE, etc) which will handle both interrupts (reset, timers, etc) and the STACK. When finished debugging, you must add code to your application to handle the STACK and Interrupt vector initialization. Set the stack somewhere at the top of your available RAM, for example $3FFE, in assembly this would be LDS #$3FFE. Also define the RESET vector address, $FFFE, at the end of your program.

For example:

ORG $FFFE

FDB START ; where START is the beginning label of your program

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, data and stack.

5

Assembling source code

An example program called “HELLO.ASM” is provided under the\EXAMPLES\912x directory of the CD and if you installed AxIDE, under that programs \EXAMPLE directory. You must use the example for the PM Module you have installed on the CMD912x board. The PM Label is located beside the microcontroller. For example:

\EXAMPLE\HC12D60\HELLO.ASM Example program for the PM12D60 \EXAMPLE\HC12D128\HELLO.ASM Example program for the PM12D128 \EXAMPLE\HC12D256\HELLO.ASM Example program for the PM12D256

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 utility AxIDE provided with this board contains a simple interface to this assembler. Use it by selecting "Build" from its menu. This will prompt you for the file to be assembled. NOTE: You must select your board from the pull down menu first, or it may not build correctly.

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 available on the CD under \Shareware and also online at www.gnu-m68hc11.org.

6

Running your application

After creating a Motorola S-Record file you can "upload" it to the development board for a test run. The provided example “HELLO.ASM” was created to run from RAM so you can use the

Mon12 Monitor to test it without programming it into Flash.

If you haven’t done so already, verify that the CMD912X board is connected and operating properly by following the steps under “GETTING STARTED” until you see the Mon12 prompt, then follow these steps to run your program:

1.Press and release the RESET button on the CMD912X board. You should see the PRESS ANY KEY message. Hit the return key to get the monitor prompt.

2.Type LOAD

This will prepare Mon12 to receive a program.

3.Select Upload and when prompted for a file name select your assembled program file in s- record format that was created in the previous section called: HELLO.S19

Your program will be sent to the board thru the serial port.

4.When finished loading you will see the > prompt again. Type GO 4400

This tells Mon12 to execute the program at address $4400, which is the start of our test program.

5.If everything is working properly you should see the message “Hello World” echoed back to your terminal screen. Press RESET to return to the monitor.

6.If you do not get this message, see the TROUBLESHOOTING section in this manual

You can modify the hello program to display other strings or do anything you want. The procedures for assembling your code, uploading it to the board and executing it remain the same. Mon12 has many features such as breakpoints, assembly/disassembly, memory dump and modify and program trace. Type HELP at the Mon12 prompt for a listing of commands or consult the Mon12 documentation on the disk for more information.

For a more powerful debugger with many advanced features such as source level debugging, you can use the NoICE debugger software. A full featured demo version is provided on the

CD, which you can use to get started. NOTE: To use this program instead of Mon12 you must simply move the CONFIG SWITCH position 3 ON, RESET the board, and run the NoICE software. See the help documentation in this program for more information.

NoICE monitor is not installed on Monitor versions R2 and earlier.

7

Programming Flash EEPROM

After debugging, you can program your application into Flash Memory so it executes automatically when you apply power to the board as follows:

1.Make a backup copy of HELLO.ASM then use a text editor to modify it.

2.Change the ORG location for the program start to the internal flash if needed.

3.Remove the comment ; character before one of the following lines to initialize the stack pointer which is necessary when running outside of a debugger:

LDS

#$3FFE

;

DG/DP128 or DP256 – initialize…

LDS

#$7FE

;

D60 - initialize the stack pointer

4.Remove the comment ; character from before the following 2 lines at the end, to set the reset vector to go to the beginning of the program (the label START) when powered on:

org

$fffe

reset vector

 

fdb

START

5.Re-Assemble HELLO.ASM as described in the "Assembling Source Code" section.

6.Select Program from the AxIDE menu and follow the message prompts. When prompted for a file name, enter the new HELLO.S19 file.

7.Press the RESET button on the board before clicking OK. When prompted to Erase, choose Yes.

8.When finished programming, REMOVE POWER then set the MODE SWITCH positions 1 and 2 OFF. Note: turn position 3 off also for DP256 version.

9.Re-Apply Power to the board. Your new program should start automatically and the “Hello World” prompt should be displayed in the terminal window.

To return to the Mon12 monitor program, set the MODE SWITCH positions 1 and 2 back ON then press RESET. Note: MODE switch 3 also must be ON for DP256 1K79 and earlier mask sets.

8

BDM OPERATION

The CMD912X board will emulate supported HC12 device internal flash memory in external ram. This feature allows BDM (Background Debug Modules) such as the AX-BDM12 to load and control the execution of code being developed without the necessity of the internal flash memory being programmed many times during the development process. This feature improves updating time and allows the use of may software breakpoints instead of being limited to only 2 hardware breakpoints.

Operation Notes for BDM use:

1)CMD912x CONFIG SWITCH should be set 1 ON, 2 OFF, 3 OFF, and 4 ON. Position 5 should be Off unless the DG/DT128 Fixed Page is desired to be emulated in ram. These settings provide external ram and PRU operation with the ECS enabled for Paging emulation.

2)PM12xxx MODE SWITCH is usually set for positions 1 and 2 off to select Single Chip Mode. This setting forces the BDM Monitor in the HC12 active immediately after Reset with the BDM connected which is desired for most BDM pods. The BDM can then load a script to set the desired operating mode and configuration, see next note. The

DP256 version should have Mode Switch position 3 ON for correct operation of the MODC select buffer during RESET.

3)The BDM initialization of the HC12 should set the correct operating MODE (Expanded

Wide for memory access) and enable port emulation for the PRU to operate. The EME, EMK, LSTRB, RW, IVIS, ROMEN and Stretch configuration bits should be set for proper memory map and PRU operation. The external RAM does not require any cycle stretch for accesses up to 25MHz E clock. The Axiom support CD contains sample set-up macros for the AX-BDM12.

9

Loading...
+ 18 hidden pages