IC R8C/27 MCU FLASH 32LQFP

 

R5F21272SDFP#U0

Manufacturer Part NumberR5F21272SDFP#U0
DescriptionIC R8C/27 MCU FLASH 32LQFP
ManufacturerRenesas Electronics America
SeriesR8C/2x/27
R5F21272SDFP#U0 datasheet
 

Specifications of R5F21272SDFP#U0

Core ProcessorR8CCore Size16/32-Bit
Speed20MHzConnectivityI²C, LIN, SIO, SSU, UART/USART
PeripheralsLED, POR, Voltage Detect, WDTNumber Of I /o25
Program Memory Size8KB (8K x 8)Program Memory TypeFLASH
Ram Size512 x 8Voltage - Supply (vcc/vdd)2.2 V ~ 5.5 V
Data ConvertersA/D 12x10bOscillator TypeInternal
Operating Temperature-40°C ~ 85°CPackage / Case32-LQFP
For Use WithR0K521276S000BE - KIT DEV RSK-R8C/26-29R0E521000EPB00 - PROBE EMULATOR FOR PC7501Lead Free Status / RoHS StatusLead free / RoHS Compliant
Eeprom Size-  
1
Page 1
2
Page 2
3
Page 3
4
Page 4
5
Page 5
6
Page 6
7
Page 7
8
Page 8
9
Page 9
10
Page 10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
Page 1/487

Download datasheet (5Mb)Embed
Next
To our customers,
Old Company Name in Catalogs and Other Documents
st
On April 1
, 2010, NEC Electronics Corporation merged with Renesas Technology
Corporation, and Renesas Electronics Corporation took over all the business of both
companies. Therefore, although the old company name remains in this document, it is a valid
Renesas Electronics document. We appreciate your understanding.
Renesas Electronics website:
Issued by: Renesas Electronics Corporation (http://www.renesas.com)
Send any inquiries to http://www.renesas.com/inquiry.
http://www.renesas.com
st
April 1
, 2010
Renesas Electronics Corporation

R5F21272SDFP#U0 Summary of contents

  • Page 1

    To our customers, Old Company Name in Catalogs and Other Documents st On April 1 , 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took over all the business of both companies. Therefore, although the ...

  • Page 2

    All information included in this document is current as of the date this document is issued. Such information, however, is subject to change without any prior notice. Before purchasing or using any Renesas Electronics products listed herein, please confirm ...

  • Page 3

    R8C/26 Group, 16 R8C/27 Group Hardware Manual RENESAS 16-BIT SINGLE-CHIP MCU R8C FAMILY / R8C/2x SERIES All information contained in these materials, including products and product specifications, represents information on the product at the time of publication and is subject ...

  • Page 4

    This document is provided for reference purposes only so that Renesas customers may select the appropriate Renesas products for their use. Renesas neither makes warranties or representations with respect to the accuracy or completeness of the information contained in ...

  • Page 5

    General Precautions in the Handling of MPU/MCU Products The following usage notes are applicable to all MPU/MCU products from Renesas. For detailed usage notes on the products covered by this manual, refer to the relevant sections of the manual. If ...

  • Page 6

    How to Use This Manual 1. Purpose and Target Readers This manual is designed to provide the user with an understanding of the hardware functions and electrical characteristics of the MCU intended for users designing application systems incorporating ...

  • Page 7

    Notation of Numbers and Symbols The notation conventions for register names, bit names, numbers, and symbols used in this manual are described below. (1) Register Names, Bit Names, and Pin Names Registers, bits, and pins are referred to in ...

  • Page 8

    Register Notation The symbols and terms used in register diagrams are described below. XXX Register Bit Symbol XXX0 XXX1 XXX4 XXX5 XXX6 XXX7 *1 Blank: Set ...

  • Page 9

    List of Abbreviations and Acronyms Abbreviation ACIA bps CRC DMA DMAC GSM Hi-Z IEBus I/O IrDA LSB MSB NC PLL PWM SIM UART VCO All trademarks and registered trademarks are the property of their respective owners. Asynchronous Communication Interface ...

  • Page 10

    SFR Page Reference ........................................................................................................................... Overview ......................................................................................................................................... 1 1.1 Applications ............................................................................................................................................... 1 1.2 Performance Overview .............................................................................................................................. 2 1.3 Block Diagram .......................................................................................................................................... 4 1.4 Product Information .................................................................................................................................. 5 1.5 Pin Assignments ........................................................................................................................................ 9 1.6 Pin Functions ........................................................................................................................................... 10 ...

  • Page 11

    Voltage Detection Circuit .............................................................................................................. 34 6.1 VCC Input Voltage .................................................................................................................................. 45 6.1.1 Monitoring Vdet0 ............................................................................................................................... 45 6.1.2 Monitoring Vdet1 ............................................................................................................................... 45 6.1.3 Monitoring Vdet2 ............................................................................................................................... 45 6.2 Voltage Monitor 0 Reset (For N, D Version Only) ................................................................................. 46 6.3 ...

  • Page 12

    Protection .................................................................................................................................... 109 12. Interrupts ...................................................................................................................................... 110 12.1 Interrupt Overview ................................................................................................................................ 110 12.1.1 Types of Interrupts ............................................................................................................................ 110 12.1.2 Software Interrupts ........................................................................................................................... 111 12.1.3 Special Interrupts .............................................................................................................................. 112 12.1.4 Peripheral Function Interrupt ............................................................................................................ 112 12.1.5 Interrupts and Interrupt Vectors ...

  • Page 13

    PWM2 Mode ..................................................................................................................................... 215 14.3.8 Timer RC Interrupt ........................................................................................................................... 221 14.3.9 Notes on Timer RC ........................................................................................................................... 222 14.4 Timer RE ............................................................................................................................................... 223 14.4.1 Real-Time Clock Mode (For N, D Version Only) ............................................................................ 224 14.4.2 Output Compare Mode ..................................................................................................................... 232 ...

  • Page 14

    A/D Converter ............................................................................................................................. 338 18.1 One-Shot Mode ..................................................................................................................................... 342 18.2 Repeat Mode .......................................................................................................................................... 345 18.3 Sample and Hold ................................................................................................................................... 348 18.4 A/D Conversion Cycles ......................................................................................................................... 348 18.5 Internal Equivalent Circuit of Analog Input .......................................................................................... 349 18.6 Output Impedance of ...

  • Page 15

    Notes on Serial Interface ....................................................................................................................... 440 21.5 Notes on Clock Synchronous Serial Interface ....................................................................................... 441 21.5.1 Notes on Clock Synchronous Serial I/O with Chip Select ............................................................... 441 2 21.5.2 Notes bus Interface ................................................................................................................ 441 21.6 Notes ...

  • Page 16

    SFR Page Reference Address Register 0000h 0001h 0002h 0003h 0004h Processor Mode Register 0 0005h Processor Mode Register 1 0006h System Clock Control Register 0 0007h System Clock Control Register 1 0008h 0009h 000Ah Protect Register 000Bh 000Ch Oscillation Stop ...

  • Page 17

    Address Register 0080h 0081h 0082h 0083h 0084h 0085h 0086h 0087h 0088h 0089h 008Ah 008Bh 008Ch 008Dh 008Eh 008Fh 0090h 0091h 0092h 0093h 0094h 0095h 0096h 0097h 0098h 0099h 009Ah 009Bh 009Ch 009Dh 009Eh 009Fh 00A0h UART0 Transmit/Receive Mode Register 00A1h ...

  • Page 18

    Address Register 0100h Timer RA Control Register 0101h Timer RA I/O Control Register 0102h Timer RA Mode Register 0103h Timer RA Prescaler Register 0104h Timer RA Register 0105h 0106h LIN Control Register 0107h LIN Status Register 0108h Timer RB Control ...

  • Page 19

    Address Register 0170h 0171h 0172h 0173h 0174h 0175h 0176h 0177h 0178h 0179h 017Ah 017Bh 017Ch 017Dh 017Eh 017Fh 0180h 0181h 0182h 0183h 0184h 0185h 0186h 0187h 0188h 0189h 018Ah 018Bh 018Ch 018Dh 018Eh 018Fh 0190h 0191h 0192h 0193h 0194h 0195h ...

  • Page 20

    R8C/26 Group, R8C/27 Group SINGLE-CHIP 16-BIT CMOS MCU 1. Overview These MCUs are fabricated using a high-performance silicon gate CMOS process, embedding the R8C CPU core, and are packaged in a 32-pin molded-plastic LQFP. It implements sophisticated instructions for a ...

  • Page 21

    R8C/26 Group, R8C/27 Group 1.2 Performance Overview Table 1.1 outlines the Functions and Specifications for R8C/26 Group and Table 1.2 outlines the Functions and Specifications for R8C/27 Group. Table 1.1 Functions and Specifications for R8C/26 Group Item CPU Number of ...

  • Page 22

    R8C/26 Group, R8C/27 Group Table 1.2 Functions and Specifications for R8C/27 Group Item CPU Number of fundamental instructions Minimum instruction execution time Operating mode Address space Memory capacity Peripheral Ports Functions LED drive ports Timers Serial interfaces Clock synchronous serial ...

  • Page 23

    R8C/26 Group, R8C/27 Group 1.3 Block Diagram Figure 1.1 shows a Block Diagram. I/O ports Peripheral functions Timers Timer RA (8 bits) Timer RB (8 bits) Timer RC (16 bits × 1 channel) Timer RE (8 bits) Watchdog timer (15 ...

  • Page 24

    R8C/26 Group, R8C/27 Group 1.4 Product Information Table 1.3 lists the Product Information for R8C/26 Group and Table 1.4 lists the Product Information for R8C/27 Group. Table 1.3 Product Information for R8C/26 Group Part No. R5F21262SNFP R5F21264SNFP R5F21265SNFP R5F21266SNFP R5F21262SDFP ...

  • Page 25

    R8C/26 Group, R8C/27 Group Part No XXX FP Figure 1.2 Part Number, Memory Size, and Package of R8C/26 Group Rev.2.10 Sep 26, 2008 Page 6 of 453 REJ09B0278-0210 Package type: FP: PLQP0032GB-A ...

  • Page 26

    R8C/26 Group, R8C/27 Group Table 1.4 Product Information for R8C/27 Group Part No. Program ROM R5F21272SNFP 8 Kbytes 1 Kbyte × 2 512 bytes R5F21274SNFP 16 Kbytes 1 Kbyte × Kbyte R5F21275SNFP 24 Kbytes 1 Kbyte × 2 ...

  • Page 27

    R8C/26 Group, R8C/27 Group Part No XXX FP Figure 1.3 Part Number, Memory Size, and Package of R8C/27 Group Rev.2.10 Sep 26, 2008 Page 8 of 453 REJ09B0278-0210 Package type: FP: PLQP0032GB-A ...

  • Page 28

    R8C/26 Group, R8C/27 Group 1.5 Pin Assignments Figure 1.4 shows Pin Assignments (Top View). P0_7/AN0 P0_6/AN1 P0_5/AN2/CLK1 P0_4/AN3/TREO P0_3/AN4 P0_2/AN5 P0_1/AN6 (2) P0_0/AN7/(TXD1) NOTES: 1. P4_7 is an input-only port. 2. Can be assigned to the pin in parentheses by ...

  • Page 29

    R8C/26 Group, R8C/27 Group 1.6 Pin Functions Table 1.5 lists Pin Functions. Table 1.5 Pin Functions Type Symbol Power supply input VCC, VSS Analog power AVCC, AVSS supply input Reset input RESET MODE MODE XIN clock input XIN XIN clock ...

  • Page 30

    R8C/26 Group, R8C/27 Group Table 1.6 Pin Name Information by Pin Number Pin Control Pin Number RESET 4 (2) XOUT/XCOUT 5 VSS/AVSS 6 (2) XIN/XCIN 7 VCC/AVCC 8 MODE ...

  • Page 31

    R8C/26 Group, R8C/27 Group 2. Central Processing Unit (CPU) Figure 2.1 shows the CPU Registers. The CPU contains 13 registers. R0, R1, R2, R3, A0, A1, and FB configure a register bank. There are two sets of register bank. b31 ...

  • Page 32

    R8C/26 Group, R8C/27 Group 2.1 Data Registers (R0, R1, R2, and R3 16-bit register for transfer, arithmetic, and logic operations. The same applies R3. R0 can be split into high-order bits (R0H) and low-order ...

  • Page 33

    R8C/26 Group, R8C/27 Group 2.8.7 Interrupt Enable Flag (I) The I flag enables maskable interrupts. Interrupt are disabled when the I flag is set to 0, and are enabled when the I flag is set to 1. The I flag ...

  • Page 34

    R8C/26 Group, R8C/27 Group 3. Memory 3.1 R8C/26 Group Figure 3 Memory Map of R8C/26 Group. The R8C/26 group has 1 Mbyte of address space from addresses 00000h to FFFFFh. The internal ROM is allocated lower addresses, beginning ...

  • Page 35

    R8C/26 Group, R8C/27 Group 3.2 R8C/27 Group Figure 3 Memory Map of R8C/27 Group. The R8C/27 group has 1 Mbyte of address space from addresses 00000h to FFFFFh. The internal ROM (program ROM) is allocated lower addresses, beginning ...

  • Page 36

    R8C/26 Group, R8C/27 Group 4. Special Function Registers (SFRs) An SFR (special function register control register for a peripheral function. Tables 4.1 to 4.7 list the special function registers. Table 4.1 SFR Information (1) Address 0000h 0001h 0002h ...

  • Page 37

    R8C/26 Group, R8C/27 Group Table 4.2 SFR Information (2) Address 0030h 0031h Voltage Detection Register 1 0032h Voltage Detection Register 2 0033h 0034h 0035h 0036h Voltage Monitor 1 Circuit Control Register 0037h Voltage Monitor 2 Circuit Control Register 0038h Voltage ...

  • Page 38

    R8C/26 Group, R8C/27 Group Table 4.3 SFR Information (3) Address 0080h 0081h 0082h 0083h 0084h 0085h 0086h 0087h 0088h 0089h 008Ah 008Bh 008Ch 008Dh 008Eh 008Fh 0090h 0091h 0092h 0093h 0094h 0095h 0096h 0097h 0098h 0099h 009Ah 009Bh 009Ch 009Dh ...

  • Page 39

    R8C/26 Group, R8C/27 Group Table 4.4 SFR Information (4) Address 00C0h A/D Register 00C1h 00C2h 00C3h 00C4h 00C5h 00C6h 00C7h 00C8h 00C9h 00CAh 00CBh 00CCh 00CDh 00CEh 00CFh 00D0h 00D1h 00D2h 00D3h 00D4h A/D Control Register 2 00D5h 00D6h A/D ...

  • Page 40

    R8C/26 Group, R8C/27 Group Table 4.5 SFR Information (5) Address 0100h Timer RA Control Register 0101h Timer RA I/O Control Register 0102h Timer RA Mode Register 0103h Timer RA Prescaler Register 0104h Timer RA Register 0105h 0106h LIN Control Register ...

  • Page 41

    R8C/26 Group, R8C/27 Group Table 4.6 SFR Information (6) Address 0140h 0141h 0142h 0143h 0144h 0145h 0146h 0147h 0148h 0149h 014Ah 014Bh 014Ch 014Dh 014Eh 014Fh 0150h 0151h 0152h 0153h 0154h 0155h 0156h 0157h 0158h 0159h 015Ah 015Bh 015Ch 015Dh ...

  • Page 42

    R8C/26 Group, R8C/27 Group Table 4.7 SFR Information (7) Address 0180h 0181h 0182h 0183h 0184h 0185h 0186h 0187h 0188h 0189h 018Ah 018Bh 018Ch 018Dh 018Eh 018Fh 0190h 0191h 0192h 0193h 0194h 0195h 0196h 0197h 0198h 0199h 019Ah 019Bh 019Ch 019Dh ...

  • Page 43

    R8C/26 Group, R8C/27 Group 5. Resets The following resets are implemented: hardware reset, power-on reset, voltage monitor 0 reset (for N, D version only), voltage monitor 1 reset, voltage monitor 2 reset, watchdog timer reset, and software reset. Table 5.1 ...

  • Page 44

    R8C/26 Group, R8C/27 Group RESET Power-on reset VCC Voltage detection Watchdog Figure 5.2 Block Diagram of Reset Circuit (J, K Version) Rev.2.10 Sep 26, 2008 Page 25 of 453 REJ09B0278-0210 Hardware reset Power-on reset circuit Voltage monitor 1 reset Voltage ...

  • Page 45

    R8C/26 Group, R8C/27 Group Table 5.2 shows the Pin Functions while RESET Pin Level is “L”, Figure 5.3 shows the CPU Register Status after Reset, Figure 5.4 shows the Reset Sequence, and Figure 5.5 shows the OFS Register. Table 5.2 ...

  • Page 46

    R8C/26 Group, R8C/27 Group Option Function Select Register Symbol OFS Bit Symbol WDTON — (b1) ROMCR ROMCP1 — (b4) LVD0ON LVD1ON CSPROINI NOTES: 1. The OFS register is on the ...

  • Page 47

    R8C/26 Group, R8C/27 Group 5.1 Hardware Reset A reset is applied using the RESET pin. When an “L” signal is applied to the RESET pin while the supply voltage meets the recommended operating conditions, pins, CPU, and SFRs are all ...

  • Page 48

    R8C/26 Group, R8C/27 Group VCC RESET Figure 5.6 Example of Hardware Reset Circuit and Operation RESET Figure 5.7 Example of Hardware Reset Circuit (Usage Example of External Supply Voltage Detection Circuit) and Operation Rev.2.10 Sep 26, 2008 Page 29 of ...

  • Page 49

    R8C/26 Group, R8C/27 Group 5.2 Power-On Reset Function When the RESET pin is connected to the VCC pin via a pull-up resistor, and the VCC pin voltage level rises while the rise gradient is trth or more, the power-on reset ...

  • Page 50

    R8C/26 Group, R8C/27 Group VCC 4.7 kΩ (reference) RESET (3) V det1 External power por1 t w(por1) Internal reset signal (“L” valid) NOTES: 1. When using the voltage monitor 1 digital filter, ensure VCC is 2.0 V ...

  • Page 51

    R8C/26 Group, R8C/27 Group 5.3 Voltage Monitor 0 Reset (N, D Version) A reset is applied using the on-chip voltage detection 0 circuit. The voltage detection 0 circuit monitors the input voltage to the VCC pin. The voltage to monitor ...

  • Page 52

    R8C/26 Group, R8C/27 Group 5.6 Voltage Monitor 2 Reset A reset is applied using the on-chip voltage detection 2 circuit. The voltage detection 2 circuit monitors the input voltage to the VCC pin. The voltage monitored is Vdet2. When the ...

  • Page 53

    R8C/26 Group, R8C/27 Group 6. Voltage Detection Circuit The voltage detection circuit monitors the input voltage to the VCC pin. This circuit can be used to monitor the VCC input voltage by a program. Alternately, voltage monitor 0 reset (for ...

  • Page 54

    R8C/26 Group, R8C/27 Group Table 6.2 Specifications of Voltage Detection Circuit (J, K Version) Item VCC Monitor Voltage to monitor Detection target Monitor Process Reset When Voltage is Detected Interrupt Digital Filter Switch enabled/disabled Sampling time VCC Internal reference voltage ...

  • Page 55

    R8C/26 Group, R8C/27 Group VCC Internal reference voltage Figure 6.2 Block Diagram of Voltage Detection Circuit (J, K version) Voltage detection 0 circuit VCA25 VCC + Internal - reference voltage Voltage detection 0 signal is held “H” when VCA25 bit ...

  • Page 56

    R8C/26 Group, R8C/27 Group Voltage detection 1 circuit fOCO-S VCA26 VCC + Noise filter Voltage Internal - detection reference 1 signal (Filter width: 200 ns) voltage Voltage detection 1 signal is held “H” when VCA26 bit is set to 0 ...

  • Page 57

    R8C/26 Group, R8C/27 Group Voltage detection 2 circuit fOCO-S VCA27 VCA13 VCC + Noise filter Voltage Internal - detection reference 2 signal (Filter width: 200 ns) voltage Voltage detection 2 signal is held “H” when VCA27 bit is set to ...

  • Page 58

    R8C/26 Group, R8C/27 Group Voltage Detection Register Symbol VCA1 Bit Symbol — (b2-b0) VCA13 — (b7-b4) NOTES: 1. The VCA13 bit is enabled w ...

  • Page 59

    R8C/26 Group, R8C/27 Group Voltage Detection Register Symbol VCA2 Bit Symbol VCA20 — (b5-b1) VCA26 VCA27 NOTES: 1. Set the PRC3 bit in the PRCR register ...

  • Page 60

    R8C/26 Group, R8C/27 Group Voltage Monitor 0 Circuit Control Register Symbol VW0C Bit Symbol VW0C0 VW0C1 VW0C2 — (b3) VW0F0 VW0F1 VW0C6 VW0C7 NOTES: 1. Set the PRC3 bit in the ...

  • Page 61

    R8C/26 Group, R8C/27 Group Voltage Monitor 1 Circuit Control Register Symbol VW1C Bit Symbol VW1C0 VW1C1 VW1C2 VW1C3 VW1F0 VW1F1 VW1C6 VW1C7 NOTES: 1. Set the PRC3 bit in the PRCR register ...

  • Page 62

    R8C/26 Group, R8C/27 Group Voltage Monitor 1 Circuit Control Register Symbol VW1C Bit Symbol VW1C0 VW1C1 — (b2) — (b3) VW1F0 VW1F1 VW1C6 VW1C7 NOTES: 1. Set the PRC3 bit in ...

  • Page 63

    R8C/26 Group, R8C/27 Group Voltage Monitor 2 Circuit Control Register Symbol VW2C Bit Symbol VW2C0 VW2C1 VW2C2 VW2C3 VW2F0 VW2F1 VW2C6 VW2C7 NOTES: 1. Set the PRC3 bit in the PRCR register ...

  • Page 64

    R8C/26 Group, R8C/27 Group 6.1 VCC Input Voltage 6.1.1 Monitoring Vdet0 Vdet0 cannot be monitored. 6.1.2 Monitoring Vdet1 Set the VCA26 bit in the VCA2 register to 1 (voltage detection 1 circuit enabled). After td(E-A) has elapsed (refer to 20. ...

  • Page 65

    R8C/26 Group, R8C/27 Group 6.2 Voltage Monitor 0 Reset (For N, D Version Only) Table 6.3 lists the Procedure for Setting Bits Associated with Voltage Monitor Reset and Figure 6.13 shows an Example of Voltage Monitor 0 Reset Operation. To ...

  • Page 66

    R8C/26 Group, R8C/27 Group 6.3 Voltage Monitor 1 Interrupt and Voltage Monitor 1 Reset (N, D Version) Table 6.4 lists the Procedure for Setting Bits Associated with Voltage Monitor 1 Interrupt and Reset. Figure 6.14 shows an Example of Voltage ...

  • Page 67

    R8C/26 Group, R8C/27 Group Vdet1 (1) 2.2 V VW1C3 bit VW1C2 bit When the VW1C1 bit is set to 0 (digital filter enabled) Voltage monitor 1 interrupt request (VW1C6 = 0) Internal reset signal (VW1C6 = 1) VW1C2 bit When ...

  • Page 68

    R8C/26 Group, R8C/27 Group 6.4 Voltage Monitor 1 Reset (J, K Version) Table 6.5 lists the Procedure for Setting Bits Associated with Voltage Monitor 1 Reset. Figure 6.15 shows an Example of Voltage Monitor 1 Reset Operation (J, K Version). ...

  • Page 69

    R8C/26 Group, R8C/27 Group 6.5 Voltage Monitor 2 Interrupt and Voltage Monitor 2 Reset Table 6.6 lists the Procedure for Setting Bits Associated with Voltage Monitor 2 Interrupt and Reset. Figure 6.16 shows an Example of Voltage Monitor 2 Interrupt ...

  • Page 70

    R8C/26 Group, R8C/27 Group Vdet2 (1) 2.2 V VCA13 bit VW2C2 bit When the VW2C1 bit is set to 0 (digital filter enabled) Voltage monitor 2 interrupt request (VW2C6 = 0) Internal reset signal (VW2C6 = 1) VW2C2 bit When ...

  • Page 71

    R8C/26 Group, R8C/27 Group 7. Programmable I/O Ports There are 25 programmable Input/Output ports (I/O ports) P0, P1, P3_1, P3_3 to P3_7, P4_5, P5_3, and P5_4. Also, P4_6 and P4_7 can be used as input-only ports if the XIN clock ...

  • Page 72

    R8C/26 Group, R8C/27 Group 7.2 Effect on Peripheral Functions Programmable I/O ports function as I/O ports for peripheral functions (refer to Table 1.6 Pin Name Information by Pin Number). Table 7.3 lists the Setting of PDi_j Bit when Functioning as ...

  • Page 73

    R8C/26 Group, R8C/27 Group P0 Direction register Data bus Port latch P1_0 to P1_3 Direction register Output from individual peripheral function Data bus Port latch Input to individual peripheral function P1_4 Direction register Output from individual peripheral function Data bus ...

  • Page 74

    R8C/26 Group, R8C/27 Group P1_5 and P1_7 Direction register Output from individual peripheral function Data bus Port latch Input to external interrupt Input to individual peripheral function P1_6 Direction register Output from individual peripheral function Data bus Port latch Input ...

  • Page 75

    R8C/26 Group, R8C/27 Group P3_1 Output from individual peripheral function Data bus P3_3 and P3_6 Output from individual peripheral function Data bus Input to individual peripheral function Input to external interrupt P3_4, P3_5, and P3_7 Output from individual peripheral function ...

  • Page 76

    R8C/26 Group, R8C/27 Group P4_2/VREF P4_5 Output from individual peripheral function Data bus Input to individual peripheral function NOTE: 1. Ensure the input voltage to each port does not exceed VCC. Figure 7.4 Configuration of Programmable I/O Ports (4) Rev.2.10 ...

  • Page 77

    R8C/26 Group, R8C/27 Group (N, D Version) P4_6/XIN Data bus P4_7/XOUT Data bus (J, K Version) P4_6/XIN Data bus P4_7/XOUT Data bus NOTES: 1. Ensure the input voltage to each port does not exceed VCC. 2. This pin is pulled ...

  • Page 78

    R8C/26 Group, R8C/27 Group P5_3 and P5_4 Output from individual peripheral function Data bus Input to individual peripheral function NOTE: 1. Ensure the input voltage to each port does not exceed VCC. Figure 7.6 Configuration of Programmable I/O Ports (5) ...

  • Page 79

    R8C/26 Group, R8C/27 Group Port Pi Direction Register ( Symbol PD0 PD1 PD3 PD4 PD5 Bit Symbol PDi_0 PDi_1 PDi_2 PDi_3 PDi_4 PDi_5 PDi_6 PDi_7 NOTES: ...

  • Page 80

    R8C/26 Group, R8C/27 Group Port Pi Register ( Symbol Bit Symbol Pi_0 Pi_1 Pi_2 Pi_3 Pi_4 Pi_5 Pi_6 Pi_7 NOTES: 1. ...

  • Page 81

    R8C/26 Group, R8C/27 Group Pin Select Register Symbol PINSR1 Bit Symbol UART1SEL0 UART1SEL1 — (b2) — (b7-b3) NOTE: 1. The UART1 pins can be selected ...

  • Page 82

    R8C/26 Group, R8C/27 Group Port Mode Register Symbol PMR Bit Symbol INT1SEL — (b2-b1) SSISEL U1PINSEL TXD1SEL TXD1EN IICSEL NOTE: 1. The UART1 pins can be selected by using bits U1PINSEL, TXD1SEL ...

  • Page 83

    R8C/26 Group, R8C/27 Group Pull-Up Control Register Symbol PUR0 Bit Symbol PU00 PU01 PU02 PU03 — (b5-b4) PU06 PU07 NOTE: 1. When this bit is set to 1 (pulled ...

  • Page 84

    R8C/26 Group, R8C/27 Group 7.4 Port Setting Table 7.4 to Table 7.40 list the port setting. Table 7.4 Port P0_0/AN7/(TXD1) Register PD0 Bit PD0_0 SMD2 Setting 0 value ...

  • Page 85

    R8C/26 Group, R8C/27 Group Table 7.8 Port P0_4/AN3/TREO Register PD0 TRECR1 Bit PD0_4 TOENA Setting value NOTE: 1. Pulled up by setting the PU01 bit in the PUR0 ...

  • Page 86

    R8C/26 Group, R8C/27 Group Table 7.13 Port P1_1/KI1/AN9/TRCIOA/TRCTRG Register PD1 KIEN Bit PD1_1 KI1EN 0 0 Other than TRCIOA usage conditions 1 0 Other than TRCIOA usage conditions 0 0 Other than TRCIOA usage conditions Setting 0 1 Other than ...

  • Page 87

    R8C/26 Group, R8C/27 Group Table 7.17 Port P1_3/KI3/AN11/(TRBO) Register PD1 KIEN Bit PD1_3 KI3EN 0 0 Other than TRBO usage conditions 1 0 Other than TRBO usage conditions 0 0 Other than TRBO usage conditions Setting value 0 1 Other ...

  • Page 88

    R8C/26 Group, R8C/27 Group Table 7.20 Port P1_5/RXD0/(TRAIO)/(INT1) Register PD1 TRAIOC Bit PD1_5 TIOSEL Setting 1 value NOTES: 1. Pulled up ...

  • Page 89

    R8C/26 Group, R8C/27 Group 3. Set the TOPCR bit in the TRAIOC register modes except for pulse output mode. Table 7.23 Port P3_1/TRBO Register PD3 Bit PD3_1 0 Setting 1 value NOTE: ...

  • Page 90

    R8C/26 Group, R8C/27 Group Table 7.27 TRCIOC Pin Setting Register PINSR3 TRCOER Bit TRCIOCSEL Setting value Table 7.28 Port P3_5/SCL/SSCK/(TRCIOD) Register PD3 PMR ICCR1 Bit PD3_5 ...

  • Page 91

    R8C/26 Group, R8C/27 Group Table 7.30 Port P3_6/(TXD1)/(RXD1)/(INT1) Register PD3 PMR Bit PD3_6 TXD1EN Setting X value NOTES: 1. Pulled up by setting the ...

  • Page 92

    R8C/26 Group, R8C/27 Group Table 7.32 Port P3_7 UART1 Setting Condition Register PINSR1 Bit UART1SEL1 UART1SEL0 U1PINSEL TXD1SEL TXD1EN SMD2 0 Setting value Table 7.33 Port P4_2/VREF Register ADCON1 Bit VCUT 0 Setting value 1 Table ...

  • Page 93

    R8C/26 Group, R8C/27 Group Table 7.35 Port P4_6/XIN/XCIN Register CM0 Bit CM01 CM04 CM05 Setting value NOTE: 1. For N, D version only. Table 7.36 ...

  • Page 94

    R8C/26 Group, R8C/27 Group Table 7.37 Port P5_3/TRCIOC Register PD5 Bit PD5_3 0 Other than TRCIOC usage conditions 1 Other than TRCIOC usage conditions Setting value X Refer to Table 7.38 TRCIOC Pin Setting 0 Refer to Table 7.38 TRCIOC ...

  • Page 95

    R8C/26 Group, R8C/27 Group 7.5 Unassigned Pin Handling Table 7.41 lists the Unassigned Pin Handling. Table 7.41 Unassigned Pin Handling Pin Name Ports P0, P1, P3_1, P3_3 to P3_7, P4_3 to P4_5, P5_3, P5_4 Ports P4_6, P4_7 Port P4_2, VREF ...

  • Page 96

    R8C/26 Group, R8C/27 Group 8. Processor Mode 8.1 Processor Modes Single-chip mode can be selected as the processor mode. Table 8.1 lists Features of Processor Mode. Figure 8.1 shows the PM0 Register and Figure 8.2 shows the PM1 Register. Table ...

  • Page 97

    R8C/26 Group, R8C/27 Group 9. Bus The bus cycles differ when accessing ROM/RAM, and when accessing SFR. Table 9.1 lists Bus Cycles by Access Space of the R8C/26 Group and Table 9.2 lists Bus Cycles by Access Space of the ...

  • Page 98

    R8C/26 Group, R8C/27 Group 10. Clock Generation Circuit The clock generation circuit has: • XIN clock oscillation circuit • XCIN clock oscillation circuit (For N, D version only) • Low-speed on-chip oscillator • High-speed on-chip oscillator However, use one of ...

  • Page 99

    R8C/26 Group, R8C/27 Group Stop signal (1) (1) XOUT/XCOUT XIN/XCIN CM01 = 0 CM13 CM05 CM04 XIN CM01 clock XCIN clock S Q CM10 = 1 (stop mode) R RESET Power-on reset Software reset Interrupt request S Q WAIT instruction ...

  • Page 100

    R8C/26 Group, R8C/27 Group System Clock Control Register Symbol CM0 Bit Symbol — (b0) CM01 CM02 CM03 CM04 CM05 CM06 — (b7) NOTES: 1. Set the PRC0 bit in ...

  • Page 101

    R8C/26 Group, R8C/27 Group System Clock Control Register Symbol CM1 Bit Symbol CM10 CM11 CM12 CM13 CM14 CM15 CM16 CM17 NOTES: 1. Set the PRC0 bit in the PRCR register to ...

  • Page 102

    R8C/26 Group, R8C/27 Group Oscillation Stop Detection Register Symbol OCD Bit Symbol OCD0 OCD1 OCD2 OCD3 — (b7-b4) NOTES: 1. Set the PRC0 bit in the PRCR register ...

  • Page 103

    R8C/26 Group, R8C/27 Group High-Speed On-Chip Oscillator Control Register Symbol FRA0 Bit Symbol FRA00 FRA01 — (b7-b2) NOTES: Set the PRC0 bit in the PRCR ...

  • Page 104

    R8C/26 Group, R8C/27 Group High-Speed On-Chip Oscillator Control Register Symbol FRA2 Bit Symbol FRA20 FRA21 FRA22 — (b7-b3) NOTES: 1. Set the PRC0 bit in the ...

  • Page 105

    R8C/26 Group, R8C/27 Group Clock Prescaler Reset Flag (For N, D Version Only Symbol CPSRF Bit Symbol — (b6-b0) CPSR NOTE: 1. Only w rite ...

  • Page 106

    R8C/26 Group, R8C/27 Group Voltage Detection Register Symbol VCA2 Bit Symbol VCA20 — (b5-b1) VCA26 VCA27 NOTES: 1. Set the PRC3 bit in the PRCR register ...

  • Page 107

    R8C/26 Group, R8C/27 Group Handling procedure of internal power low consumption enabled by VCA20 bit Enter low-speed clock mode or low-speed Step (1) on-chip oscillator mode Stop XIN clock and high-speed on-chip Step (2) oscillator clock VCA20 ← 1 (internal ...

  • Page 108

    R8C/26 Group, R8C/27 Group The clocks generated by the clock generation circuits are described below. 10.1 XIN Clock This clock is supplied by the XIN clock oscillation circuit. This clock is used as the clock source for the CPU and ...

  • Page 109

    R8C/26 Group, R8C/27 Group 10.2 On-Chip Oscillator Clocks These clocks are supplied by the on-chip oscillators (high-speed on-chip oscillator and a low-speed on-chip oscillator). The on-chip oscillator clock is selected by the FRA01 bit in the FRA0 register. 10.2.1 Low-Speed ...

  • Page 110

    R8C/26 Group, R8C/27 Group 10.3 XCIN Clock (For N, D Version Only) This clock is supplied by the XCIN clock oscillation circuit. This clock is used as the clock source for the CPU clock, peripheral function clock. The XCIN clock ...

  • Page 111

    R8C/26 Group, R8C/27 Group 10.4 CPU Clock and Peripheral Function Clock There are a CPU clock to operate the CPU and a peripheral function clock to operate the peripheral functions. Refer to Figure 10.1 Clock Generation Circuit. 10.4.1 System Clock ...

  • Page 112

    R8C/26 Group, R8C/27 Group 10.4.8 fC4 and fC32 The clock fC4 is used for timer RE and the clock fC32 is used for timer RA. Use fC4 and fC32 while the XCIN clock oscillation stabilizes. (For J, K version, fC4 ...

  • Page 113

    R8C/26 Group, R8C/27 Group 10.5 Power Control There are three power control modes. All modes other than wait mode and stop mode are referred to as standard operating mode. 10.5.1 Standard Operating Mode Standard operating mode is further separated into ...

  • Page 114

    R8C/26 Group, R8C/27 Group 10.5.1.1 High-Speed Clock Mode The XIN clock divided by 1 (no division provides the CPU clock. Set the CM06 bit to 1 (divide- by-8 mode) when transiting to high-speed on-chip oscillator ...

  • Page 115

    R8C/26 Group, R8C/27 Group 10.5.2 Wait Mode Since the CPU clock stops in wait mode, the CPU, which operates using the CPU clock, and the watchdog timer, when count source protection mode is disabled, stop. The XIN clock, XCIN clock, ...

  • Page 116

    R8C/26 Group, R8C/27 Group 10.5.2.4 Exiting Wait Mode The MCU exits wait mode by a reset or a peripheral function interrupt. The peripheral function interrupts are affected by the CM02 bit. When the CM02 bit is set to 0 (peripheral ...

  • Page 117

    R8C/26 Group, R8C/27 Group Figure 10.13 shows the Time from Wait Mode to Interrupt Routine Execution. When using a peripheral function interrupt to exit wait mode, set up the following before executing the WAIT instruction. (1) Set the interrupt priority ...

  • Page 118

    R8C/26 Group, R8C/27 Group 10.5.2.5 Reducing Internal Power Consumption Internal power consumption can be reduced by using low-speed clock mode (for N, D version only) or low- speed on-chip oscillator mode. Figure 10.14 shows the Procedure for Enabling Reduced Internal ...

  • Page 119

    R8C/26 Group, R8C/27 Group 10.5.3 Stop Mode Since the oscillator circuits stop in stop mode, the CPU clock and peripheral function clock stop and the CPU and peripheral functions that use these clocks stop operating. The least power required to ...

  • Page 120

    R8C/26 Group, R8C/27 Group 10.5.3.3 Exiting Stop Mode The MCU exits stop mode by a reset or peripheral function interrupt. Figure 10.15 shows the Time from Stop Mode to Interrupt Routine Execution. When using a peripheral function interrupt to exit ...

  • Page 121

    R8C/26 Group, R8C/27 Group Figure 10.16 shows the State Transitions in Power Control Mode (When the CM01 bit in the CM0 register is set to 0 (XIN clock)). Figure 10.17 shows the State Transitions in Power Control Mode (When the ...

  • Page 122

    R8C/26 Group, R8C/27 Group State Transitions in Power Control Mode (When the CM01 bit in the CM0 register is set to 1 (XCIN clock)) (For N, D version only) Reset Low-speed on-chip oscillator mode CM14 = 0 OCD2 = 1 ...

  • Page 123

    R8C/26 Group, R8C/27 Group 10.6 Oscillation Stop Detection Function The oscillation stop detection function detects the stop of the XIN clock oscillating circuit. The oscillation stop detection function can be enabled and disabled by the OCD0 bit in the OCD ...

  • Page 124

    R8C/26 Group, R8C/27 Group Table 10.6 Determining Interrupt Source for Oscillation Stop Detection, Watchdog Timer, Voltage Monitor 1, and Voltage Monitor 2 Interrupts Generated Interrupt Source Oscillation stop detection ((a) or (b)) Watchdog timer (1) Voltage monitor 1 Voltage monitor ...

  • Page 125

    R8C/26 Group, R8C/27 Group Interrupt sources judgement OCD3 = (XIN clock stopped) YES (oscillation stop detection interrupt enabled) and OCD2 = 1 (on-chip oscillator clock selected as system clock) ? Set OCD1 bit to 0 (oscillation stop ...

  • Page 126

    R8C/26 Group, R8C/27 Group Interrupt sources judgement OCD3 = 1 ? (XIN clock stopped) YES Set OCD1 bit to 0 (oscillation stop (1) detection interrupt disabled). To oscillation stop detection interrupt routine NOTE: 1. This disables multiple oscillation stop detection ...

  • Page 127

    R8C/26 Group, R8C/27 Group 10.7 Notes on Clock Generation Circuit 10.7.1 Stop Mode When entering stop mode, set the FMR01 bit in the FMR0 register to 0 (CPU rewrite mode disabled) and the CM10 bit in the CM1 register to ...

  • Page 128

    R8C/26 Group, R8C/27 Group 11. Protection The protection function protects important registers from being easily overwritten when a program runs out of control. Figure 11.1 shows the PRCR Register. The registers protected by the PRCR register are listed below. • ...

  • Page 129

    R8C/26 Group, R8C/27 Group 12. Interrupts 12.1 Interrupt Overview 12.1.1 Types of Interrupts Figure 12.1 shows the Types of Interrupts. Software (non-maskable interrupts) Interrupts Hardware NOTES: 1. Peripheral function interrupts in the MCU are used to generate peripheral interrupts. 2. ...

  • Page 130

    R8C/26 Group, R8C/27 Group 12.1.2 Software Interrupts A software interrupt is generated when an instruction is executed. Software interrupts are non-maskable. 12.1.2.1 Undefined Instruction Interrupt The undefined instruction interrupt is generated when the UND instruction is executed. 12.1.2.2 Overflow Interrupt ...

  • Page 131

    R8C/26 Group, R8C/27 Group 12.1.3 Special Interrupts Special interrupts are non-maskable. 12.1.3.1 Watchdog Timer Interrupt The watchdog timer interrupt is generated by the watchdog timer. For details of the watchdog timer, refer to 13. Watchdog Timer. 12.1.3.2 Oscillation Stop Detection ...

  • Page 132

    R8C/26 Group, R8C/27 Group 12.1.5 Interrupts and Interrupt Vectors There are 4 bytes in each vector. Set the starting address of an interrupt routine in each interrupt vector. When an interrupt request is acknowledged, the CPU branches to the address ...

  • Page 133

    R8C/26 Group, R8C/27 Group 12.1.5.2 Relocatable Vector Tables The relocatable vector tables occupy 256 bytes beginning from the starting address set in the INTB register. Table 12.2 lists the Relocatable Vector Tables. Table 12.2 Relocatable Vector Tables Vector Addresses Interrupt ...

  • Page 134

    R8C/26 Group, R8C/27 Group 12.1.6 Interrupt Control The following describes enabling and disabling the maskable interrupts and setting the priority for acknowledgement. The explanation does not apply to nonmaskable interrupts. Use the I flag in the FLG register, IPL, and ...

  • Page 135

    R8C/26 Group, R8C/27 Group (1) Interrupt Control Register TRCIC SSUIC/IICIC Bit Symbol ILVL0 ILVL1 ILVL2 IR — (b7-b4) NOTES: 1. Rew rite the interrupt control register w hen the interrupt request w ...

  • Page 136

    R8C/26 Group, R8C/27 Group INTi Interrupt Control Register (i= Symbol INT1IC INT3IC INT0IC Bit Symbol ILVL0 ILVL1 ILVL2 IR POL — (b5) — (b7-b6) NOTES: 1. Only 0 can ...

  • Page 137

    R8C/26 Group, R8C/27 Group 12.1.6.1 I Flag The I flag enables or disables maskable interrupts. Setting the I flag to 1 (enabled) enables maskable interrupts. Setting the I flag to 0 (disabled) disables all maskable interrupts. 12.1.6.2 IR Bit The ...

  • Page 138

    R8C/26 Group, R8C/27 Group 12.1.6.4 Interrupt Sequence An interrupt sequence is performed between an interrupt request acknowledgement and interrupt routine execution. When an interrupt request is generated while an instruction is being executed, the CPU determines its interrupt priority level ...

  • Page 139

    R8C/26 Group, R8C/27 Group 12.1.6.5 Interrupt Response Time Figure 12.7 shows the Interrupt Response Time. The interrupt response time is the period between an interrupt request generation and the execution of the first instruction in the interrupt routine. The interrupt ...

  • Page 140

    R8C/26 Group, R8C/27 Group 12.1.6.7 Saving a Register In the interrupt sequence, the FLG register and PC are saved to the stack. After an extended 16 bits, 4 high-order bits in the PC and 4 high-order (IPL) and 8 low-order ...

  • Page 141

    R8C/26 Group, R8C/27 Group 12.1.6.8 Returning from an Interrupt Routine When the REIT instruction is executed at the end of an interrupt routine, the FLG register and PC, which have been saved to the stack, are automatically restored. The program, ...

  • Page 142

    R8C/26 Group, R8C/27 Group 12.1.6.10 Interrupt Priority Judgement Circuit The interrupt priority judgement circuit selects the highest priority interrupt, as shown in Figure 12.11. Priority level of interrupt INT3 Timer RB Timer RA INT0 INT1 Timer RC UART1 receive UART0 ...

  • Page 143

    R8C/26 Group, R8C/27 Group 12.2 INT Interrupt 12.2.1 INTi Interrupt ( The INTi interrupt is generated by an INTi input. When using the INTi interrupt, the INTiEN bit in the INTEN register is set to 1 ...

  • Page 144

    R8C/26 Group, R8C/27 Group ______ INT0 Input Filter Select Register Symbol INTF Bit Symbol INT0F0 INT0F1 INT1F0 INT1F1 — (b5-b4) INT3F0 INT3F1 Figure 12.13 INTF Register Rev.2.10 Sep 26, 2008 ...

  • Page 145

    R8C/26 Group, R8C/27 Group 12.2.2 INTi Input Filter ( The INTi input contains a digital filter. The sampling clock is selected by bits INTiF1 to INTiF0 in the INTF register. The IR bit in the INTiIC ...

  • Page 146

    R8C/26 Group, R8C/27 Group 12.3 Key Input Interrupt A key input interrupt request is generated by one of the input edges of the K10 to K13 pins. The key input interrupt can be used as a key-on wake-up function to ...

  • Page 147

    R8C/26 Group, R8C/27 Group (1) Key Input Enable Register Symbol KIEN Bit Symbol KI0EN KI0PL KI1EN KI1PL KI2EN KI2PL KI3EN KI3PL NOTE: 1. The IR bit in the KUPIC register may be ...

  • Page 148

    R8C/26 Group, R8C/27 Group 12.4 Address Match Interrupt An address match interrupt request is generated immediately before execution of the instruction at the address indicated by the RMADi register ( 1). This interrupt is used as a ...

  • Page 149

    R8C/26 Group, R8C/27 Group Address Match Interrupt Enable Register Symbol AIER Bit Symbol AIER0 AIER1 — (b7-b2) Address Match Interrupt Register (b23) (b19) (b16) (b15) b7 ...

  • Page 150

    R8C/26 Group, R8C/27 Group 12.5 Timer RC Interrupt, Clock Synchronous Serial I/O with Chip Select Interrupts, and I Request Sources) The timer RC interrupt, clock synchronous serial I/O with chip select interrupt, and I have multiple interrupt request sources. An ...

  • Page 151

    R8C/26 Group, R8C/27 Group As with other maskable interrupts, the timer RC interrupt, clock synchronous serial I/O with chip select interrupt, 2 and I C bus interface interrupt are controlled by the combination of the I flag, IR bit, bits ...

  • Page 152

    R8C/26 Group, R8C/27 Group 12.6 Notes on Interrupts 12.6.1 Reading Address 00000h Do not read address 00000h by a program. When a maskable interrupt request is acknowledged, the CPU reads interrupt information (interrupt number and interrupt request level) from 00000h ...

  • Page 153

    R8C/26 Group, R8C/27 Group 12.6.4 Changing Interrupt Sources The IR bit in the interrupt control register may be set to 1 (interrupt requested) when the interrupt source changes. When using an interrupt, set the IR bit to 0 (no interrupt ...

  • Page 154

    R8C/26 Group, R8C/27 Group 12.6.5 Changing Interrupt Control Register Contents (a) The contents of an interrupt control register can only be changed while no interrupt requests corresponding to that register are generated. If interrupt requests may be generated, disable interrupts ...

  • Page 155

    R8C/26 Group, R8C/27 Group 13. Watchdog Timer The watchdog timer is a function that detects when a program is out of control. Use of the watchdog timer is recommended to improve the reliability of the system. The watchdog timer contains ...

  • Page 156

    R8C/26 Group, R8C/27 Group Option Function Select Register Symbol OFS Bit Symbol WDTON — (b1) ROMCR ROMCP1 — (b4) LVD0ON LVD1ON CSPROINI NOTES: 1. The OFS register is on the ...

  • Page 157

    R8C/26 Group, R8C/27 Group Watchdog Timer Reset Register b7 b0 Symbol WDTR When 00h is w ritten before w riting FFh, the w atchdog timer is reset. The default value of the w atchdog timer is 7FFFh w hen count ...

  • Page 158

    R8C/26 Group, R8C/27 Group 13.1 Count Source Protection Mode Disabled The count source of the watchdog timer is the CPU clock when count source protection mode is disabled. Table 13.2 lists the Specifications of Watchdog Timer (with Count Source Protection ...

  • Page 159

    R8C/26 Group, R8C/27 Group 13.2 Count Source Protection Mode Enabled The count source of the watchdog timer is the low-speed on-chip oscillator clock when count source protection mode is enabled. If the CPU clock stops when a program is out ...

  • Page 160

    R8C/26 Group, R8C/27 Group 14. Timers The microcomputer contains two 8-bit timers with 8-bit prescaler, a 16-bit timer, and a timer with a 4-bit counter, and an 8-bit counter. The two 8-bit timers with the 8-bit prescaler contain Timer RA ...

  • Page 161

    R8C/26 Group, R8C/27 Group Table 14.1 Functional Comparison of Timers Item Configuration Count (1) Count source Function Timer Mode Pulse Output Mode Event Counter Mode Pulse Width Measurement Mode Pulse Period Measurement Mode Programmable Waveform Generation Mode Programmable One-Shot generation ...

  • Page 162

    R8C/26 Group, R8C/27 Group 14.1 Timer RA Timer 8-bit timer with an 8-bit prescaler. The prescaler and timer each consist of a reload register and counter. The reload register and counter are allocated at the same address, ...

  • Page 163

    R8C/26 Group, R8C/27 Group (4) Timer RA Control Register Symbol TRACR Bit Symbol TSTART TCSTF TSTOP — (b3) TEDGF TUNDF — (b7-b6) NOTES: 1. Refer to 14.1.6 Notes on Tim er RA ...

  • Page 164

    R8C/26 Group, R8C/27 Group Timer RA Mode Register Symbol TRAMR Bit Symbol TMOD0 TMOD1 TMOD2 — (b3) TCK0 TCK1 TCK2 TCKCUT NOTES: 1. When both the TSTART and TCSTF bits in the ...

  • Page 165

    R8C/26 Group, R8C/27 Group 14.1.1 Timer Mode In this mode, the timer counts an internally generated count source (refer to Table 14.2 Specifications of Timer Mode). Figure 14.4 shows the TRAIOC Register in Timer Mode. Table 14.2 Specifications of Timer ...

  • Page 166

    R8C/26 Group, R8C/27 Group 14.1.1.1 Timer Write Control during Count Operation Timer RA has a prescaler and a timer (which counts the prescaler underflows). The prescaler and timer each consist of a reload register and a counter. When writing to ...

  • Page 167

    R8C/26 Group, R8C/27 Group 14.1.2 Pulse Output Mode In pulse output mode, the internally generated count source is counted, and a pulse with inverted polarity is output from the TRAIO pin each time the timer underflows (refer to Table 14.3 ...

  • Page 168

    R8C/26 Group, R8C/27 Group Timer RA I/O Control Register Symbol TRAIOC Bit Symbol TEDGSEL TOPCR TOENA TIOSEL TIPF0 TIPF1 — (b7-b6) Figure 14.6 TRAIOC Register in Pulse Output Mode Rev.2.10 ...

  • Page 169

    R8C/26 Group, R8C/27 Group 14.1.3 Event Counter Mode In event counter mode, external signal inputs to the INT1/TRAIO pin are counted (refer to Table 14.4 Specifications of Event Counter Mode). Figure 14.7 shows the TRAIOC Register in Event Counter Mode. ...

  • Page 170

    R8C/26 Group, R8C/27 Group Timer RA I/O Control Register Symbol TRAIOC Bit Symbol TEDGSEL TOPCR TOENA TIOSEL TIPF0 TIPF1 — (b7-b6) NOTE: 1. When the same value from the TRAIO pin ...

  • Page 171

    R8C/26 Group, R8C/27 Group 14.1.4 Pulse Width Measurement Mode In pulse width measurement mode, the pulse width of an external signal input to the INT1/TRAIO pin is measured (refer to Table 14.5 Specifications of Pulse Width Measurement Mode). Figure 14.8 ...

  • Page 172

    R8C/26 Group, R8C/27 Group Timer RA I/O Control Register Symbol TRAIOC Bit Symbol TEDGSEL TOPCR TOENA TIOSEL TIPF0 TIPF1 — (b7-b6) NOTE: 1. When the same value from the TRAIO ...

  • Page 173

    R8C/26 Group, R8C/27 Group n = high level: the contents of TRA register, low level: the contents of TRAPRE register FFFFh n 0000h Set program 1 TSTART bit in TRACR register 0 1 Measured pulse (TRAIO pin ...

  • Page 174

    R8C/26 Group, R8C/27 Group 14.1.5 Pulse Period Measurement Mode In pulse period measurement mode, the pulse period of an external signal input to the INT1/TRAIO pin is measured (refer to Table 14.6 Specifications of Pulse Period Measurement Mode). Figure 14.10 ...

  • Page 175

    R8C/26 Group, R8C/27 Group Timer RA I/O Control Register Symbol TRAIOC Bit Symbol TEDGSEL TOPCR TOENA TIOSEL TIPF0 TIPF1 — (b7-b6) NOTE: 1. When the same value from the TRAIO ...

  • Page 176

    R8C/26 Group, R8C/27 Group Underflow signal of timer RA prescaler Set program 1 TSTART bit in TRACR register 0 Starts counting 1 Measurement pulse (TRAIO pin input) 0 Contents of TRA Contents of read-out (1) buffer 1 ...

  • Page 177

    R8C/26 Group, R8C/27 Group 14.1.6 Notes on Timer RA • Timer RA stops counting after a reset. Set the values in the timer RA and timer RA prescalers before the count starts. • Even if the prescaler and timer RA ...

  • Page 178

    R8C/26 Group, R8C/27 Group 14.2 Timer RB Timer 8-bit timer with an 8-bit prescaler. The prescaler and timer each consist of a reload register and counter (refer to Tables 14.7 to 14.10 the Specifications of Each Mode). ...

  • Page 179

    R8C/26 Group, R8C/27 Group Timer RB Control Register Symbol TRBCR Bit Symbol TSTART TCSTF TSTOP — (b7-b3) NOTES: 1. Refer to 14.2.5 Notes on Tim er RB for precautions regarding bits TSTART, ...

  • Page 180

    R8C/26 Group, R8C/27 Group Timer RB I/O Control Register Symbol TRBIOC Bit Symbol TOPL TOCNT INOSTG INOSEG — (b7-b4) Timer RB Mode Register Symbol ...

  • Page 181

    R8C/26 Group, R8C/27 Group Timer RB Prescaler Register b7 b0 Timer mode Programmable w aveform generation mode Programmable one-shot generation mode Programmable w ait one-shot generation mode NOTE: 1. When the TSTOP bit in the TRBCR register is set to ...

  • Page 182

    R8C/26 Group, R8C/27 Group 14.2.1 Timer Mode In timer mode, a count source which is internally generated or timer RA underflows are counted (refer to Table 14.7 Specifications of Timer Mode). Registers TRBOCR and TRBSC are not used in timer ...

  • Page 183

    R8C/26 Group, R8C/27 Group 14.2.1.1 Timer Write Control during Count Operation Timer RB has a prescaler and a timer (which counts the prescaler underflows). The prescaler and timer each consist of a reload register and a counter. In timer mode, ...

  • Page 184

    R8C/26 Group, R8C/27 Group When the TWRC bit is set to 0 (write to reload register and counter) Set 01h to the TRBPRE register and 25h to the TRBPR register by a program. Count source Reloads register of Previous value ...

  • Page 185

    R8C/26 Group, R8C/27 Group 14.2.2 Programmable Waveform Generation Mode In programmable waveform generation mode, the signal output from the TRBO pin is inverted each time the counter underflows, while the values in registers TRBPR and TRBSC are counted alternately (refer ...

  • Page 186

    R8C/26 Group, R8C/27 Group Timer RB I/O Control Register Symbol TRBIOC Bit Symbol TOPL TOCNT INOSTG INOSEG — (b7-b4) Figure 14.18 TRBIOC Register in Programmable Waveform Generation Mode Rev.2.10 Sep ...

  • Page 187

    R8C/26 Group, R8C/27 Group 1 TSTART bit in TRBCR register 0 Count source Timer RB prescaler underflow signal Counter of timer bit in TRBIC register 0 1 TOPL bit in TRBIO register 0 1 TRBO pin output ...

  • Page 188

    R8C/26 Group, R8C/27 Group 14.2.3 Programmable One-shot Generation Mode In programmable one-shot generation mode, a one-shot pulse is output from the TRBO pin by a program or an external trigger input (input to the INT0 pin) (refer to Table 14.9 ...

  • Page 189

    R8C/26 Group, R8C/27 Group Timer RB I/O Control Register Symbol TRBIOC Bit Symbol TOPL TOCNT INOSTG INOSEG — (b7-b4) NOTE: 1. Refer to 14.2.3.1 One-Shot Trigger Selection. Figure 14.20 TRBIOC Register ...

  • Page 190

    R8C/26 Group, R8C/27 Group 1 TSTART bit in TRBCR register 0 Set program 1 TOSSTF bit in TRBOCR register 0 INT0 pin input Count source Timer RB prescaler underflow signal Counter of timer bit ...

  • Page 191

    R8C/26 Group, R8C/27 Group 14.2.3.1 One-Shot Trigger Selection In programmable one-shot generation mode and programmable wait one-shot generation mode, operation starts when a one-shot trigger is generated while the TCSTF bit in the TRBCR register is set to 1 (count ...

  • Page 192

    R8C/26 Group, R8C/27 Group 14.2.4 Programmable Wait One-Shot Generation Mode In programmable wait one-shot generation mode, a one-shot pulse is output from the TRBO pin by a program or an external trigger input (input to the INT0 pin) (refer to ...

  • Page 193

    R8C/26 Group, R8C/27 Group Table 14.10 Specifications of Programmable Wait One-Shot Generation Mode Item Count sources Count operations Wait time One-shot pulse output time (n+1)(p+1)/fi Count start conditions Count stop conditions Interrupt request generation timing TRBO pin function INT0 pin ...

  • Page 194

    R8C/26 Group, R8C/27 Group Timer RB I/O Control Register Symbol TRBIOC Bit Symbol TOPL TOCNT INOSTG INOSEG — (b7-b4) NOTE: 1. Refer to 14.2.3.1 One-Shot Trigger Selection . Figure 14.22 TRBIOC ...

  • Page 195

    R8C/26 Group, R8C/27 Group 1 TSTART bit in TRBCR register 0 1 TOSSTF bit in TRBOCR register 0 INT0 pin input Count source Timer RB prescaler underflow signal Counter of timer bit in TRBIC register 0 1 ...

  • Page 196

    R8C/26 Group, R8C/27 Group 14.2.5 Notes on Timer RB • Timer RB stops counting after a reset. Set the values in the timer RB and timer RB prescalers before the count starts. • Even if the prescaler and timer RB ...

  • Page 197

    R8C/26 Group, R8C/27 Group 14.2.5.2 Programmable waveform generation mode The following three workarounds should be performed in programmable waveform generation mode. (1) To write to registers TRBPRE and TRBPR during count operation (TCSTF bit is set to 1), note the ...

  • Page 198

    R8C/26 Group, R8C/27 Group • Workaround example (b): As shown in Figure 14.25 detect the start of the primary period by the TRBO pin output level and write to registers TRBSC and TRBPR. These write operations must be completed by ...

  • Page 199

    R8C/26 Group, R8C/27 Group 14.2.5.4 Programmable wait one-shot generation mode The following three workarounds should be performed in programmable wait one-shot generation mode. (1) To write to registers TRBPRE and TRBPR during count operation (TCSTF bit is set to 1), ...

  • Page 200

    R8C/26 Group, R8C/27 Group 14.3 Timer RC 14.3.1 Overview Timer 16-bit timer with four I/O pins. Timer RC uses either f1 or fOCO40M as its operation clock. Table 14.11 lists the Timer RC Operation Clock. Table 14.11 ...