M16C R8C UART Debugger User's Manual: Renesas Microcomputer Development Environment System
M16C R8C UART Debugger User's Manual: Renesas Microcomputer Development Environment System
M16C R8C UART Debugger User's Manual: Renesas Microcomputer Development Environment System
All information contained in these materials, including products and product specifications,
represents information on the product at the time of publication and is subject to change by
Renesas Electronics Corp. without notice. Please review the latest information published by
Renesas Electronics Corp. through various means, including the Renesas Technology Corp.
website (http://www.renesas.com).
(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its majority-
owned subsidiaries.
(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
Active X, Microsoft, MS-DOS, Visual Basic, Visual C++, Windows and Windows NT are either registered trademarks or
trademarks of Microsoft Corporation in the United States and other countries.
IBM and AT are registered trademarks of International Business Machines Corporation.
Intel and Pentium are registered trademarks of Intel Corporation.
Adobe and Acrobat are registered trademarks of Adobe Systems Incorporated.
All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
5
Figure 2 Circuit Using the RS-232C Cable with the R8C/M11A Group.
Figure 3 Circuit Using the RS-232C Cable with the R8C/M12A Group.
6
2. Preparing the M16C R8C FoUSB/UART Debugger
The M16C R8C FoUSB/UART debugger (hereinafter R8C UART debugger) is used for
debugging by connecting an RS-232C cable between the host computer and the target
board.
A monitor program comes bundled and is automatically installed with the R8C UART
debugger software.
For the R8C Family, the monitor program is automatically programmed when starting the
R8C UART debugger. The monitor program does not need to be preprogrammed with an
M16C FlashStarter or other flash programmer.
Note: Before using the R8C UART debugger for the R8C/Mx Series, erase the user
area using a serial writer such as Flash Development Toolkit in advance.
After selecting an existing workspace and pressing [OK], the screen shown in letter t) (Page 21)
is displayed.
7
b) Select “Create a new project workspace” and press [OK].
c) The Project Generator starts. When a toolchain is preinstalled, the following screen is
displayed.
- ”Workspace Name”
Enter a name to create a new workspace. “sample” has been input as an example.
- ”Project Name”
Enter a project name. If the project name is to be the same as the workspace name, it is
not necessary to input anything in the “Project Name” field.
8
- ” CPU family”
Select the applicable CPU family. In this case, M16C has been selected for the R8C
Family.
- ” Toolchain”
When using a toolchain, select the applicable toolchain name. When not using a
toolchain, select “None”.
Select “Toolchain Version”, “CPU Series”, “CPU Group” and then press [Next]. In this example,
the R8C/M12A Group is selected.
9
e) Select the MCU ROM size and other related settings.
Select the MCU ROM size and heap size. Select “None” for the on-chip debugging emulator. And
press [Next].
f) Set the stack.
10
g) When the toolchain setting is complete, the following screen is displayed.
11
i) Verify the file names to be generated.
j) The figure below displays the files generated by the High-performance Embedded
Workshop based on the above settings. Pressing [OK] launches High-performance
Embedded Workshop.
12
k) Check the section address. Under the “Build” menu, select “Renesas M16C Standard
Toolchain”.
l) “Renesas M16C Standard Toolchain” is displayed. Click on the “Link” tab and select
“Section Order” from the “Category” pull-down menu. Make sure the section start
address does not overlap with the monitor program occupied area shown in Table 1. If
there is any overlap, edit the address value.
13
m) Double-click the source program to launch the program editor.
n) When the program is complete, under the “Build” menu, select “Build” or “Build All” to
build the program.
14
o) The result of the build is displayed.
p) Connect with the target. A host computer can easily be connected with the target by
switching to the session file in which the setting to use the R8C UART debugger is
pre-registered.
15
q) The Init screen is displayed. Select the “Serial” radio button and press [Refer(ence)].
16
s) Select one of the following MCU files depending on the group and memory size.
Memory Group
4KB
R5F2M112AUART.MCU R5F2M122AUART.MCU
8KB
Note: 2-Kbyte memory size chips such as R5F2M110A and R5F2M120A are not
supported.
t) Select the appropriate ”Port” and ”Baud Rate” from the pull-down menus. Press [OK] to
download the monitor program.
Note: When connecting the R8C UART debugger,all data in the flash memory is erased.
17
u) To download a user program, select “Download File (X30 file)” in the “Download
Modules” submenu under the “Debug” menu.
v) To reset the user program, select “Reset CPU” under the “Debug” menu.
18
w) The cursor moves to the top of the user program and debugging starts.
19
3. Memory Map When Using the R8C UART Debugger
Figure 4 shows a memory map (8 KB).
00000h
0FFD8h
SFR Reserved
002FFh Undefined
instruction
00400h
RAM Monitor RAM Overflow
004FFh BRK Instruction
(2KB) User RAM
005FFh
Address Match
Single Step
Watchdog Timer
0E000h
Reserved
User Program
Reserved
Area
0FFFFh
Vector Area Reset
20
5. Notes on Using the R8C UART Debugger
5.1. Restarting the R8C UART Debugger After it is Done Debugging
When restarting the R8C UART debugger, turn off the power to the target and turn on the
power again. When starting the R8C UART debugger again, please follow the procedure
below to connect:
(1) After disconnecting HEW with the target, please turn the power off.
(2) After turning the power of the target off again and erasing the user program area using a
serial writer such as flash Development Toolkit, turn the power of the target off.
(3) Please turn the power of the target on and start the R8C UART debugger again.
#include "typedefine.h"
#ifdef __UART__
#endif
21
b) Add the file created above to the project. Under the “Project” menu, select “Add Files…”.
When the file selection screen is displayed, select “firm.c”.
22
c) To add the compile option, select “Renesas M16C Standard Toolchain…” under the
“Build” menu.
d) “Renesas M16C Standard Toolchain” is displayed. Select “Defines” from the “Show
Entries For” pull-down menu, and then press [Add…].
23
e) “Set defined macro” is displayed. Enter “_UART_” in the “Macro” field and press [OK]
f) To set the link option, in the “Renesas M16C Standard Toolchain” window, click on the
“Link” tab and select “Section Order” from the “Category” pull-down menu. Add the
following to the start address of the monitor program occupied area shown in Table 1.
• Memory size: 48KB
FirmArea_NE
• Memory size: 64KB, 96KB, 128KB
FirmArea_FE
When the above settings cause the user program to overlap with the monitor program
occupied area, an error is output.
24
5.4. Frequency Characteristics
The monitor program only operates at 38600bps.
The monitor program operates in developer tool-dedicated high-speed on-chip oscillator.
However, note that operation may not be possible when dividing the main clock and using it
with less than 1 MHz even in the range of the above frequency. Do not use the low-speed
on-chip oscillator clock as the system clock.
Note: Communication may not be possible depending on temperature and voltage.
25
5.6. Limitations on Stop Mode or Wait Mode
When using stop mode or wait mode, start the R8C UART debugger in free-run mode, and
close the RAM window, C watch window, and ASM window in advance. Also, do not operate
the R8C UART debugger until the program stops at the break point by setting the break
point after exiting stop mode or wait mode.
Note: In free-run mode, use the R8C UART debugger while the RAM window, C watch
window, and ASM window are closed.
26
5.9. Executing Anomalistic Steps
• Software interrupt instruction
Instructions that generate software interrupts (undefined instruction, BRK instruction,
and INT instruction) cannot be continuously step executed in the instruction internal
processing.
Example: INT instruction
NOP
NOP
INT #3 INT instruction is skipped over
NOP when performing step execution
JMP MAIN
INT_3:
NOP Address at which program
execution should stop
NOP
NOP
REIT
• INT instruction
To debug the program using the INT instruction, set the software break for the INT
instruction process and use the Go command.
Example:
NOP
INT #3 Executed by the Go
command
NOP
JMP MAIN
INT_3:
NOP
Break
NOP
REIT
27
5.10. Limitations on Peripheral Functions
UART0 is used for communication between the monitor program and the host computer. Do
not use UART0 in the user program. Do not connect the pins below to other pins as they are
used for communication with the host computer.
• R8C/M11A Group
P1_6/TRCIOB (9pin), P1_4/TRJO/TRCIOB (11pin)
• R8C/M12A Group
T P1_6/TRCIOB (14pin), P1_4/TRJO/TRCIOB (16pin)
28
M16C/R8C UART Debbuer
User’s Manual
R8C Family / R8C/3x Series, R8C/Lx Series
Notes on Connecting R8C/3xC Group R8C/3xD Group R8C/LxC Group
R20UT0540EJ0100
(Previous Number:REJ09B0567-0100)