MF1200-02 CMOS 32-BIT SINGLE CHIP MICROCOMPUTER S1C33 Family Debug Monitor Operation Manual
NOTICE 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.
The information of the product number change 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.
TABLE OF CONTENTS Preface 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. Table of Contents 1 S5U1C330M2S Package ................................................................................................1 1.1 Features .........................................................................................................................
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 ses app rox . 1 0KB RO M, app rox . 2 .
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) Warranty 2 (1 English/1 Japanese) 1.3 Installation S5U1C330M2S needs to be linked with the user program as it is implemented.
1 S5U1C330M2S PACKAGE mon33ch0.mak mon33ch1.mak mon33.mak mon33ice.mak src\ Make file for building mon33ch0.lib Make file for building mon33ch1.lib Make file for building mon33.lib Make file for building mon33ice.lib ..... MON33 source files m33_def.h S5U1C330M2S definition file m3c_brk.c C source file for break functions m3c_exe.c C source file for program execution m3c_flsh.c C source file for Flash memory operation m3c_main.c S5U1C330M2S main C source file m3c_mem.
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.
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.
2 IMPLEMENTING THE DEBUG MONITOR 2.3 Building an Application Program 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".
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.
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.
2 IMPLEMENTING THE DEBUG MONITOR (4) void m_dummy_rd( ) This is a dummy read routine. It reads data from the receive buffer and clears the buffer. Return value is not necessary. Example: m_dummy_rd( ) of "m3s_sci.s" ;****************************************************************************** ; ; void m_dummy_rd() ; dummy read function ; ;****************************************************************************** .global m_dummy_rd m_dummy_rd: xld.
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.
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.
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.
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.
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.
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.
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 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.
APPENDIX S5U1C330MXD1 BOARD A.4 S5U1C330MxD1 Block Diagram RS232C connector (Dsub 9 pins) RXD TXD RTS CTS DTR DSR SG S5U1C33xxxD1/target board I/F connector (12 pins) 1, 2, 9 VCC 5 3 2 7 8 4 6 UPD4724 VCC 1.843MHz crystal oscillator 4 10 VCC 3 6 8 11, 12 5 VCC 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 SW1 SW2 SW3 (RESET) (NMI) (DEBUG) Figure A.4.
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.
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 ...
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".
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 GND SCLK 5 4 SIN SOUT 1 VCC The wire length must be within 10 cm.
International Sales Operations AMERICA ASIA EPSON ELECTRONICS AMERICA, INC. EPSON (CHINA) CO., LTD. - HEADQUARTERS - 28F, Beijing Silver Tower 2# North RD DongSanHuan ChaoYang District, Beijing, CHINA Phone: 64106655 Fax: 64107319 1960 E. Grand Avenue EI Segundo, CA 90245, U.S.A. Phone: +1-310-955-5300 Fax: +1-310-955-5400 SHANGHAI BRANCH 4F, Bldg., 27, No.
In pursuit of “Saving” Technology, Epson electronic devices. Our lineup of semiconductors, liquid crystal displays and quartz devices assists in creating the products of our customers’ dreams. Epson IS energy savings.
S1C33 Family Debug Monitor Operation Manual ELECTRONIC DEVICES MARKETING DIVISION EPSON Electronic Devices Website http://www.epson.co.