No part of this material may be reproduced or duplicated in any form or by any means without the written permission of Seiko
Epson. Seiko Epson reserves the right to make changes to this material without notice. Seiko Epson does not assume any
liability of any kind arising out of any inaccuracies contained in this material or due to its application or use in any product or
circuit and, further, there is no representation that this material is applicable to products requiring high level reliability, such
as medical products. Moreover, no license to any intellectual property rights is granted by implication or otherwise, and there
is no representation or warranty that anything made in accordance with this material will be free from any patent or copyright
infringement of a third party. This material or portions thereof may contain technology or the subject relating to strategic
products under the control of the Foreign Exchange and Foreign Trade Law of Japan and may require an export license from
the Ministry of International Trade and Industry or other approval from another government agency.
Windows 95, Windows 98 and Windows NT are registered trademarks of Microsoft Corporation, U.S.A.
PC/AT and IBM are registered trademarks of International Business Machines Corporation, U.S.A.
All other product names mentioned herein are trademarks and/or registered trademarks of their respective owners.
Starting April 1, 2001, the product number will be changed as listed below. To order from April 1,
2001 please use the new product number. For further information, please contact Epson sales
representative.
Configuration of product number
Devices
S1C33104F0A01
Development tools
S5U1
∗1: For details about tool types, see the tables below. (In some manuals, tool types are represented by one digit.)
∗2: Actual versions are not written in the manuals.
C33L01D11
00
Packing specification
Specification
Package (D: die form; F: QFP)
Model number
Model name (C: microcomputer, digital products)
Product classification (S1: semiconductor)
00
Packing specification
Version (1: Version 1 ∗2)
Tool type (D1: Development Tool ∗1)
Corresponding model number (33L01: for S1C33L01)
Tool classification (C: microcomputer use)
Product classification
(S5U1: development tool for semiconductor products)
Written for those who develop applications using the S1C33 Family of microcomputers, this manual describes how to
implement the S1C33 Family debug monitor library S5U1C330M2S and how to debug the target program.
2 Implementing the Debug ..............................................................................................4
2.1 Resources Required for the Debug Monitor..................................................................................................4
2.2 Starting Up the Debug Monitor...........................................................................................................................5
2.3 Building an Application Program........................................................................................................................6
2.4 Creating Communication Control Routines...................................................................................................7
3 Target Program and Debugging..................................................................................10
3.1 Notes for Creating Target Programs.............................................................................................................10
3.2 Parameter File for Debugging..........................................................................................................................10
3.3 Starting Up and Terminating Procedure of Debugging..........................................................................11
3.5 Precautions for Debugging................................................................................................................................14
3.5.1 Restriction on Debugging Command..........................................................................................14
3.5.2 Other Precautions ..............................................................................................................................14
A.1 Outline of S5U1C330MxD1 Board.................................................................................................................15
A.2 Names and Functions of Each Part..............................................................................................................15
A.3 Connecting the System......................................................................................................................................16
A.5 Program Debugging with a S5U1C33xxxDx Board and S5U1C330M2S.......................................18
A.6 Indispensable Signal Pins of S5U1C330MxD1.........................................................................................21
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
i
1 S5U1C330M2S PACKAGE
1 S5U1C330M2S Package
The Debug Monitor S5U1C330M2S is a middleware designed for S1C33 Family single-chip
microcomputers.
It provides program-debugging functions on the user target board or for the actual product.
1.1 Features
The following lists the features of S5U1C330M2S:
• It is provided as a library file that can be linked to the user program.
This package also contains source codes of all the modules.
• S5 U1 C33 0M2 S u se s a pp r ox . 1 0KB RO M, a pp r ox . 2 .5K B RA M a nd a c ha n ne l o f s er i a l i nt er f a c e o n t he S1 C33
chip. It allows direct program debugging via the S5U1C330MxD1 board using the debugger db33 on the personal
computer.
• Allows debugging of the target program in the RAM, ROM or Flash memory on the target board.
• Supports the following debugging functions:
- Successive execution and step execution of the program
- PC break and data break
- Memory/register operation
- Flash memory writing
A configuration of the debugging system is shown in Figure 1.1.1.
Target board
S1C33xxx
Serial
interface
External
RAM
External
ROM
Figure 1.1.1 Configuration of debugging system
FLASH
memory
S5U1C330MxD1
interface board
RS232C
115,200 bps
Debugger
db33
EPSON
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
1
1 S5U1C330M2S PACKAGE
1.2 Components of S5U1C330M2S Package
The following lists the contents of S5U1C330M2S Package:
When unpacking, make sure that all of the following components are included.
(1) Tool disk (3.5' FD for PC/AT, 1.44MB)1
(2) S1C33 Family Debug Monitor Operation Manual (this manual)2 (1 English/1 Japanese)
(3) Warranty2 (1 English/1 Japanese)
1.3 Installation
S5U1C330M2S needs to be linked with the user program as it is implemented. Therefore, make sure all tools of the
"S1C33 Family C Compiler Package" have been installed in the personal computer and are ready to run before
installing the S5U1C330M2S files. The basic system configuration is described below.
• Personal computer:
IBM PC/AT or compatible
(PC with Pentium 90 MHz or higher and 32MB or more memory recommended)
One channel of the serial port is used to communicate with the debug monitor.
• OS:
Windows95, Windows NT 4.0 or higher version (English version or Japanese version)
All the S5U1C330M2S files are supplied on one floppy disk. Execute the self-extract file "mon33vXX.exe" on the
FD to install the files. ("XX" in the file name represents the version number, for example, "mon33v10.exe" is the
file name of S5U1C330M2S ver. 1.0.)
When "mon33vXX.exe" is started up by double-clicking the file icon, the following dialog box appears.
Enter a path/folder name in the text box then click
[Unzip]. The specified folder will be created and all the
files will be copied to the folder.
When the specified folder already exists on the specified
path, the folder will be overwritten without prompting if
[Overwrite Files Without Prompting] is checked.
The following lists the configuration of directories and files after copying.
(root)\(default: C:\E0C33\MON33\)
readme.txtSupplementary explanation (in English)
readmeja.txtSupplementary explanation (in Japanese)
lib\..... MON33 library
mon33ch0.libS5U1C330M2S library that uses the serial I/F Ch.0 on the S1C33xxx
mon33ch1.libS5U1C330M2S library that uses the serial I/F Ch.1 on the S1C33xxx
mon33.libS5U1C330M2S library that does not use a serial I/F on the S1C33xxx
... These libraries cannot be used with the ICE or ICD.
Normally, either "mon33ch0.lib" or "mon33ch1.lib" is used according to
the serial I/F channel used. Use "mon33.lib" when providing a serial I/O
circuit separately and when not using the S5U1C330MxD1 board.
mon33ice.libLibrary that does not use a serial I/F on the S1C33xxx for debugging the
S5U1C330M2S using the ICE or ICD
2
EPSONS1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
1 S5U1C330M2S PACKAGE
mon33ch0.makMake file for building mon33ch0.lib
mon33ch1.makMake file for building mon33ch1.lib
mon33.makMake file for building mon33.lib
mon33ice.makMake file for building mon33ice.lib
src\..... MON33 source files
m33_def.hS5U1C330M2S definition file
m3c_brk.cC source file for break functions
m3c_exe.cC source file for program execution
m3c_flsh.cC source file for Flash memory operation
m3c_main.cS5U1C330M2S main C source file
m3c_mem.cC source file for memory operation
m3c_othe.cC source file for other functions
m3c_sci.cC source file for sending/receiving messages
m3s_exe.sAssembly source file for program execution
m3s_flsh.sAssembly source file for Flash memory operation
m3s_init.sAssembly source file for S5U1C330M2S initial set-up
m3s_mem.sAssembly source file for memory operation
m3s_sci.sAssembly source file for sending/receiving messages
dmt33xxx\ ..... Sample source files for the S5U1C33xxxDx, MON33 build files and related files
A sample program for blinking the LED on the S5U1C33xxxDx, a source for the onboard Flash memory write/erase routines and the make files are included in each
dmt33xxx folder. The source files can be modified to use in the application program if
necessary. Refer to "readme.txt" or "readmeja.txt" for the contents of the dmt33xxx
folder.
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
3
2 IMPLEMENTING THE DEBUG MONITOR
2 Implementing the Debug Monitor
This chapter describes how to implement the debug monitor and how to start it from the application
program.
2.1 Resources Required for the Debug Monitor
The debug monitor uses the following resources:
• Approximately 10KB of ROM area for the program code of the debug monitor.
• Approximately 2.5KB of RAM area for the work and stack area.
• Since the debug monitor uses the debugging exception of the CPU, addresses 0x0 to 0xF of the built-in RAM area
are used as the vector and stack for processing debugging exceptions. Furthermore, addresses 0x10 to 0x2F are
reserved for extending functions.
• One channel (Ch.0 or Ch.1) of the serial interface (8-bit asynchronous mode) is used for communicating with the
debugger db33 on the personal computer.
Figure 2.1.1 shows a connection diagram.
S1C33xxx
VSS
SOUT0/1
SIN0/1
SCLK0/1
Target board
S5U1C330MxD1
Connected to the personal computer
using the RS232C cable
(Baud rate: 115,200 bps)
Figure 2.1.1 RS232C connector diagram
• Communication via RS232C is performed by a software polling method without any interrupt related resource.
• A serial I/O device outside the S1C33 chip can be used by customizing the serial I/O routine (see Section 2.4).
• S5U1C330M2S uses the TXD, RXD and status registers of the corresponding serial interface channel exclusively.
Therefore, do not access these control registers.
Furthermore, fix the I/O pins for the channel at the serial interface pins using the port function select register. For
example, the sample program "m3s_sci.s" writes 0x07 to the P0 function select register (0x402D0) when Ch.0 is
used or 0x70 when Ch.1 is used to set the serial interface pins.
4
EPSONS1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
2 IMPLEMENTING THE DEBUG MONITOR
2.2 Starting Up the Debug Monitor
The debug monitor starts by jumping to m_mon_start( ).
Normally, provide a select switch outside the S1C33 chip for selecting either starting up the debug monitor or a
normal execution and create the program that can jump to m_mon_start( ) from the boot routine after an initial reset.
Furthermore, start the debug monitor after initializing the BCU if necessary. In case the debug monitor is started
before the BCU is initialized, downloaded data cannot be written to a 8-bit device or in DRAM. However, when the
S5U1C330M2S itself is placed on the 16-bit ROM and the 16-bit SRAM is used as a work area, it can be operated
even in the default setting (7-wait state) when operating in 20 MHz. In the following example, the initial set-up
statements are described as comments so that the BCU operates by default. By decreasing the wait cycle number
(2-wait setting in the example below), the file loading and other operations may improve the response time
(approximately 5 to 10%).
Example: boot routine of "dmt33004\m3s_boot.s"
;******************************************************************************
;
;BOOT program
;
;******************************************************************************
BOOT:
The S5U1C330M2S modules are provided as a library file "mon33*.lib" in the directory "lib\". Link this library to
the user modules.
When using the serial interface on the S1C33 chip and the S5U1C330MxD1 board, link "mon33ch0.lib" (Ch.0 is
used) or "mon33ch1.lib" (Ch.1 is used) accordingly. When not using the serial interface on the S1C33 chip and the
S5U1C330MxD1 board, create serial I/O routines separately and link "mon33.lib".
Specify the "lib\" directory of the S5U1C330M2S as a library path in the linker command file when linking.
Example: "dmt33004\dmt33004.cm"
;Map set
-code 0x0c00000; set relative code section start address
-bss 0x06ff640; set relative bss section start address
Since all the source codes of the debug monitor are provided in the directory "src\", it is possible to customize the
debug monitor if necessary. In this case, rebuild the library using "mon33*.mak" (make file for creating
"mon33*.lib") in the directory "lib\".
S5U1C330M2S allows the debugger db33 to write the target program to be debugged in the RAM or Flash memory
on the target board. In this case, it is not necessary to create a target object linked to the debug monitor. When the
S5U1C33xxxDx board (S5U1C33104D1, S5U1C33209D1, etc.) is used, the target program can be downloaded to
the RAM or Flash memory and can be debugged by writing S5U1C330M2S and a simple boot program to the ROM.
When executing the target program in the external ROM on the target board, link the debug monitor to the target
program and create an object that is mapped to the external ROM.
6
EPSONS1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
2 IMPLEMENTING THE DEBUG MONITOR
2.4 Creating Communication Control Routines
For communicating with the debugger, the debug monitor calls the following four RS232C routines (1 to 4).
"mon33chX.lib" that contains these routines can be used when using the serial interface Ch.0 or Ch.1 on the S1C33
chip and the S5U1C330MxD1 board. Otherwise, it is necessary to create these routines according to the system
since "mon33.lib" must be used. The sample program "m3s_sci.s" that uses the serial interface Ch.0/Ch.1 of the
S1C33104/S1C33209 is provided in "src\", so use it after modifying if necessary.
(1) void m_io_init( )
This is an initial set-up routine of the serial interface. Return value is not necessary.
Set up I/O terminals, input clock, baud rate and a data format. Select 8-bit asynchronous mode, no parity and 1
stop bit. The baud rate should be set to a value supported by the debugger db33 and the personal computer.
Refer to the "S1C33XXX Technical Manual" for the serial interface and for setting the clock.
The sample program "m3s_sci.s" assumes use of the S5U1C330MxD1 board. It sets the baud rate to 115.2 kbps
when a 1.843 MHz external clock is used.
Example: "m_io_init( ) of "m3s_sci.s"
#defineMON_VER 0x11;monitor firm-ware version
#ifdef SIO0
#define STDR0x000401e0;transmit data register(ch0)
#define SRDR0x000401e1;receive data register(ch0)
#define SSR0x000401e2;serial status register(ch0)
#define SCR0x000401e3;serial control register(ch0)
#define SIR0x000401e4;IrDA control register(ch0)
#define PIO_SET 0x07;port function register
#else
#define STDR0x000401e5;transmit data register(ch1)
#define SRDR0x000401e6;receive data register(ch1)
#define SSR0x000401e7;serial status register(ch1)
#define SCR0x000401e8;serial control register(ch1)
;******************************************************************************
;
;void m_io_init()
;serial port initial function
;
;******************************************************************************
.global m_io_init
m_io_init:
ld.w%r0,SIR_SET;1/16 mode
xld.b[SIR],%r0;SIR set
ld.w%r0,SCR_SET
xld.b[SCR],%r0;SCR set(#SCLK input 1.843MHz)
xld.w%r0,PIO_SET
xld.b[PIO],%r0;IO port set
xld.w%r0,SCR_EN|SCR_SET
xld.b[SCR],%r0;SCR set
ret
In addition to the sample program above, "dmt33001\m3s_sci.s " is provided. This program sets the baud rate to
38,400 bps based on the 20 MHz S1C33104 internal clock. Refer to it if necessary.
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
7
2 IMPLEMENTING THE DEBUG MONITOR
(2) void m_snd_1byte(unsigned char)
This is a routine that sends 1-byte data. This routine receives 1-byte data as the argument (R12 register) and
sends it via the serial interface. Return value is not necessary.
Example: m_snd_1byte( ) of "m3s_sci.s"
;******************************************************************************
;
;void m_snd_1byte( sdata )
;1 byte send function
; IN : uchar sdata (R12) send data
;
;******************************************************************************
.global m_snd_1byte
m_snd_1byte:
pushn%r3;save r3-r0
snd000:
xbtst[SSR1],0x1;TDBE1(bit1) == 0(full) ?
jreqsnd000;if full, jp snd000
xld.b[STDR1],%r12;write data
popn%r3;restore r3-r0
ret
(3) unsigned char m_rcv_1byte( )
This is a routine that receives 1-byte data. Store received 1-byte data into m_rcv_data. It returns following
error codes (unsigned char) as the return value:
0: received normally
1: framing error
2: parity error
3: overrun error
Example: m_rcv_1byte( ) of "m3c_sci.s"
;******************************************************************************
;
;uchar m_rcv_1byte()
;1 byte receive function
; OUT : 0 receive OK
; 1 receive ERROR (framing err)
; 2 (parity err)
; 3 (over run err)
;
;******************************************************************************
mon33.lib.... Link "mon33.lib" that does not include SIO routine
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
9
3 TARGET PROGRAM AND DEBUGGING
3 Target Program and Debugging
This chapter describes precautions for debugging using the debug monitor.
3.1 Notes for Creating Target Programs
Follow the instructions below when creating the target program to be debugged:
• Since the debug monitor uses the debugging exception of the CPU, addresses 0x0 to 0xF of the built-in RAM area
are used as the vector and stack for processing debugging exceptions. Therefore, the target program cannot use this
area. Furthermore, do not use addresses 0x10 to 0x2F.
• Wh e n d eb ug gi ng t he t ar g e t p ro gr a m b y wr i ti ng i n t he RA M o r Fl as h me mor y o n t he t ar g e t b oa r d, ma p t he
program to that address.
• Th e d eb ug mo ni to r d oe s n ot a ll ow f or c e d b re a k f un c ti on s s uc h a s k ey b re a k s. Fo rc e d b re a k f un c ti on s s ho ul d b e
ma de i n t he t ar g e t p ro gr a m u si ng a k ey i np ut i nt er r u pt o r a n NMI i np ut . Se tt in g a h ar d wa r e PC b re a k i n t he
interrupt processing routine makes it possible to execute a forced break.
3.2 Parameter File for Debugging
A debug-parameter file is required to start the debugger. Create the file according to the memory configuration of
the target system. When using the debug monitor, the debugger ignores all the settings for the ICE emulation
memory.
When using a Flash memory, specify it as a RAM.
Example: "dmt33004\sample\33104_m.par"
CHIP33104; chip name (33XXX)
IROM1000; internal ROM is 80000 to 80FFF
FOPT0000; f option size
PRC VER00 ff; allow any PRC board
PRC STATUS**************** ; allow any PRC board status
MPU; 0xC00000 external boot address
VER1; this file version
RAM07FF; internal RAM area 2KB
IO400004ffff; internal IO area 64KB
RAM2000002fffff; external FLASH 1MB
RAM6000006fffff; external SRAM 1MB
EROMc00000cfffff; external ROM 1MB
; Stack area except internal RAM area (max 8 areas, 256bytes boundary)
STACK6000006fffff; external stack area 1MB
END
10
EPSONS1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
3 TARGET PROGRAM AND DEBUGGING
3.3 Starting Up and Terminating Procedure of Debugging
Follow the procedure below to start debugging.
1. Make sure the power of the target board and personal computer are off.
2. Connect the S5U1C330MxD1 board to the target board in which the debug monitor is implemented and connect
the S5U1C330MxD1 board to the personal computer with the RS232 cable.
3. Turn the target board on and then start the debug monitor.
4. Turn the personal computer on and start the debugger db33 in debug monitor mode from the work bench wb33 or
DOS prompt.
Example: db33 -mon -b 115200 -p 33104_m.par
Follow the procedure in order from Step 4 to Step 1 to terminate debugging and for power off.
Note:When connecting and disconnecting the RS232C cable, make sure the target board and the
personal computer are off.
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
11
3 TARGET PROGRAM AND DEBUGGING
3.4 Debugging Method
The following three methods are available for debugging the target program.
1. Debugging in the ROM
Map the target program in the ROM after linking to the debug monitor. The target program can be executed and
debugged in the ROM.
Since the [Source] window of the debugger displays the disassembled content of the ROM on the target system,
it is not necessary to load the target program with the lf command. To display the source, load the same
absolute object file as the one written to the ROM. In this case, by using the ld command instead of the lf
command, the db33, except for the object code, loads only the debugging information.
After starting the debugger, follow the process below before starting to debug:
1. Load the debugging information (when displaying the source or using symbols).
2. Set up a hardware PC break point for the forced break function.
Example: command file example of the above description
ld sample.srf; Load the debugging information of the target program
bh ESC; Set up a hardware PC break point at the label ESC (for forced break)*
* For example, an NMI input switch can be used for the forced break function.
Example: NMI processing routine example for forced break function
NMI:; nmi
nop
.global ESC
ESC:; Label set as a hardware PC break point for the forced break function
reti
Note:When debugging the target program in the ROM, the software PC break function (bs command)
cannot be used.
2. Debugging in the RAM
Load the target program into the RAM of the target system with the lf command to debug the program in the
RAM.
After starting the debugger, follow the process below before starting to debug:
1. Set the trap table base address (only when placing the trap table in the RAM).
2. Load the target program.
3. Reset the CPU.
4. Set up a hardware PC break point for the forced break function.
The following shows a debug-command file example in which the above process is described.
Example: "dmt33004\sample\led.cmd"
eb 4812d; Set up TBRP (TTBR write protection register)
59; Remove TTBR write protection
q
ew 48134; Set up TTBR (trap table base register)
600000; Set up the base address to 0x600000 (external RAM)
q
lf led.srf; Load the target program (0x600000~)
rsth; Reset the CPU (reset vector at 0x600000 is set to the PC)
bh ESC; Set up a hardware PC break at the label ESC (for forced break)
12
EPSONS1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
3 TARGET PROGRAM AND DEBUGGING
3. Debugging in the Flash memory
In the target system in which a Flash memory has mounted, the target program can be debugged by writing it
into the Flash memory using the debugger.
Notes: • When debugging the target program in the Flash memory, the software break function (bs
command) cannot be used.
• The debugger db33 ver. 1.72 or later version supports data writing to the Flash memory on the
target board. To debug using the Flash memory, create Flash erase and Flash write routines in
the user program and write the program following the instructions below:
After starting the debugger, follow the process below before starting to debug:
1. Load and initialize the Flash erase/write routines.
2. Erase the Flash memory.
3. Set up the trap table base address.
4. Load the target program.
5. Reset the CPU.
6. Set up a hardware PC break point for the forced break function.
The following shows a debug-command file example in which the above process is described.
Example: "dmt33004\sample\led2.cmd"
lf ..\sample\flsh\am29f800.srf; Load the Flash erase/write routines to the built-in RAM
fls; Flash set up command
1; 1: Set up 2: Clear
200000; Flash memory start address = 0x200000 (∗2)
2fffff; Flash memory end address = 0x2fffff (∗2)
FLASH_ERASE; Flash erase routine start address (∗1)
FLASH_LOAD; Flash load routine start address (∗1)
fle; Flash memory erase command
0x200000; Flash control register = 0x200000
0; Erase start block, 0 = All area, 1–19 = Start section
0; Erase end block, 1–19 = End section, 0 = Ignored
eb 4812d; Set up TBRP (TTBR write protection register)
59; Remove TTBR write protection
q
ew 48134; Set up TTBR (trap table base register)
200000; Set up base address to 0x200000 (Flash memory start address)
q
lf led2.srf; Load the target program (0x200000~)
rsth; Reset the CPU (reset vector at 0x200000 is set to PC)
bh ESC; Set up a hardware PC break at the label ESC (for forced break)
*1: "am29f800.srf" is created so as to operate by loading into the built-in RAM (2KB).
When using this source for the S1C33104 after modifying, use the patch tool "cc33\utility\filter".
* 2 : Th i s s a mp l e ( " d mt 3 3 0 0 4 \ s a mp l e \ l e d 2 .s r f " ) a s s u me s t h a t a Fl a s h me mo r y o f 1 MB i s l o c a t e d a t
0 x 2 0 0 0 0 0 – 0 x 2 f f f f f .
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
13
3 TARGET PROGRAM AND DEBUGGING
3.5 Precautions for Debugging
3.5.1 Restriction on Debugging Command
When the debug monitor is used for debugging, the following debugging functions/commands are not available or
allowed to be used.
When the following commands/functions are used, an error message will be displayed.
Error: Command is not supported at present mode.
• Trace function (tm, td, ts and tf commands)
• Sequential break function (bsq command)
• ICE Flash memory function (lfl, sfl and efl commands)
• Option related function (lo and od commands)
• ICE emulation memory
The following commands/ functions are not available even though no error message will be displayed.
• File loading via a parallel port (lf and lh commands)
• Map break function
• On-the-fly function
• Execution time measurement function
• Key break function
In addition to the functions above, the following functions cannot be used when the program in the ROM or Flash
memory is debugged.
• Software PC break functions (bp, bs and bc commands)
• Commands that use the software PC break function internally (stdin and stdout commands)
• Memory edit functions (eb, eh and ew commands)
• Memory fill functions (fb, fh and fw commands)
• Memory move functions (mv, mvh and mvw commands)
3.5.2 Other Precautions
• Th e d eb ug mo ni to r u se s a dd r e ss e s 0 x0 t o 0 x2 F i n t he b ui lt -i n RA M a nd a pp r ox ima t e ly 2 .5K B ( de s c r ib e d l at e r )
p ar t o f t he e xt e r na l RA M. Do n ot r e wr i te t hi s a r e a wi th a me mor y o pe r a ti on c omma n d. Wh e n t hi s a r e a i s
modified, the debug monitor cannot be executed normally.
• The cold reset sequence is the same as the hot reset sequence.
1) The vector value indicated by TTBR is set to the PC.
2) Initial setting: general purpose/special registers = 0xAAAAAAAA, PSR = 0x0, SP = 0xAAAAAA8
In the debug monitor, cold reset is simulated as hot reset.
• The S5U1C33104H and S5U1C33000H halt all the peripheral functions after a break occurs except for the DRAM
r e f r e sh o pe r a ti on . I n t he d eb ug mo ni to r, t he p er i ph e r a l f un c ti on s h al t i ns ta nt a ne o us ly wh e n a b re a k o c c u r s o r
s uc c e ss iv e /s te p e xe c u ti on s ta r ts , h owe v e r t he y r e st a r t i mmed ia t e ly . I nt e r r up ts wh il e t he t ar g e t p ro gr a m i s
suspended are disabled according to the IE-bit status of the PSR.
14
EPSONS1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
APPENDIX S5U1C330MXD1 BOARD
Appendix S5U1C330MxD1 Board
This chapter describes how to use the S5U1C330MxD1 board.
A.1 Outline of S5U1C330MxD1 Board
The S5U1C330MxD1 board provides the interface for the debug
monitor to the demonstration tools such as the S5U1C33104Dx or the
user target board. The S5U1C330MxD1 allows on-board debugging
using the debugger (db33.exe) on a personal computer by connecting
it to the target board in which the S1C33 Family debug monitor
(S5U1C330M2S) has been implemented.
Two types of boards are available: S5U1C330M1D1 board for 5 V
operation and S5U1C330M2D1 for 3.3 V operation.
A.2 Names and Functions of Each Part
The following describes the parts layout on the S5U1C330MxD1 board as well as the functions of the connectors and
switches:
SW1
(RESET)
SW2
(NMI)
Figure A.2.1 S5U1C330MxD1 board layout
SW3 (DEBUG switch)
Sets up the status of the DEBUG pin at the S5U1C33xxxDx/target board I/F connector. When the
S5U1C33104Dx/S5U1C33209Dx board is connected, the switch signal is input to the K63 port and can be used
to start up the debug monitor from the boot routine.
ON: DEBUG (K63) = "0"OFF: DEBUG (K63) = "1"
When the switch is ON, the S5U1C33104Dx/S5U1C33209Dx will start the debug monitor. When the switch is
OFF, the S5U1C33104Dx/S5U1C33209Dx will start executing the program stored in the Flash memory. The
S5U1C33104Dx/S5U1C33209Dx works assuming the debug switch is OFF when the S5U1C330MxD1 is not
connected.
RS232 connector
ONOFF
112
S5U1C33xxxDx/target board I/F connector
ONOFF
SW3
(DEBUG)
SW1 (RESET switch)
Sets up the status of the RESET pin at the S5U1C33xxxDx/
target board I/F connector. When a S5U1C33xxxDx board is
connected, this switch can reset the CPU on the board.
ON: RESET = "0"OFF: RESET = "1"
SW2 (NMI switch)
Sets up the status of the NMI pin at the S5U1C33xxxDx/target
board I/F connector. When a S5U1C33xxxDx board is
connected, a NMI request can be input to the CPU on the
board.
ON: NMI = "0"OFF: NMI = "1"
Figure A.1.1 S5U1C330MxD1 board
RS232C connector
This is a Dsub 9-pin connector for connecting a personal computer. Use the RS232C cable supplied with the
S5U1C330MxD1 package for connection.
S5U1C33xxxDx/target board I/F connector
This connector is used for connecting the S5U1C33xxxDx board. The pin layout is as follows:
No.Signal nameNo.Signal name( ) indicates the CPU pin corresponding to the signal
1VCC [+5 V, +3.3 V]7N.C.when the S5U1C33104Dx/S5U1C33209Dx is
2VCC [+5 V, +3.3 V]8DEBUG (K63)connected.
3RESET (#RESET)9VCC [+5 V, +3.3 V]Since the corresponding signals on the
4TxD (P05)10SCLK (P06)S5U1C33xxxDx may differ depending on the
5RxD (P04)11GNDboard, refer to the pin layout table provided in
6NMI (#NMI)12GNDthe specifications of each S5U1C33xxxDx board.
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
15
APPENDIX S5U1C330MXD1 BOARD
A.3 Connecting the System
Note:When connecting and disconnecting the system, make sure to turn off the power of the
S5U1C33xxxDx/ target board and the personal computer.
Connecting to the S5U1C33xxxDx board/user target board
S5U1C33xxxDx/target board I/F connector
S5U1C33xxxDx
S5U1C330MxD1 I/F connector
Figure A.3.1 Connecting to the S5U1C33xxxDx board
S5U1C33xxxDx/target board I/F connector
User target board
V
CC
SINx
SOUTx
SCLKx
#RESET
#NMI
(K63)
V
SS
S1C33xxx
The S5U1C33xxxDx board has a connector used
for connecting with the S5U1C330MxD1.
Connect the S5U1C330MxD1 to the
S5U1C33xxxDx board with the
S5U1C33xxxDx/target board I/F connector.
When connecting to the user target board, attach
the S5U1C330MxD1 I/F connector (supplied
with the S5U1C330MxD1 package) to the target
board. See Table A.2.1 for the pin layout of the
S5U1C33xxxDx/target board I/F connector.
S5U1C330MxD1 I/F connector
(supplied with the S5U1C330MxD1 package)
Figure A.3.2 Connecting to the user target board
Connecting to a personal computer
Connect the S5U1C330MxD1 board to the COMx port connector (the port used for debugging) of the personal
computer with the RS232C cable supplied with the S5U1C330MxD1 package.
S5U1C33xxxDx/
target board
RS232C connector (female)
(supplied with the S5U1C330MxD1 package)
Figure A.3.3 Connecting to a personal computer
RS232C cable
(male)(female)
COMx
EPSON
16
EPSONS1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
A.4 S5U1C330MxD1 Block Diagram
APPENDIX S5U1C330MXD1 BOARD
RS232C connector
(Dsub 9 pins)
RXD
TXD
RTS
CTS
DTR
DSR
SG
3
2
7
8
4
6
5
V
CC
UPD4724
V
CC
1.843MHz
crystal
oscillator
S5U1C33xxxD1/target board I/F connector (12 pins)
1, 2, 9
5
4
10
V
CC
SW1
(RESET)
SW2
(NMI)
SW3
(DEBUG)
3
6
8
11, 12
Figure A.4.1 S5U1C330MxD1 block diagram
V
CC
RxD (SINx)
TxD (SOUTx)
SCLK (SCLKx)
RESET (SW1: ON = L, OFF = H)
NMI (SW2: ON = L, OFF = H)
DEBUG (SW3: ON = L, OFF = H)
GND
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
17
APPENDIX S5U1C330MXD1 BOARD
A.5 Program Debugging with a S5U1C33xxxDx Board
and S5U1C330M2S
This section describes the debugging procedure of the program on the target system configured with the
S5U1C330MxD1 board and the S5U1C33104Dx/S5U1C33209Dx board using the S5U1C330M2S. The sample
program for the S5U1C33104Dx/S5U1C33209Dx is used for the explanation. Further, the development tools in the
"S1C33 Family C Compiler Package" including the debugger (db33 ver. 1.72 or later) that supports S5U1C330M2S
should be installed for debugging.
The debugging function of the debug monitor can be tested using the sample file even when using a user target board
as well as the S5U1C33xxxDx board. Use the sample file after modifying the necessary parts such as the mapping
condition and the communication routines (refer to Section 2.4) according to the target system.
S5U1C33104Dx/S5U1C33209Dx address map
Figure A.5.1 shows the S5U1C33104Dx/S5U1C33209Dx memory map and the area used by the debug
monitor.
"\dmt33004\sample\led.srf" and "dmt33004\sample\led2.srf" are sample programs for the S5U1C33104Dx
that blinks the LED on the S5U1C33104Dx board. "led.srf" and "led2.srf" are created to be able to debug in
the RAM (0x600000~) and in the Flash memory (0x200000~), respectively.
For the contents of the program, refer to the source file (\dmt33004\sample\led.s).
Sample programs for the S5U1C33209Dx are also provided in the "\dmt33005\sample\" directory.
0x6FFFFF
0x6FF640
0x6FF63F
0x600000
0x000010
0x00000CR0 stack area
0x000008PC stack area
S5U1C330M2S work area
Free area
Control registers of built-in I/O
Free area
∗: 0x17FF(S5U1C33104Dx), 0x1FFF(S5U1C33209Dx)
Reserved area for S5U1C330M2S
Boot routine and implementing the debug monitor
A boot routine and the debug monitor are written in the external ROM (0xC00000~) on the
S5U1C33104Dx/S5U1C33209Dx in advance. Therefore, a sample program/target program can be debugged
by loading from the debugger db33 to the RAM or the Flash memory on the S5U1C33104Dx/S5U1C33209Dx.
It is not necessary to link the S5U1C330M2S library to the program to be debugged.
The S5U1C330M2S library implemented in the S5U1C33104Dx is "mon33ch1.lib" that uses the built-in
serial interface Ch.1. The S5U1C33209Dx uses "mon33ch0.lib" that supports the built-in serial interface Ch.0.
Refer to "\dmt33004\m3s_boot.s" and "\dmt33005\m3s_boot.s" for the boot routine, "\dmt33004\
dmt33004.cm" and "dmt33005\dmt33005.cm" for the linker commands to implement the debug monitor.
18
EPSONS1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
APPENDIX S5U1C330MXD1 BOARD
Building the sample program
It is not necessary to execute Make when modification of the source is not needed since the executable object
files ("led.srf," "led2.srf") are provided in the "sample\" folder.
When the source is modified, execute Make using the make file provided.
Make execution procedure
1) Set "\dmt33004\sample\" (or "\dmt33005\sample\") as the current directory.
2) Enter the following command at the DOS prompt.
C:\...\SAMPLE\>make -f led.mak... when creating "led.srf"
C:\...\SAMPLE\>make -f led2.mak... when creating "led2.srf"
Make can also be executed from the work bench wb33 (refer to the "S1C33 Family C Compiler Package
Manual").
Starting up the debug monitor
The boot routine mapped from address 0xC00000 on the S5U1C33104Dx/S5U1C33209Dx starts the debug
monitor when the K63 input port is set to "0".
Start up the debug monitor following the procedure below after connecting the target system and a personal
computer.
1) Turn SW3[DEBUG] of the S5U1C330MxD1 on.
2) Turn the power of the S5U1C33104Dx/S5U1C33209Dx on.
3) Reset the S5U1C33104Dx/S5U1C33209Dx (S5U1C330MxD1 SW1 [RESET] ON→OFF).
4) Turn the personal computer on and start up Windows.
5) Start up the debugger db33 (start-up method is described later).
Note:When the power of the S5U1C33104Dx/S5U1C33209Dx is turned on while the SW3 [DEBUG] of
the S5U1C330MxD1 is off, the debug monitor does not start up.
The S5U1C33104Dx/S5U1C33209Dx sets TTBR at the beginning of the Flash memory
(0x200000~), so the program sequence branches to the boot address. In this case, turn the SW3
[DEBUG] on and reset the S5U1C33104Dx/S5U1C33209Dx with the SW1 [RESET] to start up the
debug monitor.
Debugging in the RAM
The sample program for debugging in the RAM (0x600000~) of the S5U1C33104Dx/S5U1C33209Dx is
"led.srf". When starting up the debugger, specify the debug command file "led.cmd" with the -c option.
"led.cmd" sets the trap table address to the start address of the RAM and loads "led.srf" to the RAM.
Operating procedure is as follows:
1) Start up the debug monitor as described above.
2) Set "\dmt33004\sample\" (or "\dmt33005\sample\") as the current directory.
3) Set a path to db33.exe.
4) Start up the debugger with the following command at the DOS prompt.
C:\...\SAMPLE\>db33 -mon -b 115200 -p 33104_m.par -c led.cmd
The debugger starts in debug monitor mode and is ready to debug "led.srf". For example, the LED on the
S5U1C33104Dx/S5U1C33209Dx board will start blinking by executing the g command.
Refer to "2. Debugging in the RAM" in Section 3.4, "Debugging Method", for the contents of the command
file.
Note:The debugger db33 ver. 1.0 does not support the debug monitor. Use ver. 1.72 or a later version.
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
19
APPENDIX S5U1C330MXD1 BOARD
Debugging in the Flash memory
The sample program for debugging in the Flash memory (0x200000~) of the S5U1C33104Dx/S5U1C33209Dx
is "led2.srf".
The debugger db33 ver. 1.72 or later version supports debugging in the Flash memory. Refer to the
"Debugger" section of the "S1C33 Family C Compiler Package Manual" for details of operations.
To write the sample program to the Flash memory, first load the Flash erase/write routine "am29f800.srf". Then
initialize the Flash memory functions using the fls and fle commands and load the sample program into the
Flash memory using the lf command. Refer to the sample debug command file "led2.cmd" for executing
procedure.
When starting up the debugger, specify the debug command file "led2.cmd" with the -c option. "led2.cmd"
contains debug commands for loading the Flash erase/write routine, setting the trap table address and loading
"led2.srf" to the Flash memory.
Operating procedure is as follows:
1) Start up the debug monitor as described above.
2) Set "\dmt33004\sample\" (or "\dmt33005\sample\") as the current directory.
3) Set a path to db33.exe.
4) Start up the debugger with the following command at the DOS prompt.
C:\...\SAMPLE\>db33 -mon -b 115200 -p 33104_m.par -c led2.cmd
The debugger starts in debug monitor mode and is ready to debug "led2.srf". For example, the LED on the
S5U1C33104Dx/S5U1C33209Dx board will start blinking by executing the g command.
Refer to "3. Debugging in the Flash memory" in Section 3.4, "Debugging Method", for the contents of the
command file.
When debugging in the Flash memory, be aware that the software PC break function (bs command), memory
edit/fill/move commands and commands not supported by the debug monitor cannot be used.
Forced break
The debug monitor does not support forced break functions such as key break.
In the sample program, the label ESC is described in the NMI processing routine of the source ("led.s"). When
the debug command file ("led.cmd", "led2.cmd") is executed, a hardware PC break point is set at the ESC
location after the program has been loaded.
When the SW2 of the S5U1C330MxD1 is turned on, a NMI is generated and it suspends the program
execution forcibly.
Notes on debugging the user program on the S5U1C33104Dx/S5U1C33209Dx board
• Wh e n d eb ug gi ng t he u se r p ro gr a m o n t he S5 U1 C33 10 4D x/ S5U 1C3 32 09 Dx b oa r d, c r e a te t he p ro gr a m s o
t ha t i t c a n b e l oa de d a nd e xe c u te d i n t he f r e e a r e a o f t he RA M o r t he Fl as h me mor y i n t he s ame wa y a s t he
sample file. (See Figure A.5.1)
• Th e d eb ug mo ni to r o n t he S5 U1 C33 10 4D x h as b ee n i mpl eme n te d b y l in ki ng wi th t he " mon 33 c h1 .li b" .
Therefore, the built-in serial interface Ch.1 cannot be used from the user program.
• Th e d eb ug mo ni to r o n t he S5 U1 C33 20 9D x h as b ee n i mpl eme n te d b y l in ki ng wi th t he " mon 33 c h0 .li b" .
Therefore, the built-in serial interface Ch.0 cannot be used from the user program.
20
EPSONS1C33 FAMILY DEBUG MONITOR
OPERATION MANUAL
APPENDIX S5U1C330MXD1 BOARD
A.6 Indispensable Signal Pins of S5U1C330MxD1
When using the S5U1C330M2S it is not absolutely necessary to connect the NMI, RESET and DEBUG
switches/signals on the S5U1C330MxD1 board. If these switches are not used, the target board can be connected to
the S5U1C330MxD1 using only the five signals as shown below.
Example: Connecting the target board to S5U1C330MxD1 with five wires
User target board
12
10
5
4
1
The wire length must be within 10 cm.
GND
SCLK
SIN
SOUT
V
CC
Figure A.6.1 Connection example using indispensable pins
The NMI, RESET and/ or DEBUG signals should be connected if necessary.
S1C33 FAMILY DEBUG MONITOREPSON
OPERATION MANUAL
21
International Sales Operations
AMERICA
EPSON ELECTRONICS AMERICA, INC.
- HEADQUARTERS -
1960 E. Grand Avenue
EI Segundo, CA 90245, U.S.A.
Phone: +1-310-955-5300Fax: +1-310-955-5400
- SALES OFFICES West
150 River Oaks Parkway
San Jose, CA 95134, U.S.A.
Phone: +1-408-922-0200Fax: +1-408-922-0238
Central
101 Virginia Street, Suite 290
Crystal Lake, IL 60014, U.S.A.
Phone: +1-815-455-7630Fax: +1-815-455-7633
Northeast
301 Edgewater Place, Suite 120
Wakefield, MA 01880, U.S.A.
Phone: +1-781-246-3600Fax: +1-781-246-5443
Southeast
3010 Royal Blvd. South, Suite 170
Alpharetta, GA 30005, U.S.A.
Phone: +1-877-EEA-0020 Fax: +1-770-777-2637