Hardware Reference
In-Depth Information
one needs to increment or decrement the index register by 1, 2, or some other value. When such
errors occur, the program execution result will be incorrect. This type of error can be discovered
by checking the computation result of the first two elements.
S TACK F RAME E RRORS
This type of error will be discussed in Chapter 4.
I NCORRECT A LGORITHM
An incorrect algorithm can never result in a correct program. This type of problem cannot be
fixed by tracing the program. After program tracing fails to fix the problem, we must reexamine
the algorithm to see if it is incorrect.
3.8 Using CodeWarrior
CodeWarrior is an IDE designed to support the software development for all microcontroller
products manufactured by Freescale. CodeWarrior allows the user to debug his or her software
using the following three approaches:
1. Running the program using the simulator
2. Running the program on the target hardware programmed with the serial monitor
(The HCS12 MCU is programmed with the serial monitor.)
3. Running the program on the target hardware connected to a BDM-based debug adapter
CodeWarrior has a built-in simulator that can be used by the user to debug her or his soft-
ware. CodeWarrior can support software debugging via the serial monitor . Using this approach,
the user needs to connect the demo board to the COM port of the PC using a serial cable. At the
time of this writing, CodeWarrior can work with the following BDM-based adaptors to debug
users' software:
1. P&E Multilink/CyclonePro BDM adaptor
2. TBDML adaptor
3. Abatron BDI adaptor
4. Softec's inDART debugger
A BDM adaptor can also be part of the demo board. For example, the Freescale student
project board includes the P&E Multilink BDM adaptor. By plugging in different HCS12
microcontroller kits, the user can perform software debugging for several different HCS12
microcontrollers. Freescale publishes the public domain TBDML interface to be used by any-
one interested in building her or his BDM debugger kit.
3.8.1 Building a Software Project Using CodeWarrior
CodeWarrior can be started by clicking on its icon. The startup screen is shown in Figure 3.22.
CodeWarrior displays Tip of the Day whenever it starts up. The user can get rid of Tip of the Day
by clicking on the Close button.
CodeWarrior uses project as the unit for managing the software development task. The
software development process under CodeWarrior involves four stages.
Stage 1
Project setup
 
Search WWH ::




Custom Search