AN2548 Freescale Semiconductor / Motorola, AN2548 Datasheet - Page 22

no-image

AN2548

Manufacturer Part Number
AN2548
Description
Serial Monitor Program for HCS12 MCUs
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2548/D
Conclusion
Code Listing
22
This application note has described a 2-Kbyte serial monitor program. In
addition to the use of this program as a debug monitor program, it also serves
as a good programming example for the HCS12 Family of microcontrollers and
demonstrates a number of useful programming techniques.
Routines for erasing and programming nonvolatile FLASH memory are
described in detail. The unusual DoOnStack subroutine copies a small routine
onto the stack and executes it there since it is not possible to program or erase
the FLASH memory from code executing within the same FLASH array. This
routine can easily be adapted for use in other user programs. The WriteD2IX
subroutine decides whether to use FLASH or simple RAM write operations,
depending on the address of the location to be programmed. The reset
initialization routines show how to setup the PLL and SCI subsystems. A
technique for differentiating between a warm reset compared to a cold reset is
also described.
A set of 23 primitive monitor commands has been developed to support
third-party FLASH programming and debug tools. This monitor enables
debugging through an on-chip SCI serial interface instead of using a more
expensive background debug interface development system.
Companion software for this program is available from the Motorola web site,
http://motorola.com/sps:
AN2548SW1.zip — Complete Assembly source files
AN2548SW2.zip — Full CodeWarrior project
Freescale Semiconductor, Inc.
For More Information On This Product,
Serial Monitor Program for HCS12 MCUs
Go to: www.freescale.com
MOTOROLA

Related parts for AN2548