Applications Engineering
RTA-FOUSB-MON User’s Manual Rev 1.8
18 / 29
August 2003
8. Target MCU Resources Used by ICD for In-Circuit Debugging
This section describes the M16C MCU resources used by the ICD for in-circuit debugging (with the KD30
Debugger). These resources are NOT used when the ICD is used for programming (with the FoUSB
Programmer). See previous sections for details on how to connect the hardware for in-circuit debugging
or in-system programming support.
When used as debug interface, the ICD downloads a small program, called a kernel program (or ROM
Monitor), to the target M16C MCU to establish communications used for program debugging operations.
This kernel program is downloaded to the target MCU when KD30 application is started.
It is important to note that the operation of the ICD is transparent to the user. There is no special
software processing required to be able to use it as long as the user understands the exceptions and
follows the rules described below.
NOTE:
These resources are ONLY used when the ICD is used for in-circuit debugging. Only the MCU pin
resources are used when the ICD is used for in-system programming.
a. ROM
The kernel program code is located in the M16C memory space starts at address 0FF900H to 0FFE80H.
KD30 will display a message on any attempt to overwrite specified ROM location. Rules on ROM usage
are described below.
•
User memory allocated to the Kernel program should not be used. Any attempt to use this area
by the user code will be ignored.
•
The special page vector table is mapped from 0FFE00H to 0FFFDBH. It is suggested that, if
special page jumps are used, the special page numbers start with the minimum value of 20 and
increases to a maximum of 127 to accommodate future monitor size increases.
b. RAM
The kernel program utilizes 128 bytes of RAM memory located at the top of MCU RAM area. For
example, on an M30624 MCU, there is 20Kbytes of RAM located from 00400H to 053FFH. In this case,
the monitor will be using the addresses from 05380H to 053FFH. In addition, the monitor also uses 4
bytes (max) of RAM on the interrupt stack.
c. Interrupts
For all MCU’s that do NOT support DBC interrupt, the kernel program requires that the receive interrupt
vector for the monitor/boot UART
MUST
point to the communications entry point of the monitor, which is
0FF900H. In addition, the monitor reserves the following hardware interrupt vectors for its own use:
•
BREAK vector (0FFFE4H)
•
ADDRESS MATCH vector (0FFFE8H)
•
SINGLE STEP vector (0FFFECH)
•
DBC vector (0FFFF4H)
The user code download process will properly load values into these locations. User code that globally
disables interrupts for long periods of time (>1s), may interfere with the proper operation of the monitor.
NOTE:
For MCU’s that do NOT have DBC interrupts, always ensure that the global interrupt is enabled in
the startup files. Communications between ICD and the kernel program will fail when the global
interrupt is not set or disabled for long periods (>1s). This is the primary cause of communication
errors while using the KD30 Debugger.