Programming Flash Eeprom - Motorola 68HC12B32 User Manual

For motorola 68hc12b32 and 68hc12bc32 microcontrollers
Table of Contents

Advertisement

Programming Flash EEPROM

You can program your application into EEPROM 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. Change the start
of the program to $8000 which is the beginning of the EEPROM. Do this by changing the
"ORG $1000" to "ORG $8000".
2. Remove the comment ; character from before the following line to initialize the stack
pointer which is necessary when running outside of D-Bug12:
LDS
3. Add a comment ; character to the beginning of the first RTS statement, which will cause
the program to end gracefully with an endless loop:
;
RTS
bra
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
fdb
5. Re-Assemble HELLO.ASM as described in the "Assembling Source Code" section.
6. Select "CME12BC" under AxIDE.
7. Select the "Program" option and when prompted for a file name, enter the new
HELLO.S19 file then select [OK].
8. Set the CONFIG SWITCH positions 1,2,3,4 and 6 to ON.
9. Press the RESET button on the board then select Continue or hit ENTER. A new utilities
menu should be displayed. If you have trouble here, see the TROUBLESHOOTING
section.
10. Set the CONFIG SWITCH position 5 ON. The red VPP light should come on.
11. When prompted to "Erase" choose Yes.
12. When finished programming, set the CONFIG SWITCH positions 1,2,3,4 and 5 OFF. The
VPP light should turn off.
13. Cycle power or press RESET on the board. Your new program should start automatically
and the "Hello World" prompt should be displayed in the terminal window.
To return to the D-Bug12 monitor program, set the CONFIG SWITCH positions 1,2,3 and 4
back ON then press RESET.
#$C00
; initialize the stack pointer
; return (use this only if called, from monitor
ENDPROG ; endless loop
reset vector
START
8

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

68hc12bc32Cme-12b/bcCme-12bCme-12bc

Table of Contents