CONTENTS
CONTENTS 8
FIGURE CONTENTS 15
TABLE CONTENTS 23
1. RL78 Programming_ 25
1.1. Microcontroller Concepts 26
1.1.1. The history of processor 26
1.1.2. Stored-program digital computer 26
1.1.3. Von Neumann architecture 26
1.1.4. Harvard architecture 26
1.1.5. Microprocessor vs. Microcontroller 28
1.1.6. Applications for the microcontroller 28
1.1.7. Classification of processors 29
1.1.8. Introductionof RL78 MCU_ 30
1.1.9. Overview of the microcontroller 38
2. Getting Started with e²studio IDE and KPIT Toolchain_ 52
2.1. To build adevelopment platforms 53
2.1.1. Theinstallation of compiler 53
2.1.2. IDE setting for installation_ 62
2.1.3. Programmer setting_ 69
2.2. IDE setting forexecution_ 74
2.2.1. The first execution_ 74
2.2.2. Create a new project 76
2.2.3. LED Blinking_ 80
2.2.4. Renesas Flash Programmer 82
2.2.5. Using of e²studio debug_ 89
3. RL78 Exercises 92
3.1. LED Shift example(Port output) 93
3.1.1. Preparation list 93
3.1.2. Port connection_ 93
3.1.3. Source code 94
3.1.4. Training order 94
3.1.5. Simple lecture 94
3.1.6. Assignment 121
3.2. Switch (Port input) 122
3.2.1. Preparation list 122
3.2.2. Port connection_ 122
3.2.3. Source code 123
3.2.4. Training order 123
3.2.5. Simple lecture 123
3.2.6. Assignment 124
3.3. External interrupt 125
3.3.1. Preparation list 125
3.3.2. Port connection_ 125
3.3.3. Source code 126
3.3.4. Training order 127
3.3.5. Simple lecture 127
3.3.6. Assignment 133
3.4. Timer 134
3.4.1. Preparation list 134
3.4.2. Port connection_ 134
3.4.3. Source code 134
3.4.4. Training order 135
3.4.5. Simple lecture 135
3.4.6. Assignment 143
3.5. Control of 7-segment display_ 144
3.5.1. Preparation list 144
3.5.2. Port connection_ 144
3.5.3. Source code 145
3.5.4. Training order 147
3.5.5. Simple lecture 148
3.5.6. Assignment 153
3.6. Speaker output 154
3.6.1. Preparation list 154
3.6.2. Port connection_ 154
3.6.3. Source code 154
3.6.4. Training order 157
3.6.5. Simple lecture 157
3.6.6. Assignment 158
3.7. DC motor control(Using AM-CD2L) 159
3.7.1. Preparation list 159
3.7.2. Port andmechanical connection_ 159
3.7.3. Source code 160
3.7.4. Training order 162
3.7.5. Circuit 162
3.7.6. Simple lecture 163
3.7.7. Assignment 164
3.8. DC Motor control(Using AM-DC2-2D) 165
3.8.1. Preparation list 165
3.8.2. Port andmechanical connection_ 166
3.8.3. Source code 166
3.8.4. Training order 168
3.8.5. CircuitDiagram and pinouts 168
3.8.6. Simple lecture 169
3.8.7. Assignment 171
3.9. DC Motor PWM speed control (Timer) 172
3.9.1. Preparation list 172
3.9.2. Port and mechanical connection_ 173
3.9.3. Source code 174
3.9.4. Training order 177
3.9.5. Simple lecture 177
3.9.6. Assignment 179
3.10. Stepping motor control (Phase generation type) 180
3.10.1. Preparation list 180
3.10.2. Port and mechanical connection_ 181
3.10.3. Source code 181
3.10.4. Training order 183
3.10.5. Circuit 183
3.10.6. Simple lecture 184
3.10.7. Firmware programming_ 189
3.10.8. Assignment 190
3.11. Stepping motorcontrol (Micro stepping, Pulse type) 191
3.11.1. Preparation list 191
3.11.2. Port and mechanical connection_ 192
3.11.3. Source code 192
3.11.4. Training order 194
3.11.5. Simple lecture 195
3.11.6. Assignment 196
3.12. Control of RC servomotor 197
3.12.1. Preparation list 197
3.12.2. Port and mechanical connection_ 198
3.12.3. Source code 198
3.12.4. Training order 200
3.12.5. Simple lecture 200
3.12.6. Assignment 202
3.13. Control of Relay power supply module_ 203
3.13.1. Preparation list 203
3.13.2. Port connection_ 204
3.13.3. Source code 205
3.13.4. Training order 205
3.13.5. Simple lecture 206
3.13.6. Assignment 206
3.14. Text LCD control 207
3.14.1. Preparation list 207
3.14.2. Port connection_ 207
3.14.3. Source code 208
3.14.4. Training order 211
3.14.5. Simple lecture 212
3.14.6. Assignment 223
3.15. Graphic LCD control 224
3.15.1. Preparation list 224
3.15.2. Port connection_ 224
3.15.3. Source code 225
3.15.4. Training order 232
3.15.5. Simple lecture 233
3.15.6. Assignment 238
3.16. Data output by UART communication_ 239
3.16.1. Preparation list 239
3.16.2. Port connection_ 240
3.16.3. Source code 240
3.16.4. Training order 242
3.16.5. Simple lecture 243
3.16.6. Assignment 256
3.17. Standard UART communication by UART communication_ 257
3.17.1. Preparation list 257
3.17.2. Portconnection_ 258
3.17.3. Source code 258
3.17.4. Training order 260
3.17.5. Simple lecture 262
3.17.6. Assignment 263
3.18. Using Serial LCD by UART communication_ 264
3.18.1. Preparation list 264
3.18.2. Port connection_ 265
3.18.3. Source code 265
3.18.4. Training order 269
3.18.5. Simple lecture 270
3.18.6. Assignment 271
3.19. Using the Digital infrared sensor (AM-IRS4D) 273
3.19.1. Preparation list 273
3.19.2. Port connection_ 273
3.19.3. Source code 274
3.19.4. Training order 274
3.19.5. Simple lecture 274
3.19.6. Assignment 277
3.20. A variety of sensor utilization using ADC_ 278
3.20.1. Preparation list 278
3.20.2. Port connection_ 279
3.20.3. Source code 279
3.20.4. Training order 282
3.20.5. Circuit 284
3.20.6. Simple lecture 285
3.20.7. Assignment 300
3.21. Using multi-keymatrix module_ 301
3.21.1. Preparation list 301
3.21.2. Port connection_ 302
3.21.3. Source code 302
3.21.4. Training order 305
3.21.5. Simple lecture 305
3.21.6. Assignment 306
3.22. Using LED matrixmodule (10 x 10) 308
3.22.1. Preparation list 308
3.22.2. Port connection_ 308
3.22.3. Source code 308
3.22.4. Training order 311
3.22.5. Circuit 311
3.22.6. Simple lecture 312
3.22.7. Assignment 313
3.23. MCU communication by Bluetooth 2.1_ 315
3.23.1. Preparation list 315
3.23.2. Port connection_ 316
3.23.3. Source code 316
3.23.4. Training order 322
3.23.5. Simple lecture 322
3.23.6. Assignment 323
3.24. Smartphone Bluetooth communication_ 324
3.24.1. Preparation list 324
3.24.2. Port connection_ 324
3.24.3. Source code 325
3.24.4. Training order 327
3.24.5. Simple lecture 328
3.24.6. Assignment 329
3.25. GPS_ 330
3.25.1. Preparation list 330
3.25.2. Port connection_ 330
3.25.3. Source code 331
3.25.4. Training order 335
3.25.5. Simple lecture 335
3.25.6. Assignment 342
4. Appendix 343
4.1. Importing sample project 344
4.1.1. Import each project (Archived file) 344
4.1.2. Import each project (folder) 347