AN2616 Freescale Semiconductor / Motorola, AN2616 Datasheet - Page 52

no-image

AN2616

Manufacturer Part Number
AN2616
Description
Getting Started with HCS08 and CodeWarrior Using C
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
AN2616
How can I force a
variable to reside in
page 0?
How do I disable the
watchdog?
Problems with
variable, structure,
or type definition?
52
NOTE:
To instruct the linker to allocate storage for variables in page 0, enclose the
declarations within the following #pragma statements in the file where the
variable is declared (for example, main.c):
For example:
The first #pragma statement instructs the compiler to allocate data from this
point on in the short segment (page 0), MY_ZEROPAGE is the default data
segment used within the linker file.
The second #pragma statement instructs the compiler to return to the default
data section for allocation of subsequent variables.
Segment names assume default project and linker configuration used.
It may be necessary to disable the watchdog whilst debugging code, or an
application may not require it.
To disable the watchdog, simply clear the COPE bit in the SOPT register as
follows:
Occasionally, CodeWarrior will not have the correct definition for a variable, a
structure type or a macro definition, for example. This may be due to
CodeWarrior’s cached definition; it can normally be rectified by clearing all
object code from a project and rebuilding:
#pragma DATA_SEG __SHORT_SEG MY_ZEROPAGE
/*Page 0 data declarations go here*/
#pragma DATA_SEG DEFAULT
#pragma DATA_SEG __SHORT_SEG MY_ZEROPAGE
byte p0i, p0j;
#pragma DATA_SEG DEFAULT
SOPT_COPE = 0;
Getting Started with HCS08 and CodeWarrior Using C
Freescale Semiconductor, Inc.
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA

Related parts for AN2616