ii
4.2 Development Procedure Example.................................................................................................... - 62 -
4.2.1 Applications Program Coding................................................................................................... - 62 -
4.2.2 Configuration File Preparation ................................................................................................ - 64 -
4.2.3 Configurator Execution............................................................................................................. - 65 -
4.2.4 System generation..................................................................................................................... - 65 -
4.2.5 Writing ROM.............................................................................................................................. - 65 -
Chapter 5 Detailed Applications.............................................................................................................. - 67 -
5.1 Program Coding Procedure in C Language..................................................................................... - 68 -
5.1.1 Task Description Procedure...................................................................................................... - 68 -
5.1.2 Writing a Kernel (OS Dependent) Interrupt Handler ............................................................ - 70 -
5.1.3 Writing Non-kernel (OS-independent ) Interrupt Handler .................................................... - 71 -
5.1.4 Writing Cyclic Handler/Alarm Handler ................................................................................... - 72 -
5.2 Program Coding Procedure in Assembly Language ....................................................................... - 73 -
5.2.1 Writing Task .............................................................................................................................. - 73 -
5.2.2 Writing Kernel(OS-dependent) Interrupt Handler ................................................................. - 75 -
5.2.3 Writing Non-kernel(OS-independent) Interrupt Handler ...................................................... - 76 -
5.2.4 Writing Cyclic Handler/Alarm Handler ................................................................................... - 77 -
5.3 The Use of INT Instruction.............................................................................................................. - 78 -
5.4 The Use of registers of bank ............................................................................................................ - 78 -
5.5 Regarding Interrupts........................................................................................................................ - 79 -
5.5.1 Types of Interrupt Handlers ..................................................................................................... - 79 -
5.5.2 The Use of Non-maskable Interrupt ........................................................................................ - 79 -
5.5.3 Controlling Interrupts............................................................................................................... - 80 -
5.6 Regarding Delay Dispatching .......................................................................................................... - 82 -
5.7 Regarding Initially Activated Task.................................................................................................. - 83 -
5.8 Modifying MR308 Startup Program................................................................................................ - 84 -
5.8.1 C Language Startup Program (crt0mr.a30)............................................................................. - 85 -
5.9 Memory Allocation............................................................................................................................ - 90 -
5.9.1 Section Allocation of start.a30 .................................................................................................. - 91 -
5.9.2 Section Allocation of crt0mr.a30............................................................................................... - 92 -
5.10 Using in M16C/70 Series.................................................................................................................. - 94 -
Chapter 6 Using Configurator .................................................................................................................- 95 -
6.1 Configuration File Creation Procedure ........................................................................................... - 96 -
6.1.1 Configuration File Data Entry Format.................................................................................... - 96 -
Operator ................................................................................................................................................................ - 97 -
Direction of computation ...................................................................................................................................... - 97 -
6.1.2 Configuration File Definition Items......................................................................................... - 99 -
[( System Definition Procedure )]......................................................................................................................... - 99 -
[( System Clock Definition Procedure )]............................................................................................................. - 101 -
[( Definition respective maximum numbers of items )]..................................................................................... - 102 -
[( Task definition )].............................................................................................................................................. - 104 -
[( Eventflag definition )] ..................................................................................................................................... - 106 -
[( Semaphore definition )]................................................................................................................................... - 107 -
[(Data queue definition )] ................................................................................................................................... - 108 -
[( Short data queue definition )]......................................................................................................................... - 109 -
[( Mailbox definition )] .........................................................................................................................................- 110 -
[( Fixed-size memory pool definition )]................................................................................................................- 111 -
[( Variable-size memory pool definition )]...........................................................................................................- 112 -
[( Cyclic handler definition )]...............................................................................................................................- 113 -
[( Alarm handler definition )] ..............................................................................................................................- 115 -
[( Interrupt vector definition )]............................................................................................................................- 116 -
6.1.3 Configuration File Example.................................................................................................... - 119 -
6.2 Configurator Execution Procedures .............................................................................................. - 123 -
6.2.1 Configurator Overview............................................................................................................ - 123 -
6.2.2 Setting Configurator Environment ........................................................................................ - 125 -
6.2.3 Configurator Start Procedure................................................................................................. - 126 -
6.2.4 makefile generate Function .................................................................................................... - 127 -
6.2.5 Precautions on Executing Configurator................................................................................. - 128 -
6.2.6 Configurator Error Indications and Remedies ...................................................................... - 129 -
Error messages ................................................................................................................................................... - 129 -