AN2616 Freescale Semiconductor / Motorola, AN2616 Datasheet - Page 54

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 use the
assembler within C?
How are interrupt
vectors redirected?
How do I use
masks?
54
NOTE:
This method has the advantage of defining an interrupt handler and its vector
in a single file, removing the need to maintain two files.
Refer to section “High Level Online Assembler for Motorola HC08” in the
document “Manual_Compiler_HC08.pdf” included with CodeWarrior.
The serial monitor implements a redirection of the vector table in an
unprotected area of FLASH; this is discussed in the HCS08 serial monitor
documentation.
A mask-based definition for a register would look something like:
To access RWB would require the following code:
CodeWarrior header files implement structures, NOT bit masks. If you wish to
use bit masks, thet must be defined manually.
VECTOR ADDRESS 0xFFD2 intSW1
interrupt 22 void intSW1(void){
}
/*** DBGC - Debug Control Register ***/
extern volatile byte _DBGC @0x00001816;
#define RWBEN
#define RWB
#define RWAEN
#define RWA
#define BRKEN
#define TAG
#define ARM
#define DBGEN
DBGC = DBGC | RWB;
DBGC = DBGC & ~RWB;
Getting Started with HCS08 and CodeWarrior Using C
Freescale Semiconductor, Inc.
For More Information On This Product,
Add the vector table entry to the linker.prm file. For example:
Use the keyword “interrupt” and specify the interrupt vector number in
the definition of the interrupt routine. This does not require any
modification to the linker.prm file. For example:
Go to: www.freescale.com
0x01;
0x02;
0x04;
0x08;
0x10;
0x20;
0x40;
0x80;
/* 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 */
/* Break Enable */
/* Tag/Force Select */
/* Arm Control */
/* Debug Module Enable */
/*Set RWB bit of DBGC */
/*Clear RWB bit of DBGC */
MOTOROLA

Related parts for AN2616