AN2616 Freescale Semiconductor / Motorola, AN2616 Datasheet - Page 41

no-image

AN2616

Manufacturer Part Number
AN2616
Description
Getting Started with HCS08 and CodeWarrior Using C
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
How device
registers and bits
are used
MOTOROLA
NOTE:
The “:1” is used to indicate that a single bit is required and CodeWarrior C
compiler will pack together into a single byte.
To access RWB would require the following code.
To access RWB using the Metrowerks predefined macros would require the
following code.
The Metrowerks CodeWarrior C Compiler will generate bit set/clear instructions
for page 0 registers and memory; otherwise, it will generate bit mask operations
(| =, & =) for other addresses. Using bit structures with HCS08 for I/O registers
residing in page 0 is very efficient, requiring a single instruction for set, clear
and test/branch.
To use a register, simply use its name as defined within the data sheet; for
example:
To reference a bit within a register, concatenate the register name and the bit
name with an underscore between. For example:
Register and bit names MUST be in capital letters.
/*** DBGC - Debug Control Register ***/
typedef union {
} DBGCSTR;
extern volatile DBGCSTR _DBGC @0x00001816;
DBGC.Bits.RWB = 1;
DBGC.Bits.RWB = 0;
DBGC_RWB = 1;
DBGC_RWB = 0;
Getting Started with HCS08 and CodeWarrior Using C
byte Byte;
struct {
} Bits;
Freescale Semiconductor, Inc.
byte RWBEN
byte RWB
byte RWAEN
byte RWA
byte BRKEN
byte TAG
byte ARM
byte DBGEN
For More Information On This Product,
TPM2C0SC
TPM2C0SC_MS0B
Go to: www.freescale.com
:1;
:1;
:1;
:1;
:1;
:1;
:1;
:1;
/*Set RWB bit of DBGC */
/*Clear RWB bit of DBGC */
/* Enable R/W for Comparator B */
/* R/W Comparison Value for Comparator B */
/* Enable R/W for Comparator A */
/* R/W Comparison Value for Comparator A */
/*
/* Tag/Force Select */
/* Arm Control */
/* Debug Module Enable */
/*Set RWB bit of DBGC */
/*Clear RWB bit of DBGC */
Break Enable */
CodeWarrior C and HCS08
AN2616
41

Related parts for AN2616