Fujitsu F2MC-16L User Manual
Hide thumbs Also See for F2MC-16L:

Advertisement

Quick Links

FUJITSU SEMICONDUCTOR
CM42-00325-3E
CONTROLLER MANUAL
F
MC-16L/16LX/16/16H/16F
2
µITRON 2.01 SPECIFICATIONS COMPLIANT
S
REALOS/907
OFTUNE
USER'S GUIDE
*

Advertisement

Table of Contents
loading

Summary of Contents for Fujitsu F2MC-16L

  • Page 1 FUJITSU SEMICONDUCTOR CM42-00325-3E CONTROLLER MANUAL MC-16L/16LX/16/16H/16F µITRON 2.01 SPECIFICATIONS COMPLIANT REALOS/907 OFTUNE USER’S GUIDE...
  • Page 3 MC-16L/16LX/16/16H/16F µITRON 2.01 SPECIFICATIONS COMPLIANT REALOS/907 OFTUNE USER’S GUIDE FUJITSU LIMITED...
  • Page 5 µITRON is an abbreviation of "Micro Industrial TRON". SOFTUNE is a trademark of FUJITSU LIMITED. REALOS (REALtime Operating System) is a trademark of FUJITSU LIMITED. Microsoft, Windows, and Windows NT are registered trademarks of Microsoft Corporation in the U.S. and other countries.
  • Page 6 I Organization of this manual This manual consists of the following 4 chapters and an Appendix. Chapter 1 Notes on Operation Explains a number of important points on using REALOS/907. Chapter 2 Developing Application Systems Describes how to develop application systems using REALOS/907. Chapter 3 Overview of the Standard I/O Library Introduces the standard I/O library.
  • Page 7 (2) for use requiring extremely high reliability (i.e., submersible repeater and artificial satellite). Please note that Fujitsu will not be liable against you and/or any third party for any claims or damages arising in connection with above-mentioned uses of the products.
  • Page 8 Softune REALOS/907 MANUAL SET The REALOS/907 manual set consists of four volumes listed below. A first-time user of REALOS/907 should first read the F MC-16L/16LX/16/16H/16F User's Guide. This manual contains the following items: application MC-16L/16LX/16/16H/16F system creation procedure and precautionary information Softune REALOS/907 on system use.
  • Page 9 READING THIS MANUAL I Product names In this manual and this product, product names are designated as follows: SOFTUNE is designated as Softune. ® ® The Microsoft Windows 98 operating system is abbreviated to Windows 98. ® ® The Microsoft Windows Millennium Edition operating system is abbreviated to Windows Me.
  • Page 11: Table Of Contents

    CONTENTS CHAPTER 1 Notes on Operation ..................1 Notes on Programming..........................2 Notes on Hardware..........................4 CHAPTER 2 Developing Application Systems ..............5 REALOS/907 Products ..........................6 Directory Configuration ..........................8 Preparing a Development Environment....................9 Installing REALOS/907 ..........................10 Programs Required for an Application System..................11 Development Steps ..........................12 Developing User Programs........................14 Developing a User-Defined Module.......................15 Configuring and Running a System .......................17...
  • Page 12 viii...
  • Page 13: Chapter 1 Notes On Operation

    CHAPTER 1 Notes on Operation This chapter explains a number of important points on using Softune REALOS/907. 1.1 Notes on Programming 1.2 Notes on Hardware...
  • Page 14: Notes On Programming

    CHAPTER 1 Notes on Operation Notes on Programming Describes important points on programming for Softune REALOS/907. I Notes on programming Note: • Do not call ext_tsk from task independent portions. Calling ext_tsk from a task independent portion generates an error and enters an infinite loop on returning to the task independent portion.
  • Page 15 1.1 Notes on Programming Note:. • Rigorous error checking is not performed on addresses returned to a memorypool. Therefore, you must store the address of memory reserved from the pool until the memory is released. System operation may be corrupted if the address specified when releasing memory is different to the reserved address.
  • Page 16: Notes On Hardware

    CHAPTER 1 Notes on Operation Notes on Hardware Describes important points relating to the hardware. I Notes on hardware Note: • Softune REALOS/907 requires a 16-bit microcontroller (F MC-16L/16LX/16/16H/16F series) with an internal delayed interrupt module and bit search module. •...
  • Page 17: Chapter 2 Developing Application Systems

    CHAPTER 2 Developing Application Systems This chapter describes how to develop application systems using Softune REALOS/ 907. 2.1 Softune REALOS/907 Products 2.2 Directory Configuration 2.3 Preparing a Development Environment 2.4 Installing Softune REALOS/907 2.5 Programs Required for an Application System 2.6 Development Steps 2.7 Developing User Programs 2.8 Developing a User-Defined Module...
  • Page 18: Realos/907 Products

    CHAPTER 2 Developing Application Systems REALOS/907 Products The REALOS/907 products consist of the REALOS/907 realtime OS programs (included in provided media) and the manual set. I REALOS/907 products Figure 2.1 shows the REALOS/907 products. REALOS/907 Kernel Manual Configurator Manual Available on CD-ROM User's Guide Analyzer Manual Figure 2.1 REALOS/907 Products...
  • Page 19 2.1 REALOS/907 Products I Manuals Table 2.1 lists the REALOS/907 manuals. Table 2.1 REALOS/907 Manuals Manual Contents Describes information required for developing user programs. Kernel Manual Refer to this manual when developing tasks and handlers. Describes the function and operation of the Softune REALOS/907 Configurator Manual configurator.
  • Page 20: Directory Configuration

    CHAPTER 2 Developing Application Systems Directory Configuration Figure 2.2 lists the programs that appear in the directory after installation. I Files Figure 2.2 shows the structure of the realos directory after installing REALOS/907. Directory realos907.txt Updated information file regarding supplied files for installation Configurator &...
  • Page 21: Preparing A Development Environment

    Table 2.3 Support Tools Required for Development Tool Tool name C compiler (fcc907s) Assembler (fasm907s) Cross-development Linkage kit: Linker (flnk907s) tools Librarian (flib907s) (Fujitsu) Object tool (f2ms, f2is, f2es, m2bs, m2es, m2is, m2ms) Softune Workbench (fs907s) MB2141 Series Emulator Emulator (Fujitsu) MB2147 Series Emulator...
  • Page 22: Installing Realos/907

    CHAPTER 2 Developing Application Systems Installing REALOS/907 You must install REALOS/907 on the host computer before you can start developing REALOS/907 application programs. The following describes the procedure for installing REALOS/907. I Installation Run SETUP.EXE from root directory of the installation disks on Windows. Follow the instructions displayed by the installation program and specify the directory for installing REALOS/907.
  • Page 23: Programs Required For An Application System

    2.5 Programs Required for an Application System Programs Required for an Application System A REALOS/907 application system consists of a program for starting tasks and initializing the system clock, programs for handling normal processing, programs for handling abnormal conditions, and programs for extending system processing. I Application program structure Figure 2.5 shows the structure of application programs.
  • Page 24: Development Steps

    CHAPTER 2 Developing Application Systems Development Steps Table 2.6 lists the steps required to develop an application system for REALOS/907. Figure 2.6 shows the development procedure for REALOS/907. I Development steps Table 2.6 lists the application development steps and the required software. Table 2.6 REALOS/907 Development Steps and Required Software Development Steps Description...
  • Page 25 2.6 Development Steps I Development procedure Figure 2.6 shows the procedure for REALOS/907 development. System design Determine the structure of the target system, etc. Prepare development Prepare the development environment. environment Program development Design the system. Program debugging Develop the programs on the host computer. Check operation Configure system Perform system debugging on the target hardware.
  • Page 26: Developing User Programs

    CHAPTER 2 Developing Application Systems Developing User Programs The following three items are determined in system design. • The processing to be executed • The target hardware • Whether or not to use REALOS/907 Actual development of the REALOS/907 application system starts after the above items have been decided.
  • Page 27: Developing A User-Defined Module

    2.8 Developing a User-Defined Module Developing a User-Defined Module The kernel module is a user-defined module. You can refer to the sample source files provided and produce a module that fits your specific requirements. User-defined modules consist of the following. •...
  • Page 28 CHAPTER 2 Developing Application Systems I Initialize handler The initialize handler is called by the kernel. The handler initializes the devices used by the kernel (such as the timer device used for the system clock) and the devices used in the user program (such as I/O devices).
  • Page 29: Configuring And Running A System

    2.9 Configuring and Running a System Configuring and Running a System Generate the system by linking the user program and kernel module using the configurator. Download the resulting absolute format object to the target system, then run the system. The user tasks start after kernel initialization. I Configuring the system Configure the system using the configurator.
  • Page 30 CHAPTER 2 Developing Application Systems I Processing steps from starting the system until the user tasks start Figure 2.9 shows the processing steps when REALOS/907 starts. Reset Start Reset entry routine User tasks Kernel initialization processing Perform the required task Kernel data initialization routine and handler initialization Initialize handler...
  • Page 31: Chapter 3 Overview Of The Standard I/O Library

    CHAPTER 3 Overview of the Standard I/O Library The REALOS/907 system provides a standard I/O library to support development for the user's target system. The standard I/O library uses standard I/O devices such as consoles and provides an interface for data communication and character data I/O (for debug information, for example).
  • Page 32: Structure Of The Standard I/O Library

    CHAPTER 3 Overview of the Standard I/O Library Structure of the Standard I/O Library The standard I/O library consists of the standard text I/O functions putchar, getchar and printf. I Structure of the standard I/O library The standard I/O library consists of the following functions. ❍...
  • Page 33 3.1 Structure of the Standard I/O Library I Segments used by the standard I/O library Table 3.1b lists the output segments for the standard I/O library. Table 3.1b Standard I/O Library Segments Area Segment Segment Attribute Remarks Variable data area DCONST DSEG Initial value data...
  • Page 34: Incorporating The Standard I/O Driver

    CHAPTER 3 Overview of the Standard I/O Library Incorporating the Standard I/O Driver When using the standard I/O library, you must develop your own code (I/O driver) for the target system. The driver inputs and outputs individual characters using the actual hardware.
  • Page 35: Example Of Creating A Standard I/O Driver

    3.3 Example of Creating a Standard I/O Driver Example of Creating a Standard I/O Driver Figure 3.3 shows an example of how to incorporate a standard I/O driver. I Example of creating a standard I/O driver .program mb89371 .title mb89371 #include scdef_s.inc .section IO_mb89371, IO, LOCATE=H’C0...
  • Page 36 CHAPTER 3 Overview of the Standard I/O Library i:RS_CTRL, #0 call delay i:RS_CTRL, #RCLR call delay i:RS_CTRL1, #RMODE1; mode (MB89731 original) call delay i:RS_BOUD, #RBOUD; baud rate call delay i:RS_CTRL, #RMODE; mode (8251 compatible) call delay i:RS_CTRL, #RCOMM; commond call delay retp EVEN...
  • Page 37: How To Use The Standard I/O Library

    3.4 How to Use the Standard I/O Library How to Use the Standard I/O Library In general, the programs contained in the standard I/O library are written using the C interface. Accordingly, you must use the function execution interface for the C language when using the library from an assembly language program.
  • Page 38 CHAPTER 3 Overview of the Standard I/O Library I Linkage specification Add the standard I/O library file to the member when linking applications that use the standard library. Refer to the Softune Workbench Operation Manual for the procedure for adding the file to the member.
  • Page 39: Chapter 4 Program Reference For The Standard I/O Library

    CHAPTER 4 Program Reference for the Standard I/O Library This chapter provides a detailed description of three types of standard I/O functions. 4.1 Standard I/O Function Interface Putchar 4.2 Standard I/O Function Interface Getchar 4.3 Standard I/O Function Interface Printf...
  • Page 40: Standard I/O Function Interface Putchar

    CHAPTER 4 Program Reference for the Standard I/O Library Standard I/O Function Interface Putchar Outputs one character to the standard I/O device. I Putchar [Interface] Format int ercd = putchar(int chrcd); Parameter chrcd :Output character code Return parameter ercd :Output character code :Normal completion :Error [Description]...
  • Page 41: Standard I/O Function Interface Getchar

    4.2 Standard I/O Function Interface Getchar Standard I/O Function Interface Getchar Inputs one character from the standard I/O device. I Getchar [Interface] Format int chrcd = getchar(); Parameter None Return parameter chrcd :Input code :Error [Description] Inputs one character from the standard I/O device. The function returns the input character if input completes normally.
  • Page 42: Standard I/O Function Interface Printf

    CHAPTER 4 Program Reference for the Standard I/O Library Standard I/O Function Interface Printf Outputs a character string to the standard output device in accordance with the specified format. I Printf [Interface] Format int chrcnt = printf(B *format [,data1 [,data2 ...]]); Parameters format :Pointer to the output format string...
  • Page 43 4.3 Standard I/O Function Interface Printf Control Type Character Signed decimal Unsigned decimal Octal Hexadecimal (lower case letters) Hexadecimal (upper case letters) Character Character string Use "%%" to specify a "%" character as an output character rather than as a control specifier. The printf function outputs characters using putchar.
  • Page 44 CHAPTER 4 Program Reference for the Standard I/O Library...
  • Page 45: Appendix

    APPENDIX The appendices summarize the REALOS/907 upgrade and describe how to generate and run the sample system. Appendix A Program Description Appendix B Running the Sample System Appendix C Sample System Memory Map...
  • Page 46: Appendix A Program Description

    APPENDIX APPENDIX A Program Description This appendix describes the nine programs provided by REALOS/907. • Information on supplied files • Configurator • Softune REALOS configurator add-in • Kernel basic module • User-created module • Include file for users • Object file for OS •...
  • Page 47 APPENDIX A Program Description I User-created module The following module is supplied as a user-created module: ❍ Reset entry routine Processes that depend on the CPU or the target structure, and the initialization process for C programs are described in 1st.asm (1st2.asm), which is provided as a sample. The following processes are included: ❍...
  • Page 48 APPENDIX I Sample system The following two project files are provided in the sample system: ❍ smp1.prj: Project file of sample system 1 for Workbench ❍ smp2.prj: Project file of sample system 1 for Workbench These are the project files for constructing sample tasks and their system. Refer to Appendix B, "Running the Sample system"...
  • Page 49: Appendix B Running The Sample System

    APPENDIX B Running the Sample System APPENDIX B Running the Sample System REALOS/907 includes a sample program that you can refer to when developing user programs. I Sample system The aim of the sample system is to show the basic structure of application programs running on REALOS/907.
  • Page 50 APPENDIX smpsys smp1 Storage directory for [Install directory] rtos Sample system1 smp2 Storage directory for Sample system2 smpdrv smp1.wsp Sample1 work space file syslib smp2.wsp Sample2 work space file I Operations of Sample Programs Figure Bb shows the sample program listings. The behaviors of samples 1 and 2 are slightly different.
  • Page 51 APPENDIX B Running the Sample System During sample program operation, the tasks are executed alternately depending on the ID1 eventflag as shown in Figure Bc. a_tsk cwai cwai cwai b_tsk 1→0 1→0 Eventflag 1→0 : READY state cwai : Issues cwai_flg. : RUN state set : Issues set_flg.
  • Page 52 APPENDIX I Sample activation The sample system activation with Softune Workbench is described below. ❍ Open project file Select [Open project...] from [File] menu. The [Open Project] dialog box opens. The [Open Project] dialog box is shown in Figure Bd. When the directory containing the sample system is accessed, two project files are displayed.
  • Page 53 APPENDIX B Running the Sample System Figure Be Project Member List...
  • Page 54 APPENDIX Figure Bf [Set Configuration File] Dialog Box...
  • Page 55 APPENDIX B Running the Sample System ❍ Creating a load module file Create a load module file (absolute file). Select [Build] from the [Project] menu to execute the build. When the build is complete, the completion message shown in Figure Bg is displayed in the output window.
  • Page 56 APPENDIX ❍ Checking the memory map To check the memory map, select smp1.abs, then right-click to select, from the context menu, [Open List File] -- [smp1.mp1]. Figure Bh shows the [Open List File] dialog. Figure Bh [Open List File] ❍ Debugger activation Activate the debugger and load the load module.
  • Page 57 APPENDIX B Running the Sample System Figure Bi Setting a Breakpoint When [Run] -- [Go] is selected from the [Debug] menu, a break occurs at a_tsk. Note:When execution is with the simulator, the operation continues, since the I/O status in A1h does not change. Change the I/O status from the debugger to advance the program.
  • Page 58 APPENDIX Figure Bj Break at a_tsk I Executing the sample system Execution breakpoints are expressed as bp1 and bp2, as illustrated in Figure Bk. (1) Run the sample system to the point immediately before cwai_flg of a_tsk (hereafter expressed as the point immediately before bp1). Run the sample system by clicking on the bp1 point shown in Figure Bk).
  • Page 59 APPENDIX B Running the Sample System Higher priority Task a_tsk(void) Flag waiting While(1) { cwai_flg(FLG_1) ; printf(“%s,a_msg) ; Event flag ID = 1 Initial pattern Lower priority value 0 Task b_tsk(void) Flag set While(1) { printf(“%s”,b_msg) ; set_flg(FLG_1) ; Figure Bk Execution Breakpoints (2) Run the sample system to the point immediately before set_flg of b_tsk (hereafter expressed as the point immediately before bp2).
  • Page 60 APPENDIX However, HyperTerminal displays strings as shown in Figure Bm. From this output, the tasks do not seem to be working as in Figure Bl. hello,i am b_task. HE LhLe01,1 oI, AiM aAm_TbA_Stka.s k. HE LhLe01,1 oI, AiM aAm_TbA_StKa.s k.HE LhLe01, 1 oI, AiM a Am_TbA_TbA_StKa.s k.
  • Page 61 APPENDIX B Running the Sample System b_tsk Priority 5 Execution state WAIT set_flg b_tsk a_tsk a_tsk Event flag wait state Priority 5 Priority 4 Priority 4 WAIT WAIT WAIT When only one of the two tasks waiting for the same object is released from the wait state, the FCFS causes the task with a lower priority to enter the execution state.
  • Page 62 APPENDIX HELLO, I AM A_TASK. hello, i am b_task. HELLO, I AM A_TASK. hello, i am b_task. HELLO, I AM A_TASK. hello, i am b_task. H ELLO, I AM A_TASK. hello, i am b_task..Figure Bp HyperTerminal Output Example (1) hello, i am b_task.
  • Page 63: Appendix C Sample System Memory Map

    APPENDIX C Sample System Memory Map APPENDIX C Sample System Memory Map The memory capacity required for the sample system is shown below. This must be used for a reference for the memory capacity required for REALOS/907 system operation. I Sample system memory map Figures Ca and Cb show the sample system memory maps.
  • Page 64 APPENDIX Figure Cb Sample System Memory Map (Continued)
  • Page 65: Index

    INDEX INDEX The index follows on the next page. This is listed in alphabetic order.
  • Page 66 INDEX Index application program..........11 manual ..............7 Application program structure ........ 11 Manuals ..............7 configurator ............17 Notes on Hardware ..........4 Configuring the system .......... 17 Notes on Programming ..........2 Determine the objects to use ......... 14 Preparingg a Development Environment ....
  • Page 67 CM42-00325-3E FUJITSU SEMICONDUCTOR • CONTROLLER MANUAL MC-16L/16LX/16/16H/16F µITRON 2.01 SPECIFICATIONS COMPLIANT REALOS/907 OFTUNE USER’S GUIDE October 2002 the third edition FUJITSU LIMITED Published Electronic Devices Standardization Promoting Dept. Edited...

This manual is also suitable for:

F2mc-16xlF2mc-16F2mc-16hF2mc-16f

Table of Contents