Freescale mc9s08aw60 Compilation Study notes (i)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.