The Mc9s08aw60 is a HCS08 series MCU, which is a 8-bit MCU consisting of HCS08 cores plus memory and peripheral modules. HCS08 Series MCU in addition to the MC9S08AW series, there are MC9S08GB series, MC9S08GT series, MC9S08AC series and so on. Different types of MCU applications focus on different areas.
The MCU for the HCS08 series has only 5 registers: A, h:x, SP, PC, CCR. are 8-bit, 16-bit, 16-bit, 16-bit, 8-bit respectively. Specific functions to be mastered in use. The frequency of the mc9s08aw60 is 4MHz, and a bus cycle is t=0.25us. Mc9s08aw60 the way to store data is the big-endian way: The low address holds the most significant bytes, in addition to know is the memory RAM address: $0070~$086f,flash Address: $0870~$17ff, $1860~ $FFAF. Then we can use CodeWarrior to write the code.
First, give the most basic framework:
org $0070; variable definition
X1 ds.b 1
org $1860; constants define and write out the main program
X2 DC.B 1
Main: primary function
Clra
Clrx
Nop
Again:; main loop
Nop
JMP again
org $fffe; reset vector
DC.W Main
After compiling, you can see the effect in the Debug panel. Where the use of the reset vector is in the address $fffe~ $FFFF write the address of the main function, when the reset directly executes the code in the $fffe, so into the main function, the program is back to the original fixed state, the use of the reset can be used to deal with the exception in the program, like the restart of the phone , initialization and the like always go back to a predictable fixed state. Other program code (such as: NOP means that empty operations occupy a bus cycle t) can read the data sheet, you can also see the "FREESCALE-HCS08 Microcontroller principle and application-instruction set Summary"-I have uploaded.
Freescale mc9s08aw60 Compilation Study notes (i)