Motorola MC9S12DP256, CML12S-DP256 manual Programming HCS12 Flash EEprom, Auto

Models: MC9S12DP256 CML12S-DP256

1 24
Download 24 pages 45.88 Kb
Page 8
Image 8

C M L 1 2 S D P 2 5 6

0 7 / 1 7 / 0 2

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, memory dump and modify and simple program trace (no redirect of the PC is followed). 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 set the Autostart, see the NOICE chapter for details.

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

#$3F80 ; initialize stack location…

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

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

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

6.When finished programming, Reset the board to get the Monitor prompt again. Use the monitor AUTO command to set the Autostart Reset vector:

>AUTO 4000

AutoStart ON, effective address = 4000

>

7.Verify AUTO OFF option jumper is not installed. (Spare jumper on revision C boards)

8.RESET or 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, install the AUTO OFF option jumper then press RESET. Execute the monitor command NOAUTO to disable the Autostart and allow removal of the Auto Off option jumper for normal operation.

8

Page 8
Image 8
Motorola MC9S12DP256, CML12S-DP256 manual Programming HCS12 Flash EEprom, Auto