NEC PD78056F Bedienungsanleitung

1
2
3
4
5
6
7
8
9
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
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593

Zur Seite of

Richtige Gebrauchsanleitung

Die Vorschriften verpflichten den Verkäufer zur Übertragung der Gebrauchsanleitung NEC PD78056F an den Erwerber, zusammen mit der Ware. Eine fehlende Anleitung oder falsche Informationen, die dem Verbraucher übertragen werden, bilden eine Grundlage für eine Reklamation aufgrund Unstimmigkeit des Geräts mit dem Vertrag. Rechtsmäßig lässt man das Anfügen einer Gebrauchsanleitung in anderer Form als Papierform zu, was letztens sehr oft genutzt wird, indem man eine grafische oder elektronische Anleitung von NEC PD78056F, sowie Anleitungsvideos für Nutzer beifügt. Die Bedingung ist, dass ihre Form leserlich und verständlich ist.

Was ist eine Gebrauchsanleitung?

Das Wort kommt vom lateinischen „instructio”, d.h. ordnen. Demnach kann man in der Anleitung NEC PD78056F die Beschreibung der Etappen der Vorgehensweisen finden. Das Ziel der Anleitung ist die Belehrung, Vereinfachung des Starts, der Nutzung des Geräts oder auch der Ausführung bestimmter Tätigkeiten. Die Anleitung ist eine Sammlung von Informationen über ein Gegenstand/eine Dienstleistung, ein Hinweis.

Leider widmen nicht viele Nutzer ihre Zeit der Gebrauchsanleitung NEC PD78056F. Eine gute Gebrauchsanleitung erlaubt nicht nur eine Reihe zusätzlicher Funktionen des gekauften Geräts kennenzulernen, sondern hilft dabei viele Fehler zu vermeiden.

Was sollte also eine ideale Gebrauchsanleitung beinhalten?

Die Gebrauchsanleitung NEC PD78056F sollte vor allem folgendes enthalten:
- Informationen über technische Daten des Geräts NEC PD78056F
- Den Namen des Produzenten und das Produktionsjahr des Geräts NEC PD78056F
- Grundsätze der Bedienung, Regulierung und Wartung des Geräts NEC PD78056F
- Sicherheitszeichen und Zertifikate, die die Übereinstimmung mit entsprechenden Normen bestätigen

Warum lesen wir keine Gebrauchsanleitungen?

Der Grund dafür ist die fehlende Zeit und die Sicherheit, was die bestimmten Funktionen der gekauften Geräte angeht. Leider ist das Anschließen und Starten von NEC PD78056F zu wenig. Eine Anleitung beinhaltet eine Reihe von Hinweisen bezüglich bestimmter Funktionen, Sicherheitsgrundsätze, Wartungsarten (sogar das, welche Mittel man benutzen sollte), eventueller Fehler von NEC PD78056F und Lösungsarten für Probleme, die während der Nutzung auftreten könnten. Immerhin kann man in der Gebrauchsanleitung die Kontaktnummer zum Service NEC finden, wenn die vorgeschlagenen Lösungen nicht wirksam sind. Aktuell erfreuen sich Anleitungen in Form von interessanten Animationen oder Videoanleitungen an Popularität, die den Nutzer besser ansprechen als eine Broschüre. Diese Art von Anleitung gibt garantiert, dass der Nutzer sich das ganze Video anschaut, ohne die spezifizierten und komplizierten technischen Beschreibungen von NEC PD78056F zu überspringen, wie es bei der Papierform passiert.

Warum sollte man Gebrauchsanleitungen lesen?

In der Gebrauchsanleitung finden wir vor allem die Antwort über den Bau sowie die Möglichkeiten des Geräts NEC PD78056F, über die Nutzung bestimmter Accessoires und eine Reihe von Informationen, die erlauben, jegliche Funktionen und Bequemlichkeiten zu nutzen.

Nach dem gelungenen Kauf des Geräts, sollte man einige Zeit für das Kennenlernen jedes Teils der Anleitung von NEC PD78056F widmen. Aktuell sind sie genau vorbereitet oder übersetzt, damit sie nicht nur verständlich für die Nutzer sind, aber auch ihre grundliegende Hilfs-Informations-Funktion erfüllen.

Inhaltsverzeichnis der Gebrauchsanleitungen

  • Seite 1

    User’s Manual Printed in Japan © µ PD78058F , 78058FY Subseries 8-Bit Single-Chip Microcontrollers µ PD78056F µ PD78058F µ PD78P058F µ PD78058F(A) µ PD78056FY µ PD78058FY µ PD78P058FY µ PD78058FY(A) Document No. U12068EJ2V0UM00 (2nd edition) Date Published April 1998 N CP (K) 1997[...]

  • Seite 2

    2 [MEMO][...]

  • Seite 3

    3 NOTES FOR CMOS DEVICES 1 PRECAUTION AGAINST ESD FOR SEMICONDUCTORS Note: Strong electric field, when exposed to a MOS device, can cause destruction of the gate oxide and ultimately degrade the device operation. Steps must be taken to stop generation of static electricity as much as possible, and quickly dissipate it once, when it has occurred. En[...]

  • Seite 4

    4 The export of this product from Japan is regulated by the Japanese government. To export this product may be prohibited without governmental license, the need for which must be judged by the customer. The export or re-export of this product from a country other than Japan may also be prohibited without a license from that country. Please call an [...]

  • Seite 5

    5 NEC Electronics Inc. (U.S.) Santa Clara, California Tel: 408-588-6000 800-366-9782 Fax: 408-588-6130 800-729-9288 NEC Electronics (Germany) GmbH Duesseldorf, Germany Tel: 0211-65 03 02 Fax: 0211-65 03 490 NEC Electronics (UK) Ltd. Milton Keynes, UK Tel: 01908-691-133 Fax: 01908-670-290 NEC Electronics Italiana s.r.1. Milano, Italy Tel: 02-66 75 4[...]

  • Seite 6

    6 MAJOR REVISIONS IN THIS EDITION Page Major Revision from Previous Edition Throughout The following products have already been developed: µ PD78056FGC- ××× -8BT, 78058FGC- ××× -8BT, 78P058FGC-8BT, 78056FYGC- ××× -8BT, 78058FYGC- ××× -8BT P133 to The block diagrams of the following ports were changed. P137, P143 Figures 6-5 and 6-7 P20[...]

  • Seite 7

    7 PREFACE Readers This manual has been prepared for user engineers who want to understand the functions of the µ PD78058F and 78058FY Subseries and design and develop its application systems and programs. Affected versions are each of the versions in the following Subseries. µ PD78058F Subseries : µ PD78056F, 78058F, 78P058F, 78058F(A) µ PD7805[...]

  • Seite 8

    8 How to Read This Manual Before reading this manual, you should have general knowledge of electric and logic circuits and microcontrollers. For persons who use this manual as the manual for the µ PD78058F(A) and 78058FY(A), → The µ PD78058F and 78058FY differ from the µ PD78058F(A) and 78058FY(A) only in their quality grades. For products wit[...]

  • Seite 9

    9 Chapter Organization This manual divides the descriptions for the µ PD78058F and 78058FY Subseries into different chapters as shown below. Read only the chapters related to the device you use. Chapter µ PD78058F Subseries µ PD78058FY Subseries Chapter 1 Outline ( µ PD78058F Subseries) √ — Chapter 2 Outline ( µ PD78058FY Subseries) — ?[...]

  • Seite 10

    10 Differences between µ PD78058F and µ PD78058FY Subseries: The µ PD78058F and µ PD78058FY Subseries are different in the following functions of the serial interface channel 0. Modes of Serial Interface Channel 0 µ PD78058F µ PD78058FY Subseries Subseries 3-wire serial I/O mode √√ 2-wire serial I/O mode √√ SBI (serial bus interface) [...]

  • Seite 11

    11 Related Documents The related documents indicated in this publication may include preliminary versions. However, preliminary versions are not marked as such. Related Documents for µ PD78058F Subseries Document Name Document No. Japanese English µ PD78056F, 78058F Data Sheet U11795J U11795E µ PD78P058F Data Sheet U11796J U11796E µ PD78058F(A)[...]

  • Seite 12

    12 Development Tool Documents (User’s Manuals) Document Name Document No. Japanese English RA78K0 Assembler Package Operation U11802J U11802E Assembly language U11801J U11801E Structured assembler language U11789J U11789E RA78K Series Structured Assembler Preprocessor U12323J EEU-1402 CC78K0 C Compiler Operation U11517J U11517E Language U11518J U[...]

  • Seite 13

    13 Documents for Embedded Software (User’s Manual) Document Name Document No. Japanese English 78K/0 Series Real-Time OS Basics U11537J U11537E Installation U11536J U11536E OS for 78K/0 Series MX78K0 Basics U12257J U12257E Other Documents Document Name Document No. Japanese English IC PACKAGE MANUAL C10943X Semiconductor Device Mounting Technolog[...]

  • Seite 14

    14 [MEMO][...]

  • Seite 15

    15 CONTENTS CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) ............................................................................. 35 1.1 Features .................................................................................................................................. 35 1.2 Applications ..................................................[...]

  • Seite 16

    16 3.2.14 A V SS .............................................................................................................................................. 71 3.2.15 RESET ......................................................................................................................................... 71 3.2.16 X1 and X2 ................[...]

  • Seite 17

    17 5.2.1 Control registers ........................................................................................................................... 103 5.2.2 General registers .......................................................................................................................... 106 5.2.3 Special Function Register (SFR) ......[...]

  • Seite 18

    18 7.4.2 Subsystem clock oscillator ........................................................................................................... 162 7.4.3 Scaler ........................................................................................................................................... 164 7.4.4 When no subsystem clocks are used .....[...]

  • Seite 19

    19 CHAPTER 11 WATCHDOG TIMER ..................................................................................................... . 245 11.1 Watchdog Timer Functions ................................................................................................ 245 11.2 Watchdog Timer Configuration ................................................[...]

  • Seite 20

    20 16.4.3 SBI mode operatio n ................................................................................................................ . 305 16.4.4 2-wire serial I/O mode operatio n ............................................................................................ . 331 16.4.5 SCK0/P27 pin output manipulatio n ....................[...]

  • Seite 21

    21 21.2 Interrupt Sources and Configuration ................................................................................. 478 21.3 Interrupt Function Control Registers ................................................................................. 482 21.4 Interrupt Servicing Operations ........................................................[...]

  • Seite 22

    22 26.3.3 PROM read procedur e ........................................................................................................... . 546 26.4 Screening of One-Time PROM Version s .......................................................................... . 547 CHAPTER 27 INSTRUCTION SE T ......................................................[...]

  • Seite 23

    23 LIST OF FIGURES (1/8) Figure No. Title Page 3-1 List of Pin Input/Output Circuit .......................................................................................................... 75 4-1 List of Pin Input/Output Circuit .......................................................................................................... 93 5-1 Memor[...]

  • Seite 24

    24 LIST OF FIGURES (2/8) Figure No. Title Page 7-4 Oscillation Mode Selection Register Format .................................................................................. ... 159 7-5 Main System Clock W aveform due to Writing to OSMS ................................................................... 160 7-6 External Circuit of Main System Cl[...]

  • Seite 25

    25 LIST OF FIGURES (3/8) Figure No. Title Page 8-31 Control Register Settings for One-Shot Pulse Output Operation Using Software T rigger ................ 204 8-32 T iming of One-Shot Pulse Output Operation Using Software T rigger ............................................... 205 8-33 Control Register Settings for One-Shot Pulse Output Operation [...]

  • Seite 26

    26 LIST OF FIGURES (4/8) Figure No. Title Page 14-1 A/D Converter Block Diagram ........................................................................................................... 263 14-2 A/D Converter Mode Register Format .............................................................................................. 266 14-3 A/D Converter [...]

  • Seite 27

    27 LIST OF FIGURES (5/8) Figure No. Title Page 16-27 Address T ransmission from Master Device to Slave Device (WUP = 1) .......................................... 325 16-28 Command T ransmission from Master Device to Slave Device ......................................................... 326 16-29 Data T ransmission from Master Device to Slave Devic[...]

  • Seite 28

    28 LIST OF FIGURES (6/8) Figure No. Title Page 18-5 Automatic Data T ransmit/Receive Interval Specify Register Format ................................................ 395 18-6 3-Wire Serial I/O Mode T imings ........................................................................................................ 401 18-7 Circuit of Switching in T ra[...]

  • Seite 29

    29 LIST OF FIGURES (7/8) Figure No. Title Page 20-4 Real-time Output Port Mode Register Format ................................................................................. . 474 20-5 Real-time Output Port Control Register Format .............................................................................. .. 475 21-1 Basic Configuration of In[...]

  • Seite 30

    30 25-1 Block Diagram of ROM Correction ................................................................................................... 527 25-2 Correction Address Registers 0 and 1 Format ................................................................................ .. 528 25-3 Correction Control Register Format .............................[...]

  • Seite 31

    31 1-1 Differences Between the µ PD78058F and µ PD78058F(A) .............................................................. 45 1-2 Mask Options of Mask POM V ersions .............................................................................................. 46 2-1 Differences Between the µ PD78058FY and µ PD78058FY(A) ........................[...]

  • Seite 32

    32 LIST OF TABLES (2/3) Table No. Title Page 9-10 Square-W ave Output Ranges When 2-Channel 8-Bit T imer/Event Counters (TM1 and TM2) are Used as 16-Bit T imer/Event Counter ................................................................ 234 10-1 Interval T imer Interval T ime .......................................................................[...]

  • Seite 33

    33 LIST OF TABLES (3/3) Table No. Title Page 20-2 Operation in Real-time Output Buffer Register Manipulation ............................................................ 473 20-3 Real-time Output Port Operating Mode and Output T rigger ............................................................. 475 21-1 Interrupt Source List .....................[...]

  • Seite 34

    34 [MEMO][...]

  • Seite 35

    35 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) 1.1 Features Compared to the conventional µ PD78054 Subseries, EMI (Electro Magnetic Interference) noise has been reduced. On-chip high-capacity ROM and RAM Program Memory (ROM) Part Number Item µ PD78056F µ PD78058F µ PD78P058F 48 Kbytes 60 Kbytes 60 Kbytes Note 1 Internal High-Speed RAM Internal B[...]

  • Seite 36

    36 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) 1.2 Applications In the case of the µ PD78056F, 78058F and 78P058F, Cellular phones, pagers, printers, AV equipment, air conditioners, cameras, PPC’s, fuzzy home appliances, vending machines, etc. In the case of the µ PD78058F (A), Controllers for car electronics, gas detection and shut-off devices,[...]

  • Seite 37

    37 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) 1.4 Quality Grade Part Number Package Quality Grade µ PD78056FGC- ××× -3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Standard µ PD78056FGC- ××× -8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Standard µ PD78058FGC- ××× -3B9 80-pin plastic QFP (14 × 14 mm, Resi[...]

  • Seite 38

    38 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) 1.5 Pin Configuration (Top View) (1) Normal operating mode 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) µ PD78056FGC- ××× -3B9, 78058FGC- ××× -3B9, 78058FGC(A)- ××× -3B9, 78P058FGC-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) µ PD78056FGC- ××× -8BT, 78058FGC- [...]

  • Seite 39

    39 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) Pin Identifications A8 to A15 : Address Bus AD0 to AD7 : Address/Data Bus ANI0 to ANI7 : Analog Input ANO0, ANO1 : Analog Output ASCK : Asynchronous Serial Clock ASTB : Address Strobe AV DD : Analog Power Supply AV REF0, 1 : Analog Reference Voltage AV SS : Analog Ground BUSY : Busy BUZ : Buzzer Clock I[...]

  • Seite 40

    40 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) (2) PROM programming mode 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) µ PD78P058FGC-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) µ PD78P058FGC-8BT Cautions 1. (L) : Connect independently to V SS via a pull-down resistor. 2. V SS : Connect to the ground. 3. RESET : Set to[...]

  • Seite 41

    41 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) 1.6 78K/0 Series Expansion The 78K/0 Series expansion is shown below. The names in frames are subseries. Note Under planning PD780964 PD78098 80-pin IEBus controller was added to the PD78054 PD78044F 80-pin Basic subseries for driving FIP. Display output total: 34 PD78014 PD780001 PD78002 PD78083 PD7800[...]

  • Seite 42

    42 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) The differences between the major functions of each subseries are shown below. Function ROM Timer 8-bit 10-bit 8-bit Serial Interface I/O V DD External Subseries Capacity 8-bit 16-bit Watch WDT A/D A/D D/A MIN. value extension Control µ PD78075B 32 K to 40 K 4 ch 1 ch 1 ch 1 ch 8 ch — 2 ch 3 ch (UART[...]

  • Seite 43

    43 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) 1.7 Block Diagram Remarks 1. The internal ROM and RAM capacities depend on the product. 2. Pin connection in parentheses is intended for the µ PD78P058F. 16-bit TIMER/ EVENT COUNTER 8-bit TIMER/ EVENT COUNTER 1 WATCHDOG TIMER WATCH TIMER SERIAL INTERFACE 0 SERIAL INTERFACE 1 SERIAL INTERFACE 2 A/D CONV[...]

  • Seite 44

    44 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) 1.8 Outline of Function ROM Mask ROM PROM 48 Kbytes 60 Kbytes 60 Kbytes Note 1 High-speed RAM 1024 bytes 1024 bytes Note 1 Buffer RAM 32 bytes Expansion RAM None 1024 bytes 1024 bytes Note 2 Memory space 64 Kbytes General register 8 bits × 8 × 4 banks With main system clock selected 0.4 µ s/0.8 µ s/[...]

  • Seite 45

    45 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) Buzzer output 1.2 kHz, 2.4 kHz, 4.9 KHz, 9.8 kHz (main system clock at 5.0-MHz operation) Vectored Maskable Internal: 13 interrupt External: 7 sources Non-maskable Internal: 1 Software 1 Test input Internal: 1 External: 1 Supply voltage V DD = 2.7 to 6.0 V Operating ambient temperature T A = –40 to +8[...]

  • Seite 46

    46 CHAPTER 1 OUTLINE ( µ PD78058F SUBSERIES) 1.10 Mask Options There are mask options in the mask ROM versions ( µ PD78056F, 78058F). By specifying the mask option when ordering, you can have the pull-up resistors shown in Table 1-2 incorporated on-chip. If a mask option is used when pull-up resistors are required, the number of parts can be redu[...]

  • Seite 47

    47 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) 2.1 Features Compared to the conventional µ PD78054Y Subseries, EMI (Electro Magnetic Interference) noise has been reduced. On-chip high-capacity ROM and RAM Notes 1. The capacities of internal PROM and internal high-speed RAM can be changed by means of the memory size switching register (IMS). 2. The[...]

  • Seite 48

    48 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) 2.2 Applications In the case of the µ PD78056FY, 78058FY and 78P058FY, Cellular phones, pagers, printers, AV equipment, air conditioners, cameras, PPCs, fuzzy home appliances, vending machines, etc. In the case of the µ PD78058FY (A), Controllers for car electronics, gas detection and shut-off device[...]

  • Seite 49

    49 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) 2.4 Quality Grade Part Number Package Quality Grade µ PD78056FYGC- ××× -3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) Standard µ PD78056FYGC- ××× -8BT 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) Standard µ PD78058FYGC- ××× -3B9 80-pin plastic QFP (14 × 14 mm, [...]

  • Seite 50

    50 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) 2.5 Pin Configuration (Top View) (1) Normal operating mode 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) µ PD78056FYGC- ××× -3B9, 78058FYGC- ××× -3B9, 78058FYGC(A)- ××× -3B9, µ PD78P058FYGC-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) µ PD78056FYGC- ××× -8BT,[...]

  • Seite 51

    51 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) Pin Identifications A8 to A15 : Address Bus AD0 to AD7 : Address/Data Bus ANI0 to ANI7 : Analog Input ANO0, ANO1 : Analog Output ASCK : Asynchronous Serial Clock ASTB : Address Strobe AV DD : Analog Power Supply AV REF0, 1 : Analog Reference Voltage AV SS : Analog Ground BUSY : Busy BUZ : Buzzer Clock [...]

  • Seite 52

    52 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) (2) PROM programming mode 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) µ PD78P058FYGC-3B9 80-pin plastic QFP (14 × 14 mm, Resin thickness: 1.4 mm) µ PD78P058FYGC-8BT Note Note Under development Cautions 1. (L) : Connect independently to V SS via a pull-down resistor. 2. V SS : Connect t[...]

  • Seite 53

    53 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) 2.6 78K/0 Series Expansion The 78K/0 Series expansion is shown below. The names in frames are subseries. Note Under planning PD780964 PD78098 80-pin IEBus controller was added to the PD78054 PD78044F 80-pin Basic subseries for driving FIP. Display output total: 34 PD78014 PD780001 PD78002 PD78083 PD780[...]

  • Seite 54

    54 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) The differences between the major functions of each subseries are shown below. Function ROM Serial Interface I/O V DD Subseries Capacity MIN. Value Control µ PD78078Y 48 K to 60 K 3-wire/2-wire/I 2 C : 1 ch 88 1.8 V µ PD78070AY — 3-wire with automatic send/receive function. : 1 ch 61 2.7 V 3-wire/U[...]

  • Seite 55

    55 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) 2.7 Block Diagram Remarks 1. The internal ROM and RAM capacities depend on the product. 2. Pin connection in parentheses is intended for the µ PD78P058FY. 16-bit TIMER/ EVENT COUNTER 8-bit TIMER/ EVENT COUNTER 1 WATCHDOG TIMER WATCH TIMER SERIAL INTERFACE 0 SERIAL INTERFACE 1 SERIAL INTERFACE 2 A/D CO[...]

  • Seite 56

    56 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) 2.8 Outline of Function ROM Mask ROM PROM 48 Kbytes 60 Kbytes 60 Kbytes Note 1 High-speed RAM 1024 bytes 1024 bytes Note 1 Buffer RAM 32 bytes Expansion RAM None 1024 bytes 1024 bytes Note 2 Memory space 64 Kbytes General register 8 bits × 8 × 4 banks With main system clock selected 0.4 µ s/0.8 µ s[...]

  • Seite 57

    57 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) Vectored Maskable Internal: 13 interrupt External: 7 sources Non-maskable Internal: 1 Software 1 Test input Internal: 1 External: 1 Supply voltage V DD = 2.7 to 6.0 V Operating ambient temperature T A = –40 to +85 ° C Package • 80-pin plastic QFP (14 × 14 mm, Resin thickness: 2.7 mm) • 80-pin p[...]

  • Seite 58

    58 CHAPTER 2 OUTLINE ( µ PD78058FY SUBSERIES) 2.10 Mask Options The mask ROM versions ( µ PD78056FY, 78058FY) provide pull-up resistor mask options which allow users to specify whether to connect a pull-up resistor to a specific port pin when the user places an order for the device production. Using this mask option when pull-up resistors are req[...]

  • Seite 59

    59 Pin Name Input/Output Function After Reset Alternate Function P00 Input Port 0. Input only Input INTP0/TI00 P01 Input/ 8-bit input/output port. Input/output mode can be specified Input INTP1/TI01 P02 output bit-wise. INTP2 P03 If used as an input port, an on-chip INTP3 P04 pull-up resistor can be used by INTP4 P05 software. INTP5 P06 INTP6 P07 N[...]

  • Seite 60

    60 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) (1) Port pins (2/3) Pin Name Input/Output Function After Reset Alternate Function P30 Input/ Port 3. Input TO0 P31 output 8-bit input/output port. TO1 P32 Input/output mode can be specified bit-wise. TO2 P33 If used as an input port, an on-chip pull-up resistor can be used by TI1 P34 software. TI2 [...]

  • Seite 61

    61 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) (1) Port pins (3/3) Pin Name Input/Output Function After Reset Alternate Function P120 to P127 Input/ Port 12. Input RTP0 to RTP7 output 8-bit input/output port. Input/output mode can be specified bit-wise. If used as an input port, an on-chip pull-up resistor can be used by software. P130, P131 In[...]

  • Seite 62

    62 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) (2) Non-port pins (1/2) Pin Name Input/Output Function After Reset Alternate Function INTP0 Input External interrupt request inputs with specifiable valid edges (rising Input P00/TI00 INTP1 edge, falling edge, both rising and falling edges). P01/TI01 INTP2 P02 INTP3 P03 INTP4 P04 INTP5 P05 INTP6 P0[...]

  • Seite 63

    63 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) (2) Non-port pins (2/2) Pin Name Input/Output Function After Reset Alternate Function AD0 to AD7 Input/Output Low-order address/data bus when expanding external memory Input P40 to P47 A8 to A15 Output High-order address bus when expanding external memory Input P50 to P57 RD Strobe signal output fo[...]

  • Seite 64

    64 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) 3.1.2 PROM programming mode pins (PROM versions only) Pin Name Input/Output Function RESET Input PROM programming mode setting. When +5 V or +12.5 V is applied to the V PP pin or a low level voltage is applied to the RESET pin, the PROM programming mode is set. V PP Input High-voltage application f[...]

  • Seite 65

    65 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) 3.2 Description of Pin Functions 3.2.1 P00 to P07 (Port 0) These are 8-bit input/output ports. Besides serving as input/output ports, they function as an external interrupt request input, an external count clock input to the timer, a capture trigger signal input, and crystal connection for subsyste[...]

  • Seite 66

    66 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) 3.2.2 P10 to P17 (Port 1) These are 8-bit input/output ports. Besides serving as input/output ports, they function as an A/D converter analog input. The following operating modes can be specified bit-wise. (1) Port mode These ports function as 8-bit input/output ports. They can be specified bit-wis[...]

  • Seite 67

    67 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) (d) BUSY Serial interface automatic transmit/receive busy input pins (e) STB Serial interface automatic transmit/receive strobe output pins Caution When this port is used as a serial interface pin, the I/O and output latches must be set according to the function the user requires. For the setting, [...]

  • Seite 68

    68 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) 3.2.5 P40 to P47 (Port 4) These are 8-bit input/output ports. Besides serving as input/output ports, they function as an address/data bus. The test input flag (KRIF) can be set to 1 by detecting a falling edge. The following operating mode can be specified in 8-bit units. (1) Port mode These ports [...]

  • Seite 69

    69 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) (1) Port mode These ports function as 8-bit input/output ports. They can be specified bit-wise as input or output ports with port mode register 6 (PM6). P60 to P63 are N-ch open drain outputs. Mask ROM version can contain pull-up resistors with the mask option. When P64 to P67 are used as input por[...]

  • Seite 70

    70 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) 3.2.9 P120 to P127 (Port 12) These are 8-bit input/output ports. Besides serving as input/output ports, they function as a real-time output port. The following operating modes can be specified bit-wise. (1) Port mode These ports function as 8-bit input/output ports. They can be specified bit-wise a[...]

  • Seite 71

    71 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) 3.2.13 AV DD This is the analog power supply pin of the A/D converter and the port’s power supply pin. Always use the same voltage as that of the V DD pin even when the A/D converter is not used. 3.2.14 AV SS This is the ground potential pin for the A/D converter and D/A converter, and the ground[...]

  • Seite 72

    72 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) 3.2.21 IC (Mask ROM version only) The IC (Internally Connected) pin is provided to set the test mode to check the µ PD78058F Subseries at delivery. Connect it directly to the V SS with the shortest possible wire in the normal operating mode. When a voltage difference is produced between the IC pin[...]

  • Seite 73

    73 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) Pin Name Input/Output Input/Output Recommended Connection of Unused Pins Circuit Type P00/INTP0/TI00 2 Input Connect to V SS . P01/INTP1/TI01 8-D Input/output Connect independently via a resistor to V SS. P02/INTP2 P03/INTP3 P04/INTP4 P05/INTP5 P06/INTP6 P07/XT1 16 Input Connect to V DD . P10/ANI0 [...]

  • Seite 74

    74 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) Table 3-1. Pin Input/Output Circuit Types (2/2) Pin Name Input/Output Input/Output Recommended Connection of Unused Pins Circuit Type P60 to P63 (Mask ROM version) 13-I Input/output Connect independently via a resistor to V DD . P60 to P63 (PROM version) 13-H P64/RD 5-D Input/output Connect indepen[...]

  • Seite 75

    75 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) Figure 3-1. List of Pin Input/Output Circuit (1/2) IN pull-up enable AV DD P-ch IN/OUT input enable output disable data AV DD P-ch N-ch Type 2 Type 5-J Schmitt-Triggered Input with Hysteresis Characteristics Type 5-O Type 11-C Type 10-C Type 8-D pull-up enable AV DD P-ch IN/OUT output disable data [...]

  • Seite 76

    76 CHAPTER 3 PIN FUNCTION ( µ PD78058F SUBSERIES) Figure 3-1. List of Pin Input/Output Circuit (2/2) Type 12-B Type 13-H Type 13-I output disable AV DD N-ch IN/OUT RD medium breakdown input buffer data P-ch XT2 XT1 feedback cut-off P-ch Type 16 output disable AV DD AV DD N-ch Mask Option IN/OUT RD medium breakdown input buffer data P-ch pullup ena[...]

  • Seite 77

    77 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) 4.1 Pin Function List 4.1.1 Normal operating mode pins (1) Port pins (1/3) Pin Name Input/Output Function After Reset Alternate Function P00 Input Port 0. Input only Input INTP0/TI00 P01 Input/ 8-bit input/output port. Input/output mode can be specified Input INTP1/TI01 P02 output bit-wise. INTP2 [...]

  • Seite 78

    78 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) N-ch open drain input/output port. On-chip pull-up resistor can be specified by mask option. (Mask ROM version only). LEDs can be driven directly. (1) Port pins (2/3) Pin Name Input/Output Function After Reset Alternate Function P30 Input/ Port 3. Input TO0 P31 output 8-bit input/output port. TO1 [...]

  • Seite 79

    79 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) (1) Port pins (3/3) Pin Name Input/Output Function After Reset Alternate Function P120 to P127 Input/ Port 12. Input RTP0 to RTP7 output 8-bit input/output port. Input/output mode can be specified bit-wise. If used as an input port, an on-chip pull-up resistor can be used by software. P130 to P131[...]

  • Seite 80

    80 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) (2) Non-port pins (1/2) Pin Name Input/Output Function After Reset Alternate Function INTP0 Input External interrupt request inputs with specifiable valid edges (rising Input P00/TI00 INTP1 edge, falling edge, both rising and falling edges). P01/TI01 INTP2 P02 INTP3 P03 INTP4 P04 INTP5 P05 INTP6 P[...]

  • Seite 81

    81 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) (2) Non-port pins (2/2) Pin Name Input/Output Function After Reset Alternate Function AD0 to AD7 Input/Output Low-order address/data bus when expanding external memory Input P40 to P47 A8 to A15 Output High-order address bus when expanding external memory Input P50 to P57 RD Output Strobe signal o[...]

  • Seite 82

    82 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) 4.1.2 PROM programming mode pins (PROM versions only) Pin Name Input/Output Function RESET Input PROM programming mode setting. When +5 V or +12.5 V is applied to the V PP pin or a low level voltage is applied to the RESET pin, the PROM programming mode is set. V PP Input High-voltage application [...]

  • Seite 83

    83 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) 4.2 Description of Pin Functions 4.2.1 P00 to P07 (Port 0) These are 8-bit input/output ports. Besides serving as input/output ports, they function as an external interrupt request input, an external count clock input to the timer, a capture trigger signal input, and crystal connection for subsyst[...]

  • Seite 84

    84 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) 4.2.2 P10 to P17 (Port 1) These are 8-bit input/output ports. Besides serving as input/output ports, they function as an A/D converter analog input. The following operating modes can be specified bit-wise. (1) Port mode These ports function as 8-bit input/output ports. They can be specified bit-wi[...]

  • Seite 85

    85 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) 4.2.4 P30 to P37 (Port 3) These are 8-bit input/output ports. Beside serving as input/output ports, they function as timer input/output, clock output, and buzzer output. The following operating modes can be specified bit-wise. (1) Port mode These ports function as 8-bit input/output ports. They ca[...]

  • Seite 86

    86 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) 4.2.5 P40 to P47 (Port 4) These are 8-bit input/output ports. Besides serving as input/output ports, they function as an address/data bus. The test input flag (KRIF) can be set to 1 by detecting a falling edge. The following operating mode can be specified in 8-bit units. (1) Port mode These ports[...]

  • Seite 87

    87 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) 4.2.8 P70 to P72 (Port 7) This is a 3-bit input/output port. In addition to its use as an input/output port, it also has serial interface data input/ output and clock input/output functions. The following operating modes can be specified bit-wise. (1) Port mode Port 7 functions as a 3-bit input/ou[...]

  • Seite 88

    88 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) 4.2.9 P120 to P127 (Port 12) These are 8-bit input/output ports. Besides serving as input/output ports, they function as a real-time output port. The following operating modes can be specified bit-wise. (1) Port mode These ports function as 8-bit input/output ports. They can be specified bit-wise [...]

  • Seite 89

    89 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) 4.2.13 AV DD This is the analog power supply pin of the A/D converter and the port’s power supply pin. Always use the same voltage as that of the V DD pin even when the A/D converter is not used. 4.2.14 AV SS This is the ground potential pin for the A/D converter and D/A converter, and the groun[...]

  • Seite 90

    90 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) V SS IC As short as possible 4.2.21 IC (Mask ROM version only) The IC (Internally Connected) pin is provided to set the test mode to check the µ PD78058FY Subseries at delivery. Connect it directly to the V SS with the shortest possible wire in the normal operating mode. When a voltage difference[...]

  • Seite 91

    91 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) Pin Name Input/Output Input/Output Recommended Connection of Unused Pins Circuit Type P00/INTP0/TI00 2 Input Connect to V SS . P01/INTP1/TI01 8-D Input/output Connect independently via a resistor to V SS. P02/INTP2 P03/INTP3 P04/INTP4 P05/INTP5 P06/INTP6 P07/XT1 16 Input Connect to V DD P10/ANI0 t[...]

  • Seite 92

    92 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) Table 4-1. Pin Input/Output Circuit Types (2/2) Pin Name Input/Output Input/Output Recommended Connection of Unused Pins Circuit Type P60 to P63 (Mask ROM version) 13-I Input/output Connect independently via a resistor to V DD . P60 to P63 (PROM version) 13-H Input/output Connect independently via[...]

  • Seite 93

    93 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) Figure 4-1. List of Pin Input/Output Circuit (1/2) IN pullup enable AV DD P-ch IN/OUT input enable output disable data AV DD P-ch N-ch Type 2 Type 5-J Schmitt-Triggered Input with Hysteresis Characteristics Type 5-O Type 11-C Type 10-C Type 8-D pullup enable AV DD P-ch IN/OUT output disable data A[...]

  • Seite 94

    94 CHAPTER 4 PIN FUNCTION ( µ PD78058FY SUBSERIES) Figure 4-1. List of Pin Input/Output Circuit (2/2) Type 12-B Type 13-H Type 13-I output disable AV DD N-ch IN/OUT RD medium breakdown input buffer data P-ch XT2 XT1 feedback cut-off P-ch Type 16 output disable AV DD AV DD N-ch Mask Option IN/OUT RD medium breakdown input buffer data P-ch pullup en[...]

  • Seite 95

    95 CHAPTER 5 CPU ARCHITECTURE 5.1 Memory Spaces 64-Kbyte memory spaces can be accessed in the µ PD78058F, 78058FY Subseries. Figures 5-1 to 5-3 show memory maps. Figure 5-1. Memory Map ( µ PD78056F, 78056FY) 0000H Data memory space General Registers 32 × 8 bits Internal ROM 49152 × 8 bits BFFFH 1000H 0FFFH 0800H 07FFH 0080H 007FH 0040H 003FH 00[...]

  • Seite 96

    96 CHAPTER 5 CPU ARCHITECTURE Figure 5-2. Memory Map ( µ PD78058F, 78058FY) Note When internal ROM size is 60 Kbytes, the area F000H to F3FFH cannot be used. F000H to F3FFH can be used as external memory by setting the internal ROM size to less than 56 Kbytes by the memory size switching register (IMS). 0000H Data memory space General Registers 32[...]

  • Seite 97

    97 CHAPTER 5 CPU ARCHITECTURE Figure 5-3. Memory Map ( µ PD78P058F, µ PD78P058FY) Note When internal PROM size is 60 Kbytes, the area F000H to F3FFH cannot be used. F000H to F3FFH can be used as external memory by setting the internal PROM size to less than 56 Kbytes by the memory size switching register (IMS). 0000H Data memory space General Reg[...]

  • Seite 98

    98 CHAPTER 5 CPU ARCHITECTURE 5.1.1 Internal program memory space The µ PD78056F and µ PD78056FY are Mask ROM with a 49152 x 8 bit configuration, the µ PD78058F and µ PD78058FY are Mask ROM with a 61440 x 8 bit configuration and the µ PD78P058F and µ PD78P058FY are PROM with a 61440 x 8 bit configuration. They store program and table data, et[...]

  • Seite 99

    99 CHAPTER 5 CPU ARCHITECTURE (2) CALLT instruction table area The 64-byte area 0040H to 007FH can store the subroutine entry address of a 1-byte call instruction (CALLT). (3) CALLF instruction entry area The area 0800H to 0FFFH can perform a direct subroutine call with a 2-byte call instruction (CALLF). 5.1.2 Internal data memory space The µ PD78[...]

  • Seite 100

    100 CHAPTER 5 CPU ARCHITECTURE 5.1.5 Data memory addressing The method to specify the address of the instruction to be executed next, or the address of a register or memory to be manipulated when an instruction is executed is called addressing. The address of the instruction to be executed next is addressed by the program counter PC (for details, r[...]

  • Seite 101

    101 CHAPTER 5 CPU ARCHITECTURE Figure 5-5. Data Memory Addressing ( µ PD78058F, 78058FY) Note When internal ROM size is 60 Kbytes, the area F000H to F3FFH cannot be used. F000H to F3FFH can be used as external memory by setting the internal ROM size to less than 56 Kbytes by the memory size switching register. 0000H General Registers 32 × 8 bits [...]

  • Seite 102

    102 CHAPTER 5 CPU ARCHITECTURE Figure 5-6. Data Memory Addressing ( µ PD78P058F, 78P058FY) Note When internal PROM size is 60 Kbytes, the area F000H to F3FFH cannot be used. F000H to F3FFH can be used as external memory by setting the internal PROM size to less than 56 Kbytes by the memory size switching register (IMS). 0000H General Registers 32 [...]

  • Seite 103

    103 CHAPTER 5 CPU ARCHITECTURE 5.2 Processor Registers The µ PD78058F and 78058FY Subseries units incorporate the following processor registers. 5.2.1 Control registers The control registers control the program sequence, statuses and stack memory. The control registers consist of a program counter (PC), a program status word (PSW) and a stack poin[...]

  • Seite 104

    104 CHAPTER 5 CPU ARCHITECTURE (a) Interrupt enable flag (IE) This flag controls the interrupt request acknowledge operations of the CPU. When IE = 0, all interrupts except non-maskable interrupt requests are disabled (DI status). When IE = 1, interrupts are enabled (EI status). At this time, acknowledgment of interrupts is controlled with an inser[...]

  • Seite 105

    105 CHAPTER 5 CPU ARCHITECTURE RETI and RETB Instruction PSW PC15-PC8 PC15-PC8 PC7-PC0 Register Pair Lower SP SP + 2 SP Register Pair Upper RET Instruction POP rp Instruction SP + 1 PC7-PC0 SP SP + 2 SP SP + 1 SP + 2 SP SP + 1 SP SP + 3 Interrupt and BRK Instruction PSW PC15-PC8 PC15-PC8 PC7-PC0 Register Pair Lower SP SP _ 2 SP _ 2 Register Pair Up[...]

  • Seite 106

    106 CHAPTER 5 CPU ARCHITECTURE 5.2.2 General registers A general register is mapped at particular addresses (FEE0H to FEFFH) of the data memory. It consists of 4 banks, each bank consisting of eight 8-bit registers (X, A, C, B, E, D, L and H). Each register can also be used as an 8-bit register. Two 8-bit registers can be used in pairs as a 16-bit [...]

  • Seite 107

    107 CHAPTER 5 CPU ARCHITECTURE Figure 5-12. General Register Configuration (a) Absolute Name (b) Function Name BANK0 BANK1 BANK2 BANK3 FEFFH FEF8H FEF7H FEE0H RP3 RP2 RP1 RP0 R7 15 0 7 0 R6 R5 R4 R3 R2 R1 R0 16-Bit Processing 8-Bit Processing FEE0H FEEFH FEE8H FEE7H BANK0 BANK1 BANK2 BANK3 FEFFH FEF8H FEF7H FEE0H HL DE BC AX H 15 0 7 0 L D E B C A [...]

  • Seite 108

    108 CHAPTER 5 CPU ARCHITECTURE 5.2.3 Special Function Register (SFR) Unlike a general register, each special-function register has special functions. It is allocated in the FF00H to FFFFH area. The special-function register can be manipulated like the general register, with the operation, transfer and bit manipulation instructions. Manipulatable bi[...]

  • Seite 109

    109 CHAPTER 5 CPU ARCHITECTURE Address Special-Function Register (SFR) Name Symbol R/W After Reset FF00H Port0 P0 R/W √√ — 00H FF01H Port1 P1 √√ — FF02H Port2 P2 √√ — FF03H Port3 P3 √√ — FF04H Port4 P4 √√ — Undefined FF05H Port5 P5 √√ — FF06H Port6 P6 √√ — FF07H Port7 P7 √√ — 00H FF0CH Port12 P12 √?[...]

  • Seite 110

    110 CHAPTER 5 CPU ARCHITECTURE Address Special-Function Register (SFR) Name Symbol R/W After Reset FF38H Correction address register 0 Note CORAD0 R/W —— √ 0000H FF39H FF3AH Correction address register 1 Note CORAD1 — — √ FF3BH FF40H Timer clock select register 0 TCL0 √√ — 00H FF41H Timer clock select register 1 TCL1 — √ — F[...]

  • Seite 111

    111 CHAPTER 5 CPU ARCHITECTURE IF0L IF0H MK0L MK0H PR0L PR0H Address Special-Function Register (SFR) Name Symbol R/W After Reset FFD0H to External access area Note 1 R/W √√ — Undefined FFDFH FFE0H Interrupt request flag register 0L √√ FFE1H Interrupt request flag register 0H √√ FFE2H Interrupt request flag register 1L IF1L √√ — [...]

  • Seite 112

    112 CHAPTER 5 CPU ARCHITECTURE 15 0 PC + 15 0 876 S 15 0 PC α jdisp8 When S = 0, all bits of α are 0. When S = 1, all bits of α are 1. PC indicates the start address of the instruction after the BR instruction. ... 5.3 Instruction Address Addressing An instruction address is determined by program counter (PC) contents. The contents of PC are nor[...]

  • Seite 113

    113 CHAPTER 5 CPU ARCHITECTURE 5.3.2 Immediate addressing [Function] Immediate data in the instruction word is transferred to the program counter (PC) and branched. This function is carried out when the CALL !addr16 or BR !addr16 or CALLF !addr11 instruction is executed. The CALL !addr16 and BR !addr16 instruction can branch in the entire memory sp[...]

  • Seite 114

    114 CHAPTER 5 CPU ARCHITECTURE 5.3.3 Table indirect addressing [Function] Table contents (branch destination address) of the particular location to be addressed by bits 1 to 5 of the immediate data of an operation code are transferred to the program counter (PC) and branched. Before the CALLT [addr5] instruction is executed, table indirect addressi[...]

  • Seite 115

    115 CHAPTER 5 CPU ARCHITECTURE 70 rp 07 AX 15 0 PC 87 5.3.4 Register addressing [Function] Register pair (AX) contents to be specified with an instruction word are transferred to the program counter (PC) and branched. This function is carried out when the BR AX instruction is executed. [Illustration][...]

  • Seite 116

    116 CHAPTER 5 CPU ARCHITECTURE 5.4 Operand Address Addressing The following various methods are available to specify the register and memory (addressing) which undergo manipulation during instruction execution. 5.4.1 Implied addressing [Function] The register which functions as an accumulator (A and AX) in the general register is automatically (ill[...]

  • Seite 117

    117 CHAPTER 5 CPU ARCHITECTURE 5.4.2 Register addressing [Function] This addressing accesses a general register as an operand. The general register accessed is specified by the register bank select flags (RBS0 and RBS1) and register specify code (Rn or RPn) in an instruction code. Register addressing is carried out when an instruction with the foll[...]

  • Seite 118

    118 CHAPTER 5 CPU ARCHITECTURE 5.4.3 Direct addressing [Function] This addressing directly addresses the memory indicated by the immediate data in an instruction word. [Operand format] Identifier Description addr16 Label or 16-bit immediate data [Description example] MOV A, !0FE00H; when setting !addr16 to FE00H Operation code 1000 1110 O P code 00[...]

  • Seite 119

    119 CHAPTER 5 CPU ARCHITECTURE 5.4.4 Short direct addressing [Function] The memory to be manipulated in the fixed space is directly addressed with 8-bit data in an instruction word. The fixed space to which this address is applied is a 256-byte space of addresses FE20H through FF1FH. An internal RAM and a special-function register (SFR) are mapped [...]

  • Seite 120

    120 CHAPTER 5 CPU ARCHITECTURE 15 0 Short Direct Memory Effective Address 1 111111 87 0 7 OP code saddr-offset α [Description example] MOV 0FE30H, #50H; when setting saddr to FE30H and immediate data to 50H Operation code 0001 0001 O P code 00110000 30H (saddr-offset) 01010000 50H (immediate data) [Illustration] When 8-bit immediate data is 20H to[...]

  • Seite 121

    121 CHAPTER 5 CPU ARCHITECTURE 15 0 SFR Effective Address 1 111111 87 0 7 OP code sfr-offset 1 5.4.5 Special-Function Register (SFR) addressing [Function] The memory-mapped special-function register (SFR) is addressed with 8-bit immediate data in an instruction word. This addressing is applied to the 240-byte spaces FF00H to FFCFH and FFE0H to FFFF[...]

  • Seite 122

    122 CHAPTER 5 CPU ARCHITECTURE 5.4.6 Register indirect addressing [Function] This addressing addresses the memory with the contents of a register pair specified as an operand. The register pair to be accessed is specified by the register bank select flags (RBS0 and RBS1) and register pair specify code in an instruction code. This addressing can be [...]

  • Seite 123

    123 CHAPTER 5 CPU ARCHITECTURE 5.4.7 Based addressing [Function] This addressing addresses the memory by adding 8-bit immediate data to the contents of the HL register pair which is used as a base register and by using the result of the addition. The HL register pair to be accessed is in the register bank specified by the register bank select flags[...]

  • Seite 124

    124 CHAPTER 5 CPU ARCHITECTURE 5.4.8 Based indexed addressing [Function] This addressing addresses the memory by adding the contents of the HL register, which is used as a base register, to the contents of the B or C register specified in the instruction word, and by using the result of the addition. The HL, B, and C registers to be accessed are re[...]

  • Seite 125

    125 CHAPTER 6 PORT FUNCTIONS 6.1 Port Functions The µ PD78058F and 78058FY Subseries units incorporate two input ports and sixty-seven input/output ports. Figure 6-1 shows the port configuration. Every port is capable of 1-bit and 8-bit manipulations and can carry out considerably varied control operations. Besides port functions, the ports can al[...]

  • Seite 126

    126 CHAPTER 6 PORT FUNCTIONS Pin Name Function Alternate Function P00 Port 0. Input only INTP0/TI00 P01 8-bit input/output port. Input/output mode can be specified INTP1/TI01 P02 bit-wise. INTP2 P03 If used as an input port, an on-chip pull-up INTP3 P04 resistor can be used by software. INTP4 P05 INTP5 P06 INTP6 P07 Input only XT1 P10 to P17 Port 1[...]

  • Seite 127

    127 CHAPTER 6 PORT FUNCTIONS P70 SI2/RxD P71 SO2/TxD P72 SCK2/ASCK P120 to P127 RTP0 to RTP7 P130 and P131 ANO0, ANO1 Table 6-1. Port Functions ( µ PD78058F Subseries) (2/2) Pin Name Function Alternate Function P60 Port 6. N-ch open-drain input/output port. — P61 8-bit input/output port. On-chip pull-up resistor can be specified by P62 Input/out[...]

  • Seite 128

    128 CHAPTER 6 PORT FUNCTIONS Table 6-2. Port Functions ( µ PD78058FY Subseries) (1/2) Pin Name Function Alternate Function P00 Port 0. Input only INTP0/TI00 P01 8-bit input/output port. Input/output mode can be specified INTP1/TI01 P02 bit-wise. INTP2 P03 If used as an input port, an on-chip pull-up INTP3 P04 resistor can be used by software. INTP[...]

  • Seite 129

    129 CHAPTER 6 PORT FUNCTIONS P120 to P127 RTP0 to RTP7 P130 and P131 ANO0, ANO1 P70 SI2/RxD P71 SO2/TxD P72 SCK2/ASCK Table 6-2. Port Functions ( µ PD78058FY Subseries) (2/2) Pin Name Function Alternate Function P60 Port 6. N-ch open drain input/output port. — P61 8-bit input/output port. On-chip pull-up resistor can be specified by P62 Input/ou[...]

  • Seite 130

    130 CHAPTER 6 PORT FUNCTIONS Control register 6.2 Port Configuration A port consists of the following hardware: Table 6-3. Port Configuration Item Configuration Port mode register (PMm: m = 0 to 3, 5 to 7, 12, 13) Pull-up resistor option register (PUOH, PUOL) Memory expansion mode register (MM) Note Key return mode register (KRM) Port Total: 69 por[...]

  • Seite 131

    131 CHAPTER 6 PORT FUNCTIONS P00/INTP0/TI00, P07/XT1 RD Internal bus Figure 6-2. P00 and P07 Block Diagram Figure 6-3. P01 to P06 Block Diagram PUO : Pull-up resistor option register PM : Port mode register RD : Port 0 read signal WR : Port 0 write signal P-ch WR PM WR PORT RD WR PUO AV DD P01/INTP1/TI01. P02/INTP2 to P06/INTP6 Selector PUO0 Output[...]

  • Seite 132

    132 CHAPTER 6 PORT FUNCTIONS 6.2.2 Port 1 Port 1 is an 8-bit input/output port with output latch. It can specify the input mode/output mode in 1-bit units with a port mode register 1 (PM1). When P10 to P17 pins are used as input ports, an on-chip pull-up resistor can be used to them in 8-bit units with a pull-up resistor option register L (PUOL). A[...]

  • Seite 133

    133 CHAPTER 6 PORT FUNCTIONS 6.2.3 Port 2 ( µ PD78058F Subseries) Port 2 is an 8-bit input/output port with output latch. P20 to P27 pins can specify the input mode/output mode in 1-bit units with the port mode register 2 (PM2). When P20 to P27 pins are used as input ports, an on-chip pull-up resistor can be used to them in 8-bit units with a pull[...]

  • Seite 134

    134 CHAPTER 6 PORT FUNCTIONS Figure 6-6. P22 and P27 Block Diagram PUO : Pull-up resistor option register PM : Port mode register RD : Port 2 read signal WR : Port 2 write signal P-ch WR PM WR PORT RD WR PUO AV DD Selector PUO2 Output Latch (P22, P27) PM22, PM27 Internal bus Alternate Function P22/SCK1, P27/SCK0[...]

  • Seite 135

    135 CHAPTER 6 PORT FUNCTIONS 6.2.4 Port 2 ( µ PD78058FY Subseries) Port 2 is an 8-bit input/output port with output latch. P20 to P27 pins can specify the input mode/output mode in 1-bit units with the port mode register 2 (PM2). When P20 to P27 pins are used as input ports, an on-chip pull-up resistor can be used to them in 8-bit units with a pul[...]

  • Seite 136

    136 CHAPTER 6 PORT FUNCTIONS Figure 6-8. P22 and P27 Block Diagram PUO : Pull-up resistor option register PM : Port mode register RD : Port 2 read signal WR : Port 2 write signal P-ch WR PM WR PORT RD WR PUO AV DD Selector PUO2 Output Latch (P22 and P27) PM22, PM27 Internal bus Alternate Function P22/SCK1, P27/SCK0/SCL[...]

  • Seite 137

    137 CHAPTER 6 PORT FUNCTIONS 6.2.5 Port 3 Port 3 is an 8-bit input/output port with output latch. P30 to P37 pins can specify the input mode/output mode in 1-bit units with the port mode register 3 (PM3). When P30 to P37 pins are used as input ports, an on-chip pull-up resistor can be used to them in 8-bit units with a pull-up resistor option regis[...]

  • Seite 138

    138 CHAPTER 6 PORT FUNCTIONS P40 P41 P42 P43 P44 P45 P46 P47 Falling Edge Detection Circuit KRMK KRIF Set Signal Standby Release Signal 6.2.6 Port 4 Port 4 is an 8-bit input/output port with output latch. P40 to P47 pins can specify the input mode/output mode in 8-bit units with the memory expansion mode register (MM). When P40 to P47 pins are used[...]

  • Seite 139

    139 CHAPTER 6 PORT FUNCTIONS 6.2.7 Port 5 Port 5 is an 8-bit input/output port with output latch. P50 to P57 pins can specify the input mode/output mode in 1-bit units with the port mode register 5 (PM5). When P50 to P57 pins are used as input ports, an on-chip pull-up resistor can be used to them in 8-bit units with a pull-up resistor option regis[...]

  • Seite 140

    140 CHAPTER 6 PORT FUNCTIONS 6.2.8 Port 6 Port 6 is an 8-bit input/output port with output latch. P60 to P67 pins can specify the input mode/output mode in 1-bit units with the port mode register 6 (PM6). This port has functions related to pull-up resistors as shown below. These functions depending on whether the higher 4 bits or lower 4 bits of a [...]

  • Seite 141

    141 CHAPTER 6 PORT FUNCTIONS Figure 6-13. P60 to P63 Block Diagram PM : Port mode register RD : Port 6 read signal WR : Port 6 write signal Figure 6-14. P64 to P67 Block Diagram PUO : Pull-up resistor option register PM : Port mode register RD : Port 6 read signal WR : Port 6 write signal WR PM WR PORT RD AV DD Selector Output Latch (P60 to P63) PM[...]

  • Seite 142

    142 CHAPTER 6 PORT FUNCTIONS 6.2.9 Port 7 This is a 3-bit input/output port with output latches. Input mode/output mode can be specified bit-wise by means of port mode register 7 (PM7). When pins P70 to P72 are used as input port pins, an on-chip pull-up resistor can be used as a 3-bit unit by means of pull-up resistor option register L (PUOL). Alt[...]

  • Seite 143

    143 CHAPTER 6 PORT FUNCTIONS Figure 6-16. P71 and P72 Block Diagram PUO : Pull-up resistor option register PM : Port mode register RD : Port 7 read signal WR : Port 7 write signal P-ch WR PM WR PORT RD WR PUO AV DD Selector PUO7 Output Latch (P71 and P72) PM71, PM72 Internal bus Alternate Function P71/SO2/TxD, P72/SCK2/ASCK[...]

  • Seite 144

    144 CHAPTER 6 PORT FUNCTIONS 6.2.10 Port 12 This is an 8-bit input/output port with output latches. Input mode/output mode can be specified bit-wise by means of port mode register 12 (PM12). When pins P120 to P127 are used as input port pins, an on-chip pull-up resistor can be used as an 8-bit unit by means of pull-up resistor option register H (PU[...]

  • Seite 145

    145 CHAPTER 6 PORT FUNCTIONS 6.2.11 Port 13 This is a 2-bit input/output port with output latches. Input mode/output mode can be specified bit-wise by means of port mode register 13 (PM13). When pins P130 and P131 are used as input port pins, an on-chip pull-up resistor can be used as a 2-bit unit by means of pull-up resistor option register H (PUO[...]

  • Seite 146

    146 CHAPTER 6 PORT FUNCTIONS 6.3 Port Function Control Registers The following four types of registers control the ports. • Port mode registers (PM0 to PM3, PM5 to PM7, PM12, PM13) • Pull-up resistor option register (PUOH, PUOL) • Memory expansion mode register (MM) • Key return mode register (KRM) (1) Port mode registers (PM0 to PM3, PM5 t[...]

  • Seite 147

    147 CHAPTER 6 PORT FUNCTIONS Table 6-5. Port Mode Register and Output Latch Settings When Using Alternate Functions P00 INTP0 Input 1 (Fixed) None TI00 Input 1 (Fixed) None P01 INTP1 Input 1 × TI01 Input 1 × P02 to P06 INTP2 to INTP6 Input 1 × P07 Note 1 XT1 Input 1 (Fixed) None P10 to P17 Note 1 ANI0 to ANI7 Input 1 × P30 to P32 TO0 to TO2 Out[...]

  • Seite 148

    148 CHAPTER 6 PORT FUNCTIONS Figure 6-19. Port Mode Register Format PM0 PM1 PM2 1 PM06 PM03 PM02 PM01 1 76 54 3 21 0 Symbol PM3 PM5 FF20H FF21H FF22H FF23H FF25H FFH FFH FFH FFH FFH R/W R/W R/W R/W R/W Address After Reset R/W PM17 PM16 PM15 PM14 PM13 PM12 PM11 PM10 PM27 PM26 PM25 PM24 PM23 PM22 PM21 PM20 PM37 PM36 PM35 PM34 PM33 PM32 PM31 PM30 PM57[...]

  • Seite 149

    149 CHAPTER 6 PORT FUNCTIONS (2) Pull-up resistor option register (PUOH, PUOL) This register is used to set whether to use an internal pull-up resistor at each port or not. A pull-up resistor is internally used at bits which are set to the input mode at a port where on-chip pull-up resistor use has been specified with PUOH, PUOL. No on-chip pull-up[...]

  • Seite 150

    150 CHAPTER 6 PORT FUNCTIONS (3) Memory expansion mode register (MM) This register is used to set input/output of port 4. MM is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets this register to 10H. Figure 6-21. Memory Expansion Mode Register Format Note The full address mode allows external expansion for all areas of the[...]

  • Seite 151

    151 CHAPTER 6 PORT FUNCTIONS KRIF Key Return Signal Detection Flag 0 1 Not Detected Detected (Falling edge detection of port 4) 00 0 0 KRM FFF6H 76 543 2 Symbol 1 0 KRMK KRIF 0 0 KRMK Standby Mode Control by Key Return Signal 0 1 Standby mode release enabled Standby mode release disabled Address After Reset R/W 02H R/W (4) Key return mode register [...]

  • Seite 152

    152 CHAPTER 6 PORT FUNCTIONS 6.4 Port Function Operations Port operations differ depending on whether the input or output mode is set, as shown below. 6.4.1 Writing to input/output port (1) Output mode A value is written to the output latch by a transfer instruction, and the output latch contents are output from the pin. Once data is written to the[...]

  • Seite 153

    153 CHAPTER 6 PORT FUNCTIONS 6.4.3 Operations on input/output port (1) Output mode An operation is performed on the output latch contents, and the result is written to the output latch. The output latch contents are output from the pins. Once data is written to the output latch, it is retained until data is written to the output latch again. (2) In[...]

  • Seite 154

    154 [MEMO][...]

  • Seite 155

    155 CHAPTER 7 CLOCK GENERATOR 7.1 Clock Generator Functions The clock generator generates the clock to be supplied to the CPU and peripheral hardware. The following two types of system clock oscillators are available. (1) Main system clock oscillator This circuit oscillates at frequencies of 1 to 5.0 MHz. Oscillation can be stopped by executing the[...]

  • Seite 156

    156 CHAPTER 7 CLOCK GENERATOR Figure 7-1. Block Diagram of Clock Generator Subsystem Clock Oscillator Main System Clock Oscillator X2 X1 XT2 XT1/P07 FRC STOP MCC FRC CLS CSS PCC2 PCC1 Internal Bus Standby Control Circuit To INTP0 Sampling Clock 2 f XX 2 2 f XX 2 3 f XX 2 4 f XX Prescaler Clock to Peripheral Hardware Prescaler Oscillation Mode Selec[...]

  • Seite 157

    157 CHAPTER 7 CLOCK GENERATOR 7.3 Clock Generator Control Register The clock generator is controlled by the following two registers: • Processor clock control register (PCC) • Oscillation mode selection register (OSMS) (1) Processor clock control register (PCC) The PCC sets whether to use CPU clock selection, the ratio of division, main system [...]

  • Seite 158

    158 CHAPTER 7 CLOCK GENERATOR Figure 7-3. Processor Clock Control Register Format Notes 1. Bit 5 is Read Only. 2. When the CPU is operating on the subsystem clock, MCC should be used to stop the main system clock oscillation. A STOP instruction should not be used. Caution Bit 3 must be set to 0. Remarks 1. f XX : Main system clock frequency (f X or[...]

  • Seite 159

    159 CHAPTER 7 CLOCK GENERATOR The fastest instruction of the µ PD78075F and 78075FY Subseries can be executed in two clocks of the CPU clock. The relationship between the CPU clock (f CPU ) and the minimum instruction execution time is shown in Table 7-2. Table 7-2. Relationship Between CPU Clock and Minimum Instruction Execution Time CPU Clock (f[...]

  • Seite 160

    160 CHAPTER 7 CLOCK GENERATOR Figure 7-5. Main System Clock Waveform due to Writing to OSMS Caution 2. When writing “1” to MCS, V DD must be 2.7 V or higher before the write execution. Remarks f xx : Main system clock frequency (fx or fx/2) f x : Main system clock oscillation frequency Write to OSMS (MCS 0) f XX Max. 2/f X Operating at f XX = f[...]

  • Seite 161

    161 CHAPTER 7 CLOCK GENERATOR 7.4 System Clock Oscillator 7.4.1 Main system clock oscillator The main system clock oscillator oscillates with a crystal resonator or a ceramic resonator (standard: 5.0 MHz) connected to the X1 and X2 pins. External clocks can be input to the main system clock oscillator. In this case, input a clock signal to the X1 p[...]

  • Seite 162

    162 CHAPTER 7 CLOCK GENERATOR 7.4.2 Subsystem clock oscillator The subsystem clock oscillator oscillates with a crystal resonator (standard: 32.768 kHz) connected to the XT1 and XT2 pins. External clocks can be input to the main system clock oscillator. In this case, input a clock signal to the XT1 pin and an antiphase clock signal to the XT2 pin. [...]

  • Seite 163

    163 CHAPTER 7 CLOCK GENERATOR Figure 7-8. Examples of Resonator with Incorrect Connection (2/2) (c) Changing high current is too near a (d) Current flows through the grounding line signal line of the resonator (potential at points A, B, and C fluctuate) (e) Signals are fetched Remark When using a subsystem clock, replace X1 and X2 with XT1 and XT2,[...]

  • Seite 164

    164 CHAPTER 7 CLOCK GENERATOR 7.4.3 Scaler The scaler divides the main system clock oscillator output (f XX ) and generates various clocks. 7.4.4 When no subsystem clocks are used If it is not necessary to use subsystem clocks for low power consumption operations and clock operations, connect the XT1 and XT2 pins as follows. XT1 : Connect to V DD X[...]

  • Seite 165

    165 CHAPTER 7 CLOCK GENERATOR 7.5 Clock Generator Operations The clock generator generates the following various types of clocks and controls the CPU operating mode including the standby mode. • Main system clock f XX • Subsystem clock f XT • CPU clock f CPU • Clock to peripheral hardware The following clock generator functions and operatio[...]

  • Seite 166

    166 CHAPTER 7 CLOCK GENERATOR MCC CSS CLS Main System Clock Oscillation Subsystem Clock Oscillation CPU Clock L L Oscillation does not stop. 7.5.1 Main system clock operations When operated with the main system clock (with bit 5 (CLS) of the processor clock control register (PCC) set to 0), the following operations are carried out by PCC setting. ([...]

  • Seite 167

    167 CHAPTER 7 CLOCK GENERATOR MCC CSS CLS Main System Clock Oscillation Subsystem Clock Oscillation CPU Clock Figure 7-9. Main System Clock Stop Function (2/2) (c) Operation when CSS is set after setting MCC with main system clock operation 7.5.2 Subsystem clock operations When operated with the subsystem clock (with bit 5 (CLS) of the processor cl[...]

  • Seite 168

    168 CHAPTER 7 CLOCK GENERATOR Table 7-3. Maximum Time Required for CPU Clock Switchover × × ×× 1 0 0 0 1 1 0 0 1 0 0 0 1 0 0 0 CSS 0 0 0 0 × PCC0 PCC1 PCC2 1 × 1 PCC0 CSS PCC2 PCC1 0 0 0 0 1 1 0 0 0 1 0 0 0 0 1 × 1 × × 1 8 instructions 2 instructions 4 instructions 4 instructions 16 instructions 2 instructions 8 instructions 4 instructions[...]

  • Seite 169

    169 CHAPTER 7 CLOCK GENERATOR V DD RESET Interrupt Request Signal System Clock CPU Clock Wait (26.2 ms : 5.0 MHz) Internal Reset Operation Minimum Speed Operation Maximum Speed Operation Subsystem Clock Operation f XX f XX f XT f XX High-Speed Operation 7.6.2 System clock and CPU clock switching procedure This section describes switching procedure [...]

  • Seite 170

    170 [MEMO][...]

  • Seite 171

    171 CHAPTER 8 16-BIT TIMER/EVENT COUNTER 8.1 Overview of the µ PD78058F and 78058FY Subseries On-Chip Timers This chapter describes the 16-bit timer/event counter and begins with an overview of the on-chip timers and related devices of the µ PD78058F and 78058FY Subseries. (1) 16-bit timer/event counter (TM0) The TM0 can be used for an interval t[...]

  • Seite 172

    172 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Table 8-1. Timer/Event Counter Operation Interval timer 2 channels Note 3 2 channels 1 channel Note 1 1 channel Note 2 External event counter √√ —— Timer output √√ —— PWM output √ ——— Pulse width measurement √ ——— Square-wave output √√ —— One-shot pulse output √ —?[...]

  • Seite 173

    173 CHAPTER 8 16-BIT TIMER/EVENT COUNTER 8.2 16-Bit Timer/Event Counter Functions The 16-bit timer/event counter (TM0) has the following functions. • Interval timer • PWM output • Pulse width measurement • External event counter • Square-wave output • One-shot pulse output PWM output and pulse width measurement can be used at the same t[...]

  • Seite 174

    174 CHAPTER 8 16-BIT TIMER/EVENT COUNTER (5) Square-wave output TM0 can output a square wave with any selected frequency. Table 8-3. 16-Bit Timer/Event Counter Square-Wave Output Ranges Minimum Pulse Width Maximum Pulse Width Resolution MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0 2 × TI00 input cycle 2 16 × TI00 input cycle TI00 input edge cy[...]

  • Seite 175

    175 CHAPTER 8 16-BIT TIMER/EVENT COUNTER TCL06 TCL05 TCL04 Timer Clock Selection Register 0 3 Internal bus Capture/Compare Control Register 0 CRC02 CRC01 CRC00 Selector TI01/ P01/INTP1 INTTM3 2f XX f XX f XX /2 f XX /2 2 Selector 16-Bit Capture/Compare Register 01 (CR01) Internal Bus 16-Bit Capture/Compare Register 00 (CR00) Clear Match Clear Circu[...]

  • Seite 176

    176 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Figure 8-2. 16-Bit Timer/Event Counter Output Control Circuit Block Diagram Remark The circuitry enclosed by the dotted line is the output control circuit. PWM Pulse Output Control Circuit Edge Detection Circuit TI00/P00/ INTP0 OSPT 16-Bit Timer Output Control Register OSPE TOC04 LVS0 LVR0 TOC01 TOE0 Selecto[...]

  • Seite 177

    177 CHAPTER 8 16-BIT TIMER/EVENT COUNTER (1) Capture/compare register 00 (CR00) CR00 is a 16-bit register which has the functions of both a capture register and a compare register. Whether it is used as a capture register or as a compare register is set by bit 0 (CRC00) of capture/compare control register 0. When CR00 is used as a compare register,[...]

  • Seite 178

    178 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Caution If the valid edge of the TIO0/P00 pin is input while CR01 is read, CR01 does not perform the capture operation and retains the current data. However, the interrupt request flag (PIF0) is set. (3) 16-bit timer register (TM0) TM0 is a 16-bit register which counts the count pulses. TM0 is read by a 16-b[...]

  • Seite 179

    179 CHAPTER 8 16-BIT TIMER/EVENT COUNTER CLOE TCL06 TCL05 TCL04 TCL03 TCL02 TCL01 TCL00 76 54 32 10 Symbol TCL0 TCL03 TCL02 TCL01 TCL00 00 00 f XT (32.768 kHz) 01 01 f XX f X (5.0 MHz) f X /2 (2.5 MHz) 01 10 f XX /2 f X /2 (2.5 MHz) f X /2 2 (1.25 MHz) 01 11 f XX /2 2 f X /2 2 (1.25 MHz) f X /2 3 (625 kHz) 10 00 f XX /2 3 f X /2 3 (625 kHz) f X /2 [...]

  • Seite 180

    180 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Remarks 1. f XX : Main system clock frequency (f X or f X /2) 2. f X : Main system clock oscillation frequency 3. f XT : Subsystem clock oscillation frequency 4. TI00 : 16-bit timer/event counter input pin 5. TM0 : 16-bit timer register 6. MCS : Bit 0 of oscillation mode selection register (OSMS) 7. Figures [...]

  • Seite 181

    181 CHAPTER 8 16-BIT TIMER/EVENT COUNTER 00 00 TMC03 TMC02 TMC01 OVF0 76 54 32 10 Symbol TMC0 FF48H 00H R/W Address After Reset R/W OVF0 16-Bit Timer Register Overflow Detection 0 Overflow not detected 1 Overflow detected TMC03 TMC02 TMC01 Operating Mode Clear Mode Selection TO0 Output Timing Selection Interrupt Generation 00 0 Operation stop (TM0 [...]

  • Seite 182

    182 CHAPTER 8 16-BIT TIMER/EVENT COUNTER 00 00 0 CRC02 CRC01 CRC00 76 54 32 10 Symbol CRC0 FF4CH 04H R/W Address After Reset R/W CRC00 CR00 Operating Mode Selection 0 Operates as compare register 1 Operates as capture register CRC01 CR00 Capture Trigger Selection Captures on valid edge of TI01 Captures on valid edge of TI00 0 1 CRC02 CR01 Operating[...]

  • Seite 183

    183 CHAPTER 8 16-BIT TIMER/EVENT COUNTER 0 OSPT OSPE TOC04 LVS0 LVR0 TOC01 TOE0 76 54 32 10 Symbol TOC0 FF4EH 00H R/W Address After Reset R/W TOE0 16-Bit Timer/Event Counter Output Control 0 Output disabled (Port mode) 1 Output enabled TOC01 0 1 In PWM Mode In Other Modes Active level selection Timer output F/F control by match of CR00 and TM0 Acti[...]

  • Seite 184

    184 CHAPTER 8 16-BIT TIMER/EVENT COUNTER PM37 PM36 PM35 PM34 PM33 PM32 PM31 PM30 76 54 32 10 Symbol PM3 FF23H FFH R/W Address After Reset R/W PM3n P3n Pin Input/Output Mode Selection (n = 0 to 7) 0 Output mode (output buffer ON) 1 Input mode (output buffer OFF) (5) Port mode register 3 (PM3) This register sets port 3 input/output in 1-bit units. Wh[...]

  • Seite 185

    185 CHAPTER 8 16-BIT TIMER/EVENT COUNTER ES31 ES30 ES21 ES20 ES11 ES10 0 0 76 54 32 10 Symbol INTM0 FFECH 00H R/W Address After Reset R/W ES11 INTP0 Valid Edge Selection ES10 0 Falling edge 0 0 Rising edge 1 1 Setting prohibited 0 1 Both falling and rising edges 1 ES21 INTP1 Valid Edge Selection ES20 0 Falling edge 0 0 Rising edge 1 1 Setting prohi[...]

  • Seite 186

    186 CHAPTER 8 16-BIT TIMER/EVENT COUNTER 0 0 0 0 0 0 SCS1 SCS0 76 54 32 10 Symbol SCS FF47H 00H R/W Address After Reset R/W SCS1 SCS0 00 01 10 11 INTP0 Sampling Clock Selection MCS = 1 MCS = 0 f XX /2 N f X /2 7 (39.1 kHz) f XX /2 7 f X /2 8 (19.5 kHz) f X /2 5 (156.3 kHz) f XX /2 5 f X /2 6 (78.1 kHz) f X /2 6 (78.1 kHz) f XX /2 6 f X /2 7 (39.1 k[...]

  • Seite 187

    187 CHAPTER 8 16-BIT TIMER/EVENT COUNTER 0 0 0 0 0 0/1 0/1 0 CRC02 CRC01 CRC00 CRC0 CR00 set as compare register 00 00 11 0 / 1 0 TMC03 TMC02 TMC01 OVF0 TMC0 Clear & start on match TM0 and CR00 8.5 16-Bit Timer/Event Counter Operations 8.5.1 Interval timer operations Setting the 16-bit timer mode control register (TMC0) and capture/compare cont[...]

  • Seite 188

    188 CHAPTER 8 16-BIT TIMER/EVENT COUNTER 16-Bit Capture/Compare Register 00 (CR00) 16-Bit Timer Register (TM0) Selector f XX /2 2 f XX /2 f XX 2f XX INTTM3 TI00/P00/INTP0 OVF0 Clear Circuit INTTM00 Figure 8-11. Interval Timer Configuration Diagram Figure 8-12. Interval Timer Operation Timings Remark Interval time = (N + 1) × t : N = 0001H to FFFFH[...]

  • Seite 189

    189 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Table 8-6. 16-Bit Timer/Event Counter Interval Times Minimum Interval Time Maximum Interval Time Resolution MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0 000 2 × TI00 input cycle 2 16 × TI00 input cycle TI00 input edge cycle 0 0 1 Setting 2 × 1/f X Setting 2 16 × 1/f X Setting 1/f X prohibited (400 ns)[...]

  • Seite 190

    190 CHAPTER 8 16-BIT TIMER/EVENT COUNTER TOE0 TOC01 LVR0 LVS0 TOC04 OSPE OSPT TOC0 1 0/1 × × × × × 0 TO0 Output Enabled Specifies Active Level CRC00 CRC01 CRC02 CRC0 0 0/1 0/1 0 0 0 0 0 CR00 set as compare register TMC0 0 1 0 0 0 0 0 0 OVF0 TMC01 TMC02 TMC03 PWM mode Figure 8-13. Control Register Settings for PWM Output Operation (a) 16-bit ti[...]

  • Seite 191

    191 CHAPTER 8 16-BIT TIMER/EVENT COUNTER By integrating 14-bit resolution PWM pulses with an external low-pass filter, they can be converted to an analog voltage and used for electronic tuning and D/A converter applications, etc. The analog output voltage (V AN ) used for D/A conversion with the configuration shown in Figure 8-14 is as follows. V A[...]

  • Seite 192

    192 CHAPTER 8 16-BIT TIMER/EVENT COUNTER TOC0 1 1 0/1 0/1 1 0 0 0 TOE0 TOC01 LVR0 LVS0 Inversion of output on match of TM0 and CR00 TOC04 OSPE OSPT TO0 Output Enabled Specified TO0 output F/F initial value Inversion of output on match of TM0 and CR01 One-shot pulse output disabled CRC0 0 x 0 0 0 0 0 0 CRC00 CRC01 CRC02 CR00 set as compare register [...]

  • Seite 193

    193 CHAPTER 8 16-BIT TIMER/EVENT COUNTER TMC0 0 0/1 1 0 0 0 0 0 OVF0 TMC01 TMC02 TMC03 Free-Running Mode CRC0 0 0/1 1 0 0 0 0 0 CRC00 CRC01 CRC02 CR00 set as compare register CR01 set as capture register 8.5.4 Pulse width measurement operations It is possible to measure the pulse width of the signals input to the TI00/P00 pin and TI01/P01 pin using[...]

  • Seite 194

    194 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Selector f XX /2 2 f XX /2 f XX 2f XX INTTM3 16-Bit Timer Register (TM0) 16-Bit Capture/Compare Register 01 (CR01) OVF0 INTP0 Internal Bus TI00/P00/INTP00 Count Clock TM0 Count Value TI00 Pin Input CR01 Captured Value INTP0 OVF0 0000 0001 D0 D1 FFFF 0000 D2 D3 D0 D1 D2 D3 (D1 – D0) × t (10000H – D1 + D2[...]

  • Seite 195

    195 CHAPTER 8 16-BIT TIMER/EVENT COUNTER CRC0 1 0 1 0 0 0 0 0 CRC00 CRC01 CRC02 CR00 set as capture register Captured in CR00 on valid edge of TI01/P01 Pin CR01 set as capture register TMC0 0 0/1 1 0 0 0 0 0 OVF0 TMC01 TMC02 TMC03 Free-Running Mode (2) Measurement of two pulse widths with free-running counter When the 16-bit timer register (TM0) is[...]

  • Seite 196

    196 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Count Clock TM0 Count Value TI00 Pin Input CR01 Captured Value INTP0 TI01 Pin Input t CR00 Captured Value INTP1 OVF0 (D1 – D0) × t (10000H – D1 + D2) × t (10000H – D1 + (D2 + 1)) × t (D3 – D2) × t 0000 0001 D0 D1 0000 D3 D2 FFFF D0 D1 D3 D2 D1 Figure 8-21. Timing of Pulse Width Measurement Operat[...]

  • Seite 197

    197 CHAPTER 8 16-BIT TIMER/EVENT COUNTER CRC0 1 1 1 0 0 0 0 0 CRC00 CRC01 CRC02 CR00 set as capture register Captured in CR00 on invalid edge of TI00/P00 Pin CR01 set as capture register TMC0 0 0/1 1 0 0 0 0 0 OVF0 TMC01 TMC02 TMC03 Free-Running Mode (3) Pulse width measurement with free-running counter and two capture registers When the 16-bit tim[...]

  • Seite 198

    198 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Count Clock TM0 Count Value TI00 Pin Input CR01 Captured Value CR00 Captured Value INTP0 OVF0 (D1-D0) × t (10000H-D1 + D2) × t (D3-D2) × t D1 D3 D0 D2 D3 D2 0000 FFFF D1 D0 0000 0001 t Figure 8-23. Timing of Pulse Width Measurement Operation by Free-Running Counter and Two Capture Registers (with Rising E[...]

  • Seite 199

    199 CHAPTER 8 16-BIT TIMER/EVENT COUNTER CRC0 1 1 1 0 0 0 0 0 CRC00 CRC01 CRC02 CR00 set as capture register Captured in CR00 on invalid edge of TI00/P00 Pin CR01 set as capture register TMC0 0 0/1 0 1 0 0 0 0 OVF0 TMC01 TMC02 TMC03 Clear & start with valid ed g e of TI00/P00 pin (4) Pulse width measurement by means of restart When input of a v[...]

  • Seite 200

    200 CHAPTER 8 16-BIT TIMER/EVENT COUNTER CRC0 0 0/1 0/1 0 0 0 0 0 CRC00 CRC01 CRC02 CR00 set as compare register TMC0 0 0/1 1 1 0 0 0 0 OVF0 TMC01 TMC02 TMC03 Clear & start with match of TM0 and CR00 8.5.5 External event counter operation The external event counter counts the number of external clock pulses to be input to the TI00/P00 pin with [...]

  • Seite 201

    201 CHAPTER 8 16-BIT TIMER/EVENT COUNTER TI00 Pin Input TM0 Count Value CR00 INTTM0 N 0000 0001 0002 0003 0004 0005 N-1 N 0000 0001 0002 0003 16-Bit Capture/Compare Register 00 (CR00) Clear INTTM00 INTP0 16-Bit Timer Register (TM0) 16-Bit Capture/Compare Register 01 (CR01) Internal Bus TI00 Valid Edge OVF0 Figure 8-27. External Event Counter Config[...]

  • Seite 202

    202 CHAPTER 8 16-BIT TIMER/EVENT COUNTER TOC0 1 1 0/1 0/1 0 0 0 0 TOE0 TOC01 LVR0 OSPT OSPE TOC04 LVS0 TO0 Output Enabled Inversion of output on match of TM0 and CR00 Specified TO0 output F/F initial value No inversion of output on match of TM0 and CR01 One-shot pulse output disabled CRC0 0 0/1 0/1 0 0 0 0 0 CRC00 CRC01 CRC02 CR00 set as compare re[...]

  • Seite 203

    203 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Count Clock TM0 Count Value CR00 INTTM00 TO0 Pin Output 0000 0001 0002 N-1 N 0000 0001 0002 N-1 N 0000 N Figure 8-30. Square-Wave Output Operation Timing Table 8-7. 16-Bit Timer/Event Count Square-Wave Output Ranges Minimum Pulse Width Maximum Pulse Width Resolution MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MC[...]

  • Seite 204

    204 CHAPTER 8 16-BIT TIMER/EVENT COUNTER TOC0 1 1 0/1 0/1 1 1 0 0 TOE0 TOC01 LVR0 OSPT OSPE TOC04 LVS0 TO0 Output Enabled Inversion of output on match of TM0 and CR00 Specified TO0 output F/F initial value Inversion of output on match of TM0 and CR01 One-shot pulse output mode Set 1 in case of output CRC0 0 0/1 0 0 0 0 0 0 CRC00 CRC01 CRC02 CR00 se[...]

  • Seite 205

    205 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Count Clock TM0 Count Value CR01 Set Value CR00 Set Value INTTM01 OSPT INTTM00 TO0 Pin Output 0000 0001 N N+1 0000 N-1 N M-1 M 0000 0001 0002 N M N M N M N M Set 0CH to TMC0 (TM0 count start) Figure 8-32. Timing of One-Shot Pulse Output Operation Using Software Trigger Caution The 16-bit timer register start[...]

  • Seite 206

    206 CHAPTER 8 16-BIT TIMER/EVENT COUNTER CRC0 0 0/1 0 0 0 0 0 0 CRC00 CRC01 CRC02 CR00 set as compare register CR01 set as compare register TOC0 1 1 0/1 0/1 1 1 0 0 TOE0 TOC01 LVR0 LVS0 OSPT OSPE TOC04 TO0 Output Enabled Inversion of output on match of TM0 and CR00 Specified TO0 output F/F initial value Inversion of output on match of TM0 and CR01 [...]

  • Seite 207

    207 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Count Clock TM0 Count Value CR01 Set Value CR00 Set Value INTTM01 TI00 Pin Input INTTM00 TO0 Pin Output 0000 0001 0000 N N+1 N+2 M–2 M–1 M M+1 M+2 M+3 N M N M N M N M Set 08H to TMC0 (TM0 count start) Figure 8-34. Timing of One-Shot Pulse Output Operation Using External Trigger (with Rising Edge Specifie[...]

  • Seite 208

    208 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Count Pulse CR00 TM0 Count Value X-1 X FFFFH 0000H 0001H 0002H M N Timer Start Count Pulse TM0 Count Value 0000H 0001H 0002H 0003H 0004H 8.6 16-Bit Timer/Event Counter Operating Precautions (1) Timer start errors An error with a maximum of one clock may occur concerning the time required for a match signal t[...]

  • Seite 209

    209 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Count Pulse TM0 Count Value Edge Input Interrupt Request Flag Capture Read Signal CR01 Captured Value Capture Operation Ignored X N+1 N N+1 N+2 M M+1 M+2 (4) Capture register data retention timings If the valid edge of the TI00/P00 pin is input during 16-bit capture/compare register 01 (CR01) read, CR01 hold[...]

  • Seite 210

    210 CHAPTER 8 16-BIT TIMER/EVENT COUNTER Count Pulse CR00 TM0 OVF0 INTTM00 FFFFH FFFEH FFFFH 0000H 0001H (7) Operation of OVF0 flag OFV0 flag is set to 1 in the following case. The clear & start mode on match between TM0 and CR00 is selected. ↓ CR00 is set to FFFFH. ↓ When TM0 is counted up from FFFFH to 0000H. Figure 8-38. Operation Timing[...]

  • Seite 211

    211 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 9.1 8-Bit Timer/Event Counter Function The on-chip 8-bit timer/event counters of the µ PD78058F, 78058FY Subseries have two modes: a mode in which the two 8-bit timer/event counter channels are separately used (8-bit timer/event counter mode), and a mode in which the two 8-bit timer/event counter channels a[...]

  • Seite 212

    212 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS (1) 8-bit interval timer Interrupt requests are generated at the preset time intervals. Table 9-1. 8-Bit Timer/Event Counter Interval Times Minimum Interval Time Maximum Interval Time Resolution MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0 2 × 1/f X 2 2 × 1/f X 2 9 × 1/f X 2 10 × 1/f X 2 × 1/f X 2 2 [...]

  • Seite 213

    213 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS (2) External event counter The number of pulses of an externally input signal can be measured. (3) Square-wave output A square wave with any selected frequency can be output. Table 9-2. 8-Bit Timer/Event Counter Square-Wave Output Ranges Minimum Pulse Width Maximum Pulse Width Resolution MCS = 1 MCS = 0 MCS [...]

  • Seite 214

    214 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 9.1.2 16-bit timer/event counter mode (1) 16-bit interval timer Interrupt requests can be generated at the preset time intervals. Table 9-3. Interval Times When 8-Bit Timer/Event Counters are Used as 16-Bit Timer/Event Counter Minimum Interval Time Maximum Interval Time Resolution MCS = 1 MCS = 0 MCS = 1 MCS[...]

  • Seite 215

    215 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS (2) External event counter The number of pulses of an externally input signal can be measured. (3) Square-wave output A square wave with any selected frequency can be output. Table 9-4. Square-Wave Output Ranges When 8-Bit Timer/Event Counters are Used as 16-Bit Timer/Event Counter Minimum Pulse Width Maximu[...]

  • Seite 216

    216 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 9.2 8-Bit Timer/Event Counter Configuration The 8-bit timer/event counters 1 and 2 consist of the following hardware. Table 9-5. 8-Bit Timer/Event Counter Configuration Item Configuration Timer register 8 bits × 2 (TM1, TM2) Register Compare register: 8 bits × 2 (CR10, CR20) Timer output 2 (TO1, TO2) Timer[...]

  • Seite 217

    217 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS Figure 9-1. 8-Bit Timer/Event Counter Block Diagram Note Refer to Figures 9-2 and 9-3 for details of 8-bit timer/event counters 1 and 2 output control circuits 1 and 2, respectively. 8-Bit Compare Register 10 (CR10) Match 8-Bit Timer Register 1 (TM1) Selector Clear Selector Selector f XX /2-f XX /2 9 f XX /2[...]

  • Seite 218

    218 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS LVR2 LVS2 TOC15 INTTM2 R S INV Level F/F (LV2) f SCK P32 Output Latch PM32 TOE2 TO2/P32 Q LVR1 LVS1 TOC11 INTTM1 R S INV Q P31 Output Latch TOE1 PM31 TO1/P31 Level F/F (LV1) Figure 9-2. Block Diagram of 8-Bit Timer/Event Counter Output Control Circuit 1 Remark The section in the broken line is an output cont[...]

  • Seite 219

    219 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS (1) Compare registers 10 and 20 (CR10, CR20) These are 8-bit registers to compare the value set to CR10 to the 8-bit timer register 1 (TM1) count value, and the value set to CR20 to the 8-bit timer register 2 (TM2) count value, and, if they match, generate an interrupt request (INTTM1 and INTTM2, respectivel[...]

  • Seite 220

    220 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 9.3 8-Bit Timer/Event Counter Control Registers The following four types of registers are used to control the 8-bit timer/event counter. • Timer clock select register 1 (TCL1) • 8-bit timer mode control register 1 (TMC1) • 8-bit timer output control register (TOC1) • Port mode register 3 (PM3) (1) Ti[...]

  • Seite 221

    221 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS TCL17 TCL16 TCL15 TCL14 TCL13 TCL12 TCL11 TCL10 76 54 32 10 Symbol TCL1 FF41H 00H R/W Address After Reset R/W TCL13 TCL12 TCL11 TCL10 0 0 0 0 TI1 falling edge 0 0 0 1 TI1 rising edge 01 10 01 11 f XX /2 f X /2 (2.5 MHz) f X /2 2 (1.25 MHz) 10 00 f XX /2 2 f X /2 2 (1.25 MHz) f X /2 3 (625 kHz) 10 01 f XX /2 [...]

  • Seite 222

    222 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 0 1 2 3 4 5 6 7 Symbol TCE1 FF49H 00H R/W Address After Reset R/W TCE2 TMC12 0 0 0 0 0 TMC1 TCE1 8-Bit Timer Register 1 Operation Control 0 Operation stop (TM1 clear to 0) 1 Operation enable TCE2 8-Bit Timer Register 2 Operation Control Operation stop (TM2 clear to 0) Operation enable 0 1 TMC12 Operating Mod[...]

  • Seite 223

    223 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 0 1 2 3 4 5 6 7 Symbol TOE1 TOC11 LVR1 LVS1 TOE2 TOC15 LVR2 LVS2 TOC1 FF4FH 00H R/W Address After Reset R/W TOE1 8-Bit Timer/Event Counter 1 Outptut Control 0 Output disable (port mode) 1 Output enable TOC11 8-Bit Timer/Event Counter 1 Timer Output F/F Control 0 Inverted operation disable 1 Inverted operatio[...]

  • Seite 224

    224 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 0 1 2 3 4 5 6 7 Symbol PM30 FF23H FFH R/W Address After Reset R/W PM31 PM32 PM33 PM34 PM35 PM36 PM37 PM3 PM3n P3n Pin Input/Output Mode Selection (n=0 to 7) 0 Output mode (output buffer ON) 1 Input mode (output buffer OFF) (4) Port mode register 3 (PM3) This register sets port 3 input/output in 1-bit units. [...]

  • Seite 225

    225 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS 9.4 8-Bit Timer/Event Counter Operation 9.4.1 8-bit timer/event counter mode (1) Interval timer operations Operates as an interval timer which generates interrupt requests repeatedly with the count values set previously in the 8 bit conveyor registers 10 and 20 (CR10, CR20) as the interval. When the count va[...]

  • Seite 226

    226 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS Table 9-6. 8-Bit Timer/Event Counter 1 Interval Time Minimum Interval Time Maximum Interval Time Resolution MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0 0000 TI1 input cycle 2 8 × TI1 input cycle TI1 input edge cycle 0001 TI1 input cycle 2 8 × TI1 input cycle TI1 input edge cycle 2 × 1/f X 2 2 × 1/f X[...]

  • Seite 227

    227 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS Table 9-7. 8-Bit Timer/Event Counter 2 Interval Time Minimum Interval Time Maximum Interval Time Resolution MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0 0000 TI2 input cycle 2 8 × TI2 input cycle TI2 input edge cycle 0001 TI2 input cycle 2 8 × TI2 input cycle TI2 input edge cycle 2 × 1/f X 2 2 × 1/f X[...]

  • Seite 228

    228 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS TI1 Pin Input TM1 Count Value INTTM1 CR10 00 01 02 03 04 05 N-1 N 00 01 02 03 N (2) External event counter operation The external event counter counts the number of external clock pulses to be input to the TI1/P33 and TI2/ P34 pins with 8-bit timer registers 1 and 2 (TM1 and TM2). TM1 and TM2 are incremented[...]

  • Seite 229

    229 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS (3) Operation as a Square Wave Output Operates as a square wave output at the desired frequency with the values set previously in the 8 bit conveyor registers 10 and 20 (CR10, CR20) as the interval. The TO1/P31 or TO2/P32 pin output status is reversed at intervals of the count value preset to CR10 or CR20 by[...]

  • Seite 230

    230 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS Figure 9-10. Square-Wave Output Operation Timing Note The initial value of TO1 output can be set with bits 2 and 3 (LVR1 and LVS1) of the 8-bit timer output control register (TOC1). 9.4.2 16-bit timer/event counter mode When bit 2 (TMC12) of the 8-bit timer mode control register (TMC1) is set to 1, the 16-bi[...]

  • Seite 231

    231 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS Figure 9-11. Interval Timer Operation Timing Remark Interval time = (N + 1) × t : N = 0000H to FFFFH Caution Even if the 16-bit timer/event counter mode is used, when the TM1 count value matches the CR10 value, interrupt request (INTTM1) is generated and the F/F of 8-bit timer/event counter output control c[...]

  • Seite 232

    232 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS Table 9-9. Interval Times When 2-Channel 8-Bit Timer/Event Counters (TM1 and TM2) are Used as 16-Bit Timer/Event Counter Minimum Interval Time Maximum Interval Time Resolution MCS = 1 MCS = 0 MCS = 1 MCS = 0 MCS = 1 MCS = 0 0000 TI1 input cycle 2 8 × TI1 input cycle TI1 input edge cycle 0001 TI1 input cycle[...]

  • Seite 233

    233 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS TI1 Pin Input TM1, TM2 Count Value CR10, CR20 INTTM2 0000 0001 0002 0003 0004 0005 N-1 N 0000 0001 0002 0003 N (2) External event counter operations The external event counter counts the number of external clock pulses to be input to the TI1/P33 pin with 2- channel 8-bit timer registers 1 and 2 (TM1 and TM2)[...]

  • Seite 234

    234 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS (3) Operation as a Square Wave Output Operates as a square wave output at the desired frequency with the values set previously in the 8 bit conveyor registers 10 and 20 (CR10, CR20) as the interval. When setting the count value, the value of the upper 8 bits is set in CR20 and the value of the lower 8 bits i[...]

  • Seite 235

    235 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS Figure 9-13. Square-Wave Output Operation Timing Count Clock TM1 00H 00H 00H 01H FFH 00H 01H 02H FFH 00H 01H FFH M – 1 00H 00H M 01H N N N M N + 1 TM2 CR10 CR20 TO2 Count Start Level Inversion Counter Clear Interval Time[...]

  • Seite 236

    236 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS TI1, TI2, Input CR10, CR20 TM1, TM2 Count Value TO1, TO2 Interrupt Request Flag 00H 00H 00H 00H 00H Count Pulse TM1, TM2 Count Value 00H 01H 02H 03H 04H Timer Start 9.5 Cautions on 8-Bit Timer/Event Counters (1) Timer start errors An error of one clock maximum may occur concerning the time required for a mat[...]

  • Seite 237

    237 CHAPTER 9 8-BIT TIMER/EVENT COUNTERS Count Pulse CR10, CR20 TM1, TM2 Count Value X-1 X FFH 00H 01H 02H M N (3) Operation after compare register change during timer count operation If the values after the 8-bit compare registers 10 and 20 (CR10 and CR20) are changed are smaller than those of 8-bit timer registers (TM1 and TM2), TM1 and TM2 conti[...]

  • Seite 238

    238 [MEMO][...]

  • Seite 239

    239 CHAPTER 10 WATCH TIMER 10.1 Watch Timer Functions The watch timer has the following functions. • Watch timer • Interval timer The watch timer and the interval timer can be used simultaneously. (1) Watch timer When the 32.768 kHz subsystem clock is used, a flag (WTIF) is set at 0.5 second or 0.25 second intervals. When the 4.19 MHz (standard[...]

  • Seite 240

    240 CHAPTER 10 WATCH TIMER 10.2 Watch Timer Configuration The watch timer consists of the following hardware. Table 10-2. Watch Timer Configuration Item Configuration Counter 5 bits × 1 Timer clock select register 2 (TCL2) Watch timer mode control register (TMC2) 10.3 Watch Timer Control Registers The following two types of registers are used to c[...]

  • Seite 241

    241 CHAPTER 10 WATCH TIMER TMC21 Prescaler Selector INTWT 5-Bit Counter f W 2 14 f W 2 13 INTTM3 To 16-Bit Timer / Event Counter Watch Timer Mode Control Register TMC26 TMC25 TMC24 TMC23 TMC22 TMC21 TMC20 Internal Bus TCL24 Timer Clock Select Register 2 3 f W 2 4 f W 2 5 f W 2 6 f W 2 7 f W 2 8 f W 2 9 f W f XX /2 7 f XT Clear Clear Selector Select[...]

  • Seite 242

    242 CHAPTER 10 WATCH TIMER TCL27 7 TCL26 6 TCL25 TCL24 4 0 3210 FF42H Address TCL2 Symbol TCL22 TCL21 TCL20 5 00H After Reset R/W R/W 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 TCL22 TCL21 TCL20 f XX /2 3 f XX /2 4 f XX /2 5 f XX /2 6 f XX /2 7 f XX /2 8 f XX /2 9 f XX /2 11 f X /2 3 (625 kHz) f X /2 4 (313 kHz) f X /2 5 (156 kHz) f X /2 6 (78[...]

  • Seite 243

    243 CHAPTER 10 WATCH TIMER 0 7 TMC26 6 TMC25 TMC24 4 TMC23 3210 FF4AH Address TMC2 Symbol TMC22 TMC21 TMC20 5 00H After Reset R/W R/W 0 1 TMC23 2 14 /f W (0.4 sec) 2 13 /f W (0.2 sec) Watch Flag Set Time Selection 0 0 0 0 1 1 Other than above 0 0 1 1 0 0 0 1 0 1 0 1 TMC26 TMC25 TMC24 2 4 /f W (410 s) 2 5 /f W (819 s) 2 6 /f W (1.64 ms) 2 7 /f W (3.[...]

  • Seite 244

    244 CHAPTER 10 WATCH TIMER 10.4 Watch Timer Operations 10.4.1 Watch timer operation When the 32.768-kHz subsystem clock or 4.19-MHz main system clock is used, the timer operates as a watch timer with a 0.5-second or 0.25-second interval. The watch timer sets the test input flag (WTIF) to 1 at the constant time interval. The standby state (STOP mode[...]

  • Seite 245

    245 CHAPTER 11 WATCHDOG TIMER 11.1 Watchdog Timer Functions The watchdog timer has the following functions. • Watchdog timer • Interval timer Caution Select the watchdog timer mode or the interval timer mode with the watchdog timer mode register (WDTM) (The watchdog timer and interval timer cannot be used at the same time). (1) Watchdog timer m[...]

  • Seite 246

    246 CHAPTER 11 WATCHDOG TIMER (2) Interval timer mode Interrupt requests are generated at the preset time intervals. Table 11-2. Interval Times Interval Time MCS = 1 CS = 0 2 11 × 1/f XX 2 11 × 1/f X (410 µ s) 2 12 × 1/f X (819 µ s) 2 12 × 1/f XX 2 12 × 1/f X (819 µ s) 2 13 × 1/f X (1.64 ms) 2 13 × 1/f XX 2 13 × 1/f X (1.64 ms) 2 14 × 1[...]

  • Seite 247

    247 CHAPTER 11 WATCHDOG TIMER Prescaler f XX 2 4 f XX 2 5 f XX 2 6 f XX 2 7 f XX 2 8 f XX 2 9 Selector Watchdog Timer Mode Register Internal Bus Internal Bus TCL22 TCL21 TCL20 f XX /2 3 f XX 2 11 Timer Clock Select Register 2 3 WDTM4 RUN WDTM3 8-Bit Counter TMMK4 RUN TMIF4 INTWDT Maskable Interrupt Request INTWDT Non-Maskable Interrupt Request RESE[...]

  • Seite 248

    248 CHAPTER 11 WATCHDOG TIMER 11.3 Watchdog Timer Control Registers The following two types of registers are used to control the watchdog timer. • Timer clock select register 2 (TCL2) • Watchdog timer mode register (WDTM) (1) Timer clock select register 2 (TCL2) This register sets the watchdog timer count clock. TCL2 is set with 8-bit memory ma[...]

  • Seite 249

    249 CHAPTER 11 WATCHDOG TIMER Figure 11-2. Timer Clock Select Register 2 Format Caution When rewriting TCL2 to other data, stop the timer operation beforehand. Remarks 1. f XX : Main system clock frequency (f X or f X /2) 2. f X : Main system clock oscillation frequency 3. f XT : Subsystem clock oscillation frequency 4. × : Don't care 5. MCS [...]

  • Seite 250

    250 CHAPTER 11 WATCHDOG TIMER RUM 7 0 6 0 WDTM4 4 WDTM3 3210 FFF9H Address WDTM Symbol 000 5 00H After Reset R/W R/W RUN 0 1 Count stop Counter is cleared and counting starts. WDTM3 × 0 1 Interval timer mode Note 2 (Maskable interrupt request occurs upon generation of an overflow.) Watchdog timer mode 1 (Non-maskable interrupt request occurs upon [...]

  • Seite 251

    251 CHAPTER 11 WATCHDOG TIMER 11.4 Watchdog Timer Operations 11.4.1 Watchdog timer operation When bit 4 (WDTM4) of the watchdog timer mode register (WDTM) is set to 1, the watchdog timer is operated to detect any runaway. The watchdog timer count clock (runaway detection time interval) can be selected with bits 0 to 2 (TCL20 to TCL22) of the timer [...]

  • Seite 252

    252 CHAPTER 11 WATCHDOG TIMER 11.4.2 Interval timer operation The watchdog timer operates as an interval timer which generate interrupt request repeatedly at an interval of the preset count value when bit 4 (WDTM4) of the watchdog timer mode register (WDTM) is set to 0. A count clock (interval time) can be selected by the bits 0 through 2 (TCL20 th[...]

  • Seite 253

    253 CLOE PCL/P35 Pin Output ** CHAPTER 12 CLOCK OUTPUT CONTROL CIRCUIT 12.1 Clock Output Control Circuit Functions The clock output control circuit is intended for carrier output during remote controlled transmission and clock output for supply to peripheral LSI. Clocks selected with the timer clock select register 0 (TCL0) are output from the PCL/[...]

  • Seite 254

    254 CHAPTER 12 CLOCK OUTPUT CONTROL CIRCUIT 12.2 Clock Output Control Circuit Configuration The clock output control circuit consists of the following hardware. Table 12-1. Clock Output Control Circuit Configuration Item Configuration Timer clock select register 0 (TCL0) Port mode register 3 (PM3) Figure 12-2. Clock Output Control Circuit Block Dia[...]

  • Seite 255

    255 CHAPTER 12 CLOCK OUTPUT CONTROL CIRCUIT CLOE 7 TCL06 6 TCL05 TCL04 4 TCL03 3210 FF40H Address TCL0 Symbol TCL02 TCL01 TCL00 5 00H After Reset R/W R/W 0 0 0 0 1 1 1 1 1 Other than above 0 1 1 1 0 0 0 0 1 0 0 1 1 0 0 1 1 0 TCL03 TCL02 TCL01 f XT (32.768 kHz) f XX f XX /2 f XX /2 2 f XX /2 3 f XX /2 4 f XX /2 5 f XX /2 6 f XX /2 7 Setting prohibit[...]

  • Seite 256

    256 CHAPTER 12 CLOCK OUTPUT CONTROL CIRCUIT Remarks 1. f XX : Main system clock frequency (f X or f X /2) 2. f X : Main system clock oscillation frequency 3. f XT : Subsystem clock oscillation frequency 4. TI00 : 16-bit timer/event counter input pin 5. TM0 : 16-bit timer register 6. MCS : Bit 0 of oscillation mode selection register (OSMS) 7. Figur[...]

  • Seite 257

    257 Internal Bus f XX /2 9 f XX /2 10 f XX /2 11 TCL27 TCL26 TCL25 3 PM36 Selector Timer Clock Select Register 2 Port Mode Register 3 BUZ / P36 P36 Output Latch CHAPTER 13 BUZZER OUTPUT CONTROL CIRCUIT 13.1 Buzzer Output Control Circuit Functions The buzzer output control circuit outputs 1.2 kHz, 2.4 kHz, 4.9 kHz, or 9.8 kHz frequency square waves.[...]

  • Seite 258

    258 CHAPTER 13 BUZZER OUTPUT CONTROL CIRCUIT 13.3 Buzzer Output Function Control Registers The following two types of registers are used to control the buzzer output function. • Timer clock select register 2 (TCL2) • Port mode register 3 (PM3) (1) Timer clock select register 2 (TCL2) This register sets the buzzer output frequency. TCL2 is set w[...]

  • Seite 259

    259 CHAPTER 13 BUZZER OUTPUT CONTROL CIRCUIT TCL27 7 TCL26 6 TCL25 TCL24 4 0 3210 FF42H Address TCL2 Symbol TCL22 TCL21 TCL20 5 00H After Reset R/W R/W 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 TCL22 TCL21 TCL20 f XX /2 3 f XX /2 4 f XX /2 5 f XX /2 6 f XX /2 7 f XX /2 8 f XX /2 9 f XX /2 11 f X /2 3 f X /2 4 f X /2 5 f X /2 6 f X /2 7 f X /2[...]

  • Seite 260

    260 CHAPTER 13 BUZZER OUTPUT CONTROL CIRCUIT PM37 7 PM36 6 PM35 PM34 4 PM33 3210 FF23H Address PM3 Symbol PM32 PM31 PM30 5 FFH After Reset R/W R/W PM3n 0 1 Output mode (output buffer ON) Input mode (output buffer OFF) P3n Pin Input /Output Mode Selection (n = 0 to 7) (2) Port mode register 3 (PM3) This register sets port 3 input/output in 1-bit uni[...]

  • Seite 261

    261 CHAPTER 14 A/D CONVERTER 14.1 A/D Converter Functions The A/D converter converts an analog input into a digital value. It consists of 8 channels (ANI0 to ANI7) with an 8-bit resolution. The conversion method is based on successive approximation and the conversion result is held in the 8-bit A/D conversion result register (ADCR). The following t[...]

  • Seite 262

    262 CHAPTER 14 A/D CONVERTER 14.2 A/D Converter Configuration The A/D converter consists of the following hardware. Table 14-1. A/D Converter Configuration Item Configuration Analog input 8 Channels (ANI0 to ANI7) A/D converter mode register (ADM) Control register A/D converter input select register (ADIS) External interrupt mode register 1 (INTM1)[...]

  • Seite 263

    263 CHAPTER 14 A/D CONVERTER Figure 14-1. A/D Converter Block Diagram Notes 1. Selector to select the number of channels to be used for analog input. 2. Selector to select the channel for A/D conversion. 3. Bits 0 and 1 of External Interrupt Mode Register 1 (INTM1) ANI0/P10 ANI1/P11 ANI2/P12 ANI3/P13 ANI4/P14 ANI5/P15 ANI6/P16 ANI7/P17 Selector A /[...]

  • Seite 264

    264 CHAPTER 14 A/D CONVERTER (1) Successive approximation register (SAR) The analog input voltage value and the voltage tap (comparative voltage) value from the serial resistance string are compared and the results are stored in this register from the most significant bit (MSB). If values are stored to the least significant bit (LSB) (after A/D con[...]

  • Seite 265

    265 CHAPTER 14 A/D CONVERTER (7) AV REF0 pin This pin inputs the A/D converter reference voltage. It converts signals input to ANI0 to ANI7 into digital signals according to the voltage applied between AV REF0 and AV SS . The current flowing in the series resistor string can be reduced by setting the voltage to be input to the AV REF0 pin to AV SS [...]

  • Seite 266

    266 CHAPTER 14 A/D CONVERTER Figure 14-2. A/D Converter Mode Register Format Notes 1. Set so that the A/D conversion time is 19.1 µ s or more. 2. Setting prohibited because A/D conversion time is less than 19.1 µ s. Cautions 1. The following sequence is recommended for power consumption reduction of A/D converter when the standby function is used[...]

  • Seite 267

    267 CHAPTER 14 A/D CONVERTER (2) A/D converter input select register (ADIS) This register determines whether the ANI0/P10 to ANI7/P17 pins should be used for analog input channels or ports. Pins other than those selected as analog input can be used as input/output ports. ADIS is set with an 8-bit memory manipulation instruction. RESET input sets AD[...]

  • Seite 268

    268 CHAPTER 14 A/D CONVERTER ES71 7 ES70 6 ES61 ES60 4 ES51 3210 FFEDH Address INTM1 Symbol ES50 ES41 ES40 5 00H After Reset R/W R/W ES41 0 0 1 1 ES40 0 1 0 1 Falling edge Rising edge Setting prohibited Both falling and rising edges ES51 0 0 1 1 ES50 0 1 0 1 Falling edge Rising edge Setting prohibited Both falling and rising edges ES61 0 0 1 1 ES60[...]

  • Seite 269

    269 CHAPTER 14 A/D CONVERTER 14.4 A/D Converter Operations 14.4.1 Basic operations of A/D converter (1) Set the number of analog input channels with A/D converter input select register (ADIS). (2) From among the analog input channels set with ADIS, select one channel for A/D conversion with A/D converter mode register (ADM). (3) The voltage input t[...]

  • Seite 270

    270 CHAPTER 14 A/D CONVERTER SAR ADCR INTAD A / D Converter Operation Sampling Time Sampling A / D Conversion Conversion Time Undefined 80H C0H or 40H Conversion Result Conversion Result Figure 14-5. A/D Converter Basic Operation A/D conversion operations are performed continuously until bit 7 (CS) of ADM is reset (0) by software. If a write to the[...]

  • Seite 271

    271 CHAPTER 14 A/D CONVERTER 1 512 1 256 3 512 2 256 5 512 3 256 507 512 254 256 509 512 255 256 511 512 1 255 254 253 3 2 1 0 A /D Conversion Results (ADCR) Input Voltage/AV REF0 14.4.2 Input voltage and conversion results The relation between the analog input voltage input to the analog input pins (ANI0 to ANI7) and the A/D conversion result (the[...]

  • Seite 272

    272 CHAPTER 14 A/D CONVERTER ADM Rewrite CS=1, TRG=1 Standby State ANIn INTP3 A /D Conversion ADCR INTAD ANIn ANIn ANIn ANIm ANIm ANIn ANIn Standby State Standby State ADM Rewrite CS=1, TRG=1 ANIm ANIm ANIm 14.4.3 A/D converter operating mode Select 1 analog input channel from ANI0-ANI7 by the A/D converter input select register (ADIS) and the A/D [...]

  • Seite 273

    273 CHAPTER 14 A/D CONVERTER Conversion Start CS=1, TRG=0 A /D Conversion ADCR INTAD ANIn ANIn ANIm ANIn ANIm ANIm ANIn ANIn ADM Rewrite CS=1, TRG=0 ADM Rewrite CS=0, TRG=0 Conversion suspended Conversion results are not stored Stop (2) A/D conversion operation in software start When bit 6 (TRG) and bit 7 (CS) of A/D converter mode register (ADM) a[...]

  • Seite 274

    274 CHAPTER 14 A/D CONVERTER 14.5 A/D Converter Cautions (1) Power consumption in standby mode The A/D converter operates on the main system clock. Therefore, its operation stops in STOP mode or in HALT mode with the subsystem clock. As a current still flows in the AV REF0 pin at this time, this current must be cut in order to minimize the overall [...]

  • Seite 275

    275 CHAPTER 14 A/D CONVERTER (3) Noise countermeasures In order to maintain 8-bit resolution, attention must be paid to noise on pins AV REF0 and ANI0 to ANI7. Since the effect increases in proportion to the output impedance of the analog input source, it is recommended that a capacitor be connected externally as shown in Figure 14-10 in order to r[...]

  • Seite 276

    276 CHAPTER 14 A/D CONVERTER A /D Conversion ADCR INTAD ANIn ANIn ANIm ANIm ANIn ANIn ANIm ANIm ADM Rewrite (Start of ANIn Conversion) ADM Rewrite (Start of ANIm Conversion) ADIF is set but ANIm conversion has not ended (6) Interrupt request flag (ADIF) The interrupt request flag (ADIF) is not cleared even if the A/D converter mode register (ADM) i[...]

  • Seite 277

    277 CHAPTER 14 A/D CONVERTER (7) AV DD pin The AV DD pin is the analog circuit power supply pin, and supplies power to the input circuits of ANI0/P10 to ANI7/P17. Therefore, be sure to apply the same voltage as V DD to this pin even when the application circuit is designed so as to switch to a backup battery. Figure 14-12. Connection of AV DD Pin N[...]

  • Seite 278

    278 [MEMO][...]

  • Seite 279

    279 CHAPTER 15 D/A CONVERTER 15.1 D/A Converter Functions The D/A converter converts a digital input into an analog value. It consists of two 8-bit resolution channels of voltage output type D/A converter. The conversion method used is the R-2R resistor ladder method. D/A conversion is started by setting the DACE0 and DACE1 of the D/A converter mod[...]

  • Seite 280

    280 CHAPTER 15 D/A CONVERTER 15.2 D/A Converter Configuration The D/A converter consists of the following hardware. Table 15-1. D/A Converter Configuration Item Configuration D/A conversion value set register 0 (DACS0) D/A conversion value set register 1 (DACS1) Control register D/A converter mode register (DAM) Figure 15-1. D/A Converter Block Dia[...]

  • Seite 281

    281 CHAPTER 15 D/A CONVERTER (1) D/A conversion value set register 0, 1 (DACS0, DACS1) DACS0 and DACS1 are registers where values are set for determining the analog voltage output respectively to pins ANO0 and ANO1. DACS0 and DACS1 are set with 8-bit memory manipulation instructions. RESET input sets these registers to 00H. Analog voltage output to[...]

  • Seite 282

    282 CHAPTER 15 D/A CONVERTER 0 7 0 6 DAM5 DAM4 4 0 3210 FF98H Address DAM Symbol 0 DACE1 DACE0 5 00H After Reset R/W R/W DAM5 0 1 Normal mode Real-time output mode DACE0 0 1 D/A conversion stop D/A conversion enable DACE1 0 1 D/A conversion stop D/A conversion enable DAM4 0 1 Normal mode Real-time output mode D/A Converter Channel 0 Control D/A Con[...]

  • Seite 283

    283 CHAPTER 15 D/A CONVERTER 15.4 Operations of D/A Converter (1) Select the operation mode for channel 0 using bit 4 (DAM4) of the D/A converter mode register (DAM), and select the operation mode for channel 1 using bit 5 (DAM5). (2) Set data corresponding to the analog voltage values output respectively to pins ANO0/P130 and ANO1/P131 in D/A conv[...]

  • Seite 284

    284 CHAPTER 15 D/A CONVERTER 15.5 Cautions Related to D/A Converter (1) Output impedance of D/A converter Because the output impedance of the D/A converter is high, use of current flowing from the ANOn pins (n = 0,1) is prohibited. If the input impedance of the load for the converter is low, insert a buffer amplifier between the load and the ANOn p[...]

  • Seite 285

    285 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) The µ PD78058F Subseries incorporates three channels of serial interfaces. Differences between channels 0, 1, and 2 are as follows (Refer to CHAPTER 18 SERIAL INTERFACE CHANNEL 1 for details of the serial interface channel 1. Refer to CHAPTER 19 SERIAL INTERFACE CHANNEL 2 for detai[...]

  • Seite 286

    286 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 16.1 Serial Interface Channel 0 Functions Serial interface channel 0 employs the following four modes. • Operation stop mode • 3-wire serial I/O mode • SBI (serial bus interface) mode • 2-wire serial I/O mode Caution Do not switch the operating mode (3-wire serial I/O/ 2-wir[...]

  • Seite 287

    287 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (4) 2-wire serial I/O mode (MSB-first) This mode is used for 8-bit data transfer using two lines of serial clock (SCK0) and serial data bus (SB0 or SB1). This mode enables to cope with any one of the possible data transfer formats by controlling the SCK0 level and the SB0 or SB1 out[...]

  • Seite 288

    288 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 16.2 Serial Interface Channel 0 Configuration Serial interface channel 0 consists of the following hardware. Table 16-2. Serial Interface Channel 0 Configuration Item Configuration Serial I/O shift register 0 (SIO0) Slave address register (SVA) Timer clock select register 3 (TCL3) S[...]

  • Seite 289

    289 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) CSIE0 COI WUP CSIM 04 CSIM 03 CSIM 02 CSIM 01 CSIM 00 Serial Operating Mode Register 0 Control Circuit Output Control Selector SI0/SB0/ P25 PM25 Output Control SO0/SB1/ P26 PM26 Output Control SCK0/ P27 PM27 Selector P25 Output Latch P26 Output Latch CLD P27 Output Latch Internal Bu[...]

  • Seite 290

    290 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (1) Serial I/O shift register 0 (SIO0) This is an 8-bit register to carry out parallel/serial conversion and to carry out serial transmission/reception (shift operation) in synchronization with the serial clock. SIO0 is set with an 8-bit memory manipulation instruction. When bit 7 ([...]

  • Seite 291

    291 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (3) SO0 latch This latch holds the SI0/SB0/P25 and SO0/SB1/P26 pin levels. It can be directly controlled by software. In the SBI mode, this latch is set upon termination of the 8th serial clock. (4) Serial clock counter This counter counts the serial clocks to be output and input du[...]

  • Seite 292

    292 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 16.3 Serial Interface Channel 0 Control Registers The following four types of registers are used to control serial interface channel 0. • Timer clock select register 3 (TCL3) • Serial operating mode register 0 (CSIM0) • Serial bus interface control register (SBIC) • Interrup[...]

  • Seite 293

    293 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) Serial Interface Channel 0 Serial Clock Selection TCL33 TCL32 TCL31 TCL30 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 f XX /2 f XX /2 2 f XX /2 3 f XX /2 4 f XX /2 5 f XX /2 6 f XX /2 7 f XX /2 8 Setting prohibited f X /2 2 (1.25 MHz) f X /2 3 (625 kHz) f X /2 4 [...]

  • Seite 294

    294 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (2) Serial operating mode register 0 (CSIM0) This register sets serial interface channel 0 serial clock, operating mode, operation enable/stop wake-up function and displays the address comparator match signal. CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction. RESET[...]

  • Seite 295

    295 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) WUP 0 1 Wake-up Function Control Note 1 Interrupt request signal generation with each serial transfer in any mode Interrupt request signal generation when the address received after bus release (when CMDD = RELD = 1) matches the slave address register (SVA) data in SBI mode R/W COI [...]

  • Seite 296

    296 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (3) Serial bus interface control register (SBIC) This register sets serial bus interface operation and displays statuses. SBIC is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets SBIC to 00H. Figure 16-5. Serial Bus Interface Control Register Format (1/2) [...]

  • Seite 297

    297 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) Figure 16-5. Serial Bus Interface Control Register Format (2/2) Note The busy mode can be canceled by starting serial interface transfer. However, the BSYE flag is not cleared to 0. Remark CSIE0: Bit 7 of Serial Operation Mode Register 0 (CSIM0) ACKE Acknowledge Signal Automatic Out[...]

  • Seite 298

    298 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (4) Interrupt timing specify register (SINT) This register sets the bus release interrupt and address mask functions and displays the SCK0/P27 pin level status. SINT is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets SINT to 00H. Figure 16-6. Interrupt Ti[...]

  • Seite 299

    299 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 6543210 7 Symbol CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/W Address After Reset R/W CSIE0 0 Serial Interface Channel 0 Operation Control Operation stopped Operation enabled R/W 1 16.4 Serial Interface Channel 0 Operations The following four operating modes [...]

  • Seite 300

    300 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 16.4.2 3-wire serial I/O mode operation The 3-wire serial I/O mode is valid for connection of peripheral I/O units and display controllers which incorporate a conventional synchronous clocked serial interface as is the case with the 75X/XL, 78K, and 17K Series. Communication is carr[...]

  • Seite 301

    301 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 6543210 7 Symbol CSIM0 CSIM01 0 1 Serial Interface Channel 0 Clock Selection Input Clock to SCK0 pin from off-chip 8-bit timer register 2 (TM2) output 0 SBI mode (see section 16.4.3 SBI mode operation .) R/W 1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3) [...]

  • Seite 302

    302 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 6543210 7 Symbol SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT RELT When RELT = 1, SO0 Iatch is set to 1. After SO0 Iatch setting, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W FF61H 00H R/W Address After Reset R/W CMDT When CMDT = 1, SO0 Iatch is cleared to 0. Af[...]

  • Seite 303

    303 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) RELT CMDT SO0 latch SI0 SCK0 12345678 DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0 SO0 DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0 CSIIF0 Transfer Start at the Falling Edge of SCK0 End of Transfer (2) Communication operation The 3-wire serial I/O mode is used for data transmission/reception in 8-bit units. [...]

  • Seite 304

    304 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 7 6 Internal Bus 1 0 LSB-first MSB-first Read/Write Gate SI0 Serial I/O Shift Register 0 (SIO0) Read/Write Gate SO0 SCK0 DQ SO0 Latch (4) MSB/LSB switching as the start bit The 3-wire serial I/O mode enables to select transfer to start from MSB or LSB. Figure 16-9 shows the configur[...]

  • Seite 305

    305 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 16.4.3 SBI mode operation SBI (Serial Bus Interface) is a high-speed serial interface in compliance with the NEC serial bus format. SBI uses a single master device and employs the clocked serial I/O format with the addition of a bus configuration function. This function enables devi[...]

  • Seite 306

    306 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (1) SBI functions In the conventional serial I/O format, when a serial bus is configured by connecting two or more devices, many ports and wiring are necessary, to provide chip select signal to identify command and data, and to judge the busy state, because only the data transfer fu[...]

  • Seite 307

    307 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (2) SBI definition The SBI serial data format and the signals to be used are defined as follows. Serial data to be transferred with SBI consists of three kinds of data: “address”, “command”, and “data”. Figure 16-11 shows the address, command, and data transfer timings. [...]

  • Seite 308

    308 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) SCK0 "H" SB0 (SB1) SCK0 "H" SB0 (SB1) (a) Bus release signal (REL) The bus release signal is a signal with the SB0 (SB1) line which has changed from the low level to the high level when the SCK0 line is at the high level (without serial clock output). This signal[...]

  • Seite 309

    309 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) Master Slave 1 Not Selected Slave 2 Selected Slave 3 Not Selected Slave 4 Not Selected Slave 2 Address Transmission SCK0 A7 A6 A5 A4 A3 A2 A1 A0 12345 67 8 SB0 (SB1) Address Command Signal Bus Release Signal (c) Address An address is 8-bit data which the master device outputs to the[...]

  • Seite 310

    310 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (d) Command and data The master device transmits commands to, and transmits/receives data to/from the slave device selected by address transmission. Figure 16-16. Commands Figure 16-17. Data 8-bit data following a command signal is defined as “command” data. 8-bit data without c[...]

  • Seite 311

    311 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 89 ACK SCK0 SB0 (SB1) SCK0 SB0 (SB1) 8 9 10 11 ACK (e) Acknowledge signal (ACK) The acknowledge signal is used to check serial data reception between transmitter and receiver. Figure 16-18. Acknowledge Signal [When output in synchronization with 11th clock SCK0] [When output in sync[...]

  • Seite 312

    312 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) READY ACK SCK0 SB0 (SB1) BUSY 89 (f) Busy signal (BUSY) and ready signal (READY) The BUSY signal is intended to report to the master device that the slave device is preparing for data transmission/reception. The READY signal is intended to report to the master device that the slave [...]

  • Seite 313

    313 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) Notes 1. Bit 6 (COI) is a read-only bit. 2. Can be used as a port. 3. To use the wake-up function (WUP = 1), clear the bit 5 (SIC) of the interrupt timing specify register (SINT) to 0. 4. When CSIE0 = 0, COI becomes 0. 5. In the SBI mode, the operation of serial interface channel 0 [...]

  • Seite 314

    314 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (b) Serial bus interface control register (SBIC) SBIC is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets SBIC to 00H. The shaded area is used in the SBI mode. Note Bits 2, 3, and 6 (RELD, CMDD and ACKD) are read-only bits. Remarks 1. Bits 0, 1, and 4 (REL[...]

  • Seite 315

    315 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) R ACKD Acknowledge Detection Clear Conditions (ACKD = 0) • SCK0 fall immediately after the busy mode is released during the transfer start instruction execution. • When CSIE0 = 0 • When RESET input is applied Set Conditions (ACKD = 1) • When acknowledge signal (ACK) is detec[...]

  • Seite 316

    316 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 6543210 7 Symbol SINT 0 CLD SIC SVAM 0 0 0 0 FF63H 00H R/W Note 1 Address After Reset R/W SVAM 0 1 SVA Bit to be Used as Slave Address Bits 0 to 7 Bits 1 to 7 SIC 0 INTCSI0 Interrupt Source Selection Note 2 CSIIF0 is set upon termination of serial interface channel 0 transfer CSIIF0[...]

  • Seite 317

    317 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) Write FFH to SIO0 (Transfer Start Instruction) SIO0 SCK0 SB0 (SB1) RELD CMDD Transfer Start Instruction A7 A6 A1 A0 1 2 789 READY A7 A6 A1 A0 ACK Slave Address When Addresses Match When Addresses do not Match SCK0 SB0 (SB1) RELT CMDT CMDD RELD SIO0 Slave address write to SIO0 (Trans[...]

  • Seite 318

    318 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) SCK0 6 SB0 (SB1) ACKT 7 8 9 D2 D1 D0 ACK When set during this period ACK signal is output for a period of one clock just after setting Figure 16-22. ACKT Operation Caution Do not set ACKT before termination of transfer.[...]

  • Seite 319

    319 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) SB0 (SB1) ACKE If set and cleared during this period and ACKE = 0 at the falling edge of SCK0 ACK signal is not output D2 D1 D0 SCK0 SB0 (SB1) ACKE 1 2 789 D7 D6 D2 D1 D0 When ACKE = 0 at this point ACK signal is not output SCK0 Figure 16-23. ACKE Operations (a) When ACKE = 1 upon c[...]

  • Seite 320

    320 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) SCK0 SB0 (SB1) BSYE 7 89 ACK 6 When BSYE = 1 at this point BUSY If reset during this period and BSYE = 0 at the falling edge of SCK0 D2 D1 D0 SB0 (SB1) ACKD ACK 9 SIO0 78 D1 6 D2 D0 Transfer Start Instruction Transfer Start SCK0 Figure 16-24. ACKD Operations (a) When ACK signal is o[...]

  • Seite 321

    321 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) SCK0 D0 READY SB0 (SB1) D0 READY SB0 (SB1) ACK BUSY BUSY ACK 9 "H" SB0 (SB1) SCK0 SCK0 "H" SB0 (SB1) Table 16-3. Various Signals in SBI Mode (1/2) Timing Chart Definition Signal Name Output Device Output Condition Effects on Flag Meaning of Signal CMD signal is o[...]

  • Seite 322

    322 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) SCK0 SB0 (SB1) 1278 SCK0 SB0 (SB1) 1278 CMD SCK0 SB0 (SB1) 1278 REL CMD SCK0 SB0 (SB1) 12789 1 0 Timing Chart Definition Signal Name Output Device Output Condition Effects on Flag Meaning of Signal Synchronous clock to output address/command/ data, ACK signal, synchro- nous BUSY sig[...]

  • Seite 323

    323 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (5) Pin configuration The serial clock pin SCK0 and serial data bus pin SB0 (SB1) have the following configurations. (a) SCK0 ............ Serial clock input/output pin <1> Master .. CMOS and push-pull output <2> Sl ave .... Schmitt input (b) SB0 (SB1) .... Serial data i[...]

  • Seite 324

    324 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (6) Address match detection method In the SBI mode, the master transmits a slave address to select a specific slave device. Coincidence of the addresses can be automatically detected by hardware. CSIIF0 is set only when the slave address transmitted by the master coincides with the [...]

  • Seite 325

    325 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 1 2 3 4 5 6 7 8 9 SCK0 Pin A7 A6 A5 A4 A3 A2 A1 A0 ACK BUSY SB0 (SB1) Pin Program Processing Serial Transmission INTCSI0 Generation ACKD Set SCK0 Stop Hardware Operation WUP ← 0 ACKT Set Program Processing CMDD Set INTCSI0 Generation ACK Output Hardware Operation CMDT Set RELT Set[...]

  • Seite 326

    326 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 1 2 3 4 5 6 7 8 9 SCK0 Pin C7 C6 C5 C4 C3 C2 C1 C0 ACK BUSY SB0 (SB1) Pin Program Processing Serial Transmission INTCSI0 Generation ACKD Set SCK0 Stop Hardware Operation ACKT Set Program Processing INTCSI0 Generation ACK Output Hardware Operation CMDT Set Write to SIO0 Interrupt Ser[...]

  • Seite 327

    327 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 1 2 3 4 5 6 7 8 9 SCK0 Pin D7 D6 D5 D4 D3 D2 D1 D0 ACK BUSY SB0 (SB1) Pin Program Processing Serial Transmission INTCSI0 Generation ACKD Set SCK0 Stop Hardware Operation ACKT Set Program Processing INTCSI0 Generation ACK Output Hardware Operation Write to SIO0 Interrupt Servicing (P[...]

  • Seite 328

    328 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 1 2 3 4 5 6 7 8 9 SCK0 Pin D7 D6 D5 D4 D3 D2 D1 D0 ACK BUSY SB0 (SB1) Pin Program Processing Serial Reception INTCSI0 Generation ACK Output Serial Reception Hardware Operation Program Processing INTCSI0 Generation ACKD Set Hardware Operation FFH Write to SIO0 Master Device Processin[...]

  • Seite 329

    329 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (9) Transfer start Serial transfer is started by setting transfer data to the serial I/O shift register 0 (SIO0) when the following two conditions are satisfied. • Serial interface channel 0 operation control bit (CSIE0) = 1 • Internal serial clock is stopped or SCK0 is at high [...]

  • Seite 330

    330 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (10) How to determine the slave busy state When a device is in the master mode, use the following procedure to determine if the slave is in the busy state or not. <1> Detect the generation of an acknowledge signal (ACK) or interrupt request signal. <2> Set the port mode [...]

  • Seite 331

    331 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 16.4.4 2-wire serial I/O mode operation The 2-wire serial I/O mode can cope with any communication format by program. Communication is basically carried out with two lines of serial clock (SCK0) and serial data input/output (SB0 or SB1). Figure 16-31. Serial Bus Configuration Exampl[...]

  • Seite 332

    332 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 6543210 7 Symbol CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 CSIM01 0 1 Serial Interface Channel 0 Clock Selection Input Clock to SCK0 pin from off-chip 8-bit timer register 2 (TM2) output R/W 1 Clock specified with bits 0 to 3 of timer clock select register 3 (TCL3) CSIM[...]

  • Seite 333

    333 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) 6543210 7 Symbol SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT RELT When RELT = 1, SO0 Iatch is set to 1. After SO0 Iatch setting, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W FF61H 00H R/W Address After Reset R/W CMDT When CMDT = 1, SO0 Iatch is cleared to 0. Af[...]

  • Seite 334

    334 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) (2) Communication operation The 2-wire serial I/O mode is used for data transmission/reception in 8-bit units. Data transmission/reception is carried out bit-wise in synchronization with the serial clock. Shift operation of the serial I/O shift register 0 (SIO0) is carried out in sy[...]

  • Seite 335

    335 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) RELT CMDT SO0 Latch (3) Other signals Figure 16-33 shows RELT and CMDT operations. Figure 16-33. RELT and CMDT Operations (4) Transfer start Serial transfer is started by setting transfer data to the serial I/O shift register 0 (SIO0) when the following two conditions are satisfied.[...]

  • Seite 336

    336 CHAPTER 16 SERIAL INTERFACE CHANNEL 0 ( µ PD78058F SUBSERIES) To Internal Circuit SCK0/P27 P27 Output Latch When CSIE0 = 1 and CSIM01 and CSIM00 are 1 and 0, or 1 and 1. SCK0 (1 while transfer is stopped) From Serial Clock Control Circuit Manipulated by bit manipulation instruction 16.4.5 SCK0/P27 pin output manipulation Because the SCK0/P27 p[...]

  • Seite 337

    337 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) The µ PD78058FY Subseries incorporates three channels of serial interfaces. Differences between channels 0, 1, and 2 are as follows (Refer to CHAPTER 18 SERIAL INTERFACE CHANNEL 1 for details of the serial interface channel 1. Refer to CHAPTER 19 SERIAL INTERFACE CHANNEL 2 for det[...]

  • Seite 338

    338 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 17.1 Serial Interface Channel 0 Functions Serial interface channel 0 employs the following four modes. • Operation stop mode • 3-wire serial I/O mode • 2-wire serial I/O mode •I 2 C (Inter IC) bus mode Caution Do not switch the operating mode (3-wire serial I/O/ 2-wire seri[...]

  • Seite 339

    339 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (4) I 2 C (Inter IC) bus mode (MSB-first) This mode is used for 8-bit data transfer with two or more devices using two lines of serial clock (SCL) and serial data bus (SDA0 or SDA1). This mode is in compliance with the I 2 C bus format. In this mode, the transmitter outputs three k[...]

  • Seite 340

    340 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 17.2 Serial Interface Channel 0 Configuration Serial interface channel 0 consists of the following hardware. Table 17-2. Serial Interface Channel 0 Configuration Item Configuration Serial I/O shift register 0 (SIO0) Slave address register (SVA) Timer clock select register 3 (TCL3) [...]

  • Seite 341

    341 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) Figure 17-2. Serial Interface Channel 0 Block Diagram CSIE0 COI WUP CSIM 04 CSIM 03 CSIM 02 CSIM 01 CSIM 00 Serial Operating Mode Register 0 Control Circuit Output Control Selector SI0/SB0/ SDA0/P25 PM25 Output Control SO0/SB1/ SDA1/P26 PM26 Output Control SCK0/ SCL/P27 PM27 Select[...]

  • Seite 342

    342 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (1) Serial I/O shift register 0 (SIO0) This is an 8-bit register to carry out parallel-serial conversion and to carry out serial transmission/reception (shift operation) in synchronization with the serial clock. SIO0 is set with an 8-bit memory manipulation instruction. When bit 7 [...]

  • Seite 343

    343 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (3) SO0 latch This latch holds SI0/SB0/SDA0/P25 and SO0/SB1/SDA1/P26 pin levels. It can be directly controlled by software. (4) Serial clock counter This counter counts the serial clocks to be output and input during transmission/reception and to check whether 8-bit data has been t[...]

  • Seite 344

    344 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) Table 17-3. Serial Interface Channel 0 Interrupt Request Signal Generation Serial Transfer mode BSYE WUP WAT1 WAT0 ACKE Description 3-wire or 2-wire serial I/O 0 0 0 0 0 An interrupt request signal is generated each mode time 8 serial clocks are counted. Other than above Setting pr[...]

  • Seite 345

    345 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 17.3 Serial Interface Channel 0 Control Registers The following four types of registers are used to control serial interface channel 0. • Timer clock select register 3 (TCL3) • Serial operating mode register 0 (CSIM0) • Serial bus interface control register (SBIC) • Interru[...]

  • Seite 346

    346 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) Serial Interface Channel 0 Serial Clock Selection Serial Interface Channel 1 Serial Clock Selection TCL33 TCL32 TCL31 TCL30 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 f XX /2 5 f XX /2 6 f XX /2 7 f XX /2 8 f XX /2 9 f XX /2 10 f XX /2 11 f XX /2 12 MCS = 1 Set[...]

  • Seite 347

    347 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (2) Serial operating mode register 0 (CSIM0) This register sets serial interface channel 0 serial clock, operating mode, operation enable/stop wake-up function and displays the address comparator match signal. CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction. RESE[...]

  • Seite 348

    348 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) Figure 17-4. Serial Operating Mode Register 0 Format Notes 1. Bit 6 (COI) is a read-only bit. 2. I 2 C bus mode, the clock frequency becomes 1/16 of that output from TO2. 3. Can be used as P25 (CMOS input/output) when used only for transmission. 4. Can be used freely as port functi[...]

  • Seite 349

    349 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (3) Serial bus interface control register (SBIC) This register sets serial bus interface operation and displays statuses. SBIC is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets SBIC to 00H. Figure 17-5. Serial Bus Interface Control Register Format (1/2)[...]

  • Seite 350

    350 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) Figure 17-5. Serial Bus Interface Control Register Format (2/2) Notes 1. Setting should be performed before transfer. 2. If 8-clock wait mode is selected, the acknowledge signal at reception time must be output using ACKT. 3. The busy mode can be canceled by start of serial interfa[...]

  • Seite 351

    351 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (4) Interrupt timing specify register (SINT) This register sets the bus release interrupt and address mask functions and displays the SCK0/SCL pin level status. SINT is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets SINT to 00H. Figure 17-6. Interrupt T[...]

  • Seite 352

    352 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) Figure 17-6. Interrupt Timing Specify Register Format (2/2) Notes 1. When using wake-up function in the I 2 C mode, set SIC to 1. 2. When CSIE0 = 0, CLD becomes 0. Remark SVA : Slave address register CSIIF0 : Interrupt request flag corresponding to INTCSI0 CSIE0 : Bit 7 of Serial O[...]

  • Seite 353

    353 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 6543210 7 Symbol CSIM0 CSIE0 COI WUP CSIM04 CSIM03 CSIM02 CSIM01 CSIM00 FF60H 00H R/W Address After Reset R/W CSIE0 0 Serial Interface Channel 0 Operation Control Operation stopped Operation enabled R/W 1 17.4 Serial Interface Channel 0 Operations The following four operating modes[...]

  • Seite 354

    354 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 17.4.2 3-wire serial I/O mode operation The 3-wire serial I/O mode is valid for connection of peripheral I/O units and display controllers which incorporate a conventional synchronous clocked serial interface as is the case with the 75X/XL, 78K, and 17K Series. Communication is car[...]

  • Seite 355

    355 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (b) Serial bus interface control register (SBIC) SBIC is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets SBIC to 00H. 6543210 7 Symbol SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT RELT When RELT = 1, SO0 Iatch is set to 1. After SO0 Iatch setting, automa[...]

  • Seite 356

    356 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) RELT CMDT SO0 latch SI0 SCK0 12345678 DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0 SO0 DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0 CSIIF0 Transfer Start at the Falling Edge of SCK0 End of Transfer (2) Communication operation The 3-wire serial I/O mode is used for data transmission/reception in 8-bit units.[...]

  • Seite 357

    357 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 7 6 Internal Bus 1 0 LSB-first MSB-first Read/Write Gate SI0 Serial I/O Shift Register 0 (SIO0) Read/Write Gate SO0 SCK0 DQ SO0 Latch (4) MSB/LSB switching as the start bit The 3-wire serial I/O mode enables to select transfer to start from MSB or LSB. Figure 17-9 shows the configu[...]

  • Seite 358

    358 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 17.4.3 2-wire serial I/O mode operation The 2-wire serial I/O mode can cope with any communication format by program. Communication is basically carried out with two lines of serial clock (SCK0) and serial data input/output (SB0 or SB1). Figure 17-10. Serial Bus Configuration Examp[...]

  • Seite 359

    359 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (a) Serial operating mode register 0 (CSIM0) CSIM0 is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets CSIM0 to 00H. Notes 1. Bit 6 (COI) is a read-only bit. 2. Can be used freely as port function. 3. Be sure to set WUP to 0 when the 2-wire serial I/O mod[...]

  • Seite 360

    360 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 6543210 7 Symbol SBIC BSYE ACKD ACKE ACKT CMDD RELD CMDT RELT RELT When RELT = 1, SO0 Iatch is set to 1. After SO0 Iatch setting, automatically cleared to 0. Also cleared to 0 when CSIE0 = 0. R/W FF61H 00H R/W Address After Reset R/W CMDT When CMDT = 1, SO0 Iatch is cleared to 0. A[...]

  • Seite 361

    361 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 12345678 SCK0 D7 D6 D5 D4 D3 D2 D1 D0 SB0 (SB1) CSIIF0 Transfer Start at the Fallin g Ed g e of SCK0 End of Transfer (2) Communication operation The 2-wire serial I/O mode is used for data transmission/reception in 8-bit units. Data transmission/reception is carried out bit-wise in[...]

  • Seite 362

    362 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) RELT CMDT SO0 Latch (3) Other signals Figure 17-12 shows RELT and CMDT operations. Figure 17-12. RELT and CMDT Operations (4) Transfer start Serial transfer is started by setting transfer data to the serial I/O shift register 0 (SIO0) when the following two conditions are satisfied[...]

  • Seite 363

    363 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 17.4.4 I 2 C bus mode operation The I 2 C bus mode is provided for when communication operations are performed between a single master device and multiple slave devices. This mode configures a serial bus that includes only a single master device, and is based on the clocked serial [...]

  • Seite 364

    364 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 1-7 8 9 1-7 8 9 1-7 8 9 Address R/W ACK Data ACK Data ACK SCL Start Condition SDA0(SDA1) Stop Condition (1) I 2 C bus mode functions In the I 2 C bus mode, the following functions are available. (a) Automatic identification of serial data Slave devices automatically detect and iden[...]

  • Seite 365

    365 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 2 3 456 7 A6 A5 A4 A3 A2 A1 A0 R/W Transfer direction specification SCL 8 1 SDA0(SDA1) 1 2 3 456 7 A6 A5 A4 A3 A2 A1 A0 R/W Address SCL SDA0(SDA1) H SCL SDA0(SDA1) (a) Start condition When the SDA0 (SDA1) pin level is changed from high to low while the SCL pin is high, this transit[...]

  • Seite 366

    366 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) H SCL SDA0(SDA1) 12 3 456 7 A6 A5 A4 A3 A2 A1 A0 R/W SCL SDA0 (SDA1) 9 8 ACK (d) Acknowledge signal (ACK) The acknowledge signal indicates that the transferred serial data has definitely been received. This signal is used between the sending side and receiving side devices for conf[...]

  • Seite 367

    367 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (f) Wait signal (WAIT) The wait signal is output by a slave device to inform the master device that the slave device is in wait state due to preparing for transmitting or receiving data. During the wait state, the slave device continues to output the wait signal by keeping the SCL [...]

  • Seite 368

    368 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (3) Register setting The I 2 C bus mode is set by the serial operating mode register 0 (CSIM0), serial bus interface control register (SBIC), and interrupt timing specify register (SINT). (a) Serial operating mode register 0 (CSIM0) CSIM0 is set by a 1-bit or 8-bit memory manipulat[...]

  • Seite 369

    369 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (b) Serial bus interface control register (SBIC) SBIC is set by a 1-bit or 8-bit memory manipulation instruction. RESET input sets SBIC to 00H. R/W RELT Use for stop condition output. When RELT = 1, SO0 latch is set to 1. After SO0 latch setting, automati- cally cleared to 0. Also [...]

  • Seite 370

    370 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (c) Interrupt timing specification register (SINT) SINT is set by the 1-bit or 8-bit memory manipulation instruction. RESET input sets SINT to 00H. R/W WAT1 WAT0 Interrupt Control by Wait Note 2 0 0 Interrupt service request is generated on rise of 8th SCK0 clock cycle (clock outpu[...]

  • Seite 371

    371 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (4) Various signals A list of signals in the I 2 C bus mode is given in Table 17-4. Table 17-4. Signals in I 2 C Bus Mode Signal Name Description Start condition Definition : SDA0 (SDA1) falling edge when SCL is high Note 1 Function : Indicates that serial communication starts and [...]

  • Seite 372

    372 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (5) Pin configurations The configurations of the serial clock pin SCL and the serial data bus pins SDA0 (SDA1) are shown below. (a) SCL Pin for serial clock input/output dual-function pin. <1> Master ..... N-ch open-drain output <2> Slave ....... Schmitt input (b) SDA0 [...]

  • Seite 373

    373 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (7) Error detection In the I 2 C bus mode, transmission error detection can be performed by the following methods because the serial bus SDA0 (SDA1) status during transmission is also taken into the serial I/O shift register 0 (SIO0) register of the transmitting device. (a) Compari[...]

  • Seite 374

    374 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) Figure 17-22. Data Transmission from Master to Slave (Both Master and Slave Selected 9-Clock Wait) (1/3) (a) Start Condition to Address L L L 1 A5 A4 A3 A2 A1 A0 W ACK A6 2 3 4 567 8 D7 D6 D5 D4 D3 12 34 5 9 L L L L L SIO0 ← Address Master Device Operation Transfer Line Slave Dev[...]

  • Seite 375

    375 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) L L L L 1 D5 D4 D3 D2 D1 D0 ACK D6 D7 2 3 4 567 8 D7 D6 D5 D4 D3 12 34 5 9 L L L L L L L SIO0 ← Address Master Device Operation Transfer Line SIO0 ← Data H L L L L L L L H H H H SIO0 ← FFH SIO0 ← FFH Write SIO0 COI ACKD CMDD RELD CLD P27 SCL SDA0 WUP BSYE ACKE CMDT RELT CLC[...]

  • Seite 376

    376 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) L L 1 D5 D4 D3 D2 D1 D0 ACK D6 D7 2 3 4 567 8 A6 A5 A4 A3 12 34 9 L L L L SIO0 ← Data Master Device Operation Transfer Line SIO0 ← Address H L L L L H H H SIO0 ← FFH Write SIO0 COI ACKD CMDD RELD CLD P27 SCL SDA0 WUP BSYE ACKE CMDT RELT CLC WREL SIC INTCSI0 Write SIO0 COI ACK[...]

  • Seite 377

    377 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) L L L 1 A0 A1 A2 A3 A4 A5 A6 R ACK 2 3 4 567 8 D6 D7 D5 D4 D3 2 13 4 5 9 L L L SIO0 ← Address Master Device Operation Transfer Line SIO0 ← FFH H L L L L L L L H H Write SIO0 COI ACKD CMDD RELD CLD P27 SCL SDA0 WUP BSYE ACKE CMDT RELT CLC WREL SIC INTCSI0 Write SIO0 COI ACKD CMD[...]

  • Seite 378

    378 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) L L L L H H L 1 D1 D0 D2 D3 D4 D5 D6 D7 ACK 2 3 4 567 8 D6 D7 D5 D4 D3 2 13 4 5 9 L L L SIO0 ← FFH Master Device Operation Transfer Line SIO0 ← FFH H L L L L L L L L L L H H Write SIO0 COI ACKD CMDD RELD CLD P27 SCL SDA0 WUP BSYE ACKE CMDT RELT CLC WREL SIC INTCSI0 Write SIO0 C[...]

  • Seite 379

    379 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) L L 1 D1 D0 D2 D3 D4 D5 D6 D7 NAK 2 3 4 567 8 A6 A5 A4 A3 12 34 9 L L SIO0 ← FFH Master Device Operation Transfer Line SIO0 ← Address H L L L L L L H H Write SIO0 COI ACKD CMDD RELD CLD P27 SCL SDA0 WUP BSYE ACKE CMDT RELT CLC WREL SIC INTCSI0 Write SIO0 COI ACKD CMDD RELD CLD [...]

  • Seite 380

    380 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) SCL CLC CMDT CLD SDA0(SDA1) 17.4.5 Cautions on use of I 2 C bus mode (1) Start condition output (master) The SCL pin normally outputs a low-level signal when no serial clock is output. It is necessary to change the SCL pin to high in order to output a start condition signal. To set[...]

  • Seite 381

    381 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) Writing FFH to SIO0 Setting CSIIF0 Setting ACKD Serial Reception 9 a 23 A0 R ACK D7 D6 D5 P27 output latch 1 Setting CSIIF0 ACK output Serial Transmission Write data to SIO0 P27 output latch 0 Wait release Software Operation Hardware Operation SCL Software Operation Hardware Operat[...]

  • Seite 382

    382 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) Writing data to SIO0 Setting CSIIF0 Setting ACKD Serial Transmission 92 3 A0 ACK D7 D6 D5 P27 output latch 1 Setting CSIIF0 ACK Output Serial Reception Write FFH to SIO0 P27 output latch 0 Wait release Software Operation Hardware Operation SCL SDA0 (SDA1) Software Operation Hardwar[...]

  • Seite 383

    383 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) (4) Reception completion of salve In the reception completion processing of the slave, check the bit 3 (CMDD) of the serial bus interface control register (SBIC) and bit 6 (COI) of the serial operation mode register 0 (CSIM0) (when CMDD = 1). This is to avoid the situation where th[...]

  • Seite 384

    384 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) • Example of program releasing serial transfer status SET1 P2.5; <1> SET1 PM2.5; <2> SET1 PM2.7; <3> CLR1 CSIE0; <4> SET1 CSIE0; <5> SET1 RELT; <6> CLR1 PM2.7; <7> CLR1 P2.5; <8> CLR1 PM2.5; <9> <1> This instruction prev[...]

  • Seite 385

    385 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) 17.4.7 SCK0/SCL/P27 pin output manipulation The SCK0/SCL/P27 pin can execute static output via software, in addition to outputting the normal serial clock. The value of serial clocks can also be arbitrarily set by software (the SI0/SB0/SDA0 and SO0/SB1/SDA1 pins are controlled with[...]

  • Seite 386

    386 CHAPTER 17 SERIAL INTERFACE CHANNEL 0 ( µ PD78058FY SUBSERIES) CLC (manipulated by bit manipulation instruction) Wait request signal Serial clock (low while transfer is stopped) SCL Figure 17-29. Logic Circuit of SCL Signal Remarks 1. This figure indicates the relation of the signals and does not indicate the internal circuit. 2. CLC: Bit 3 of[...]

  • Seite 387

    387 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 18.1 Serial Interface Channel 1 Functions Serial interface channel 1 employs the following three modes. • Operation stop mode • 3-wire serial I/O mode • 3-wire serial I/O mode with automatic transmit/receive function (1) Operation stop mode This mode is used when serial transfer is not carried out to [...]

  • Seite 388

    388 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 18.2 Serial Interface Channel 1 Configuration Serial interface channel 1 consists of the following hardware. Table 18-1. Serial Interface Channel 1 Configuration Item Configuration Register Serial I/O shift register 1 (SIO1) Automatic data transmit/receive address pointer (ADTP) Timer clock select register [...]

  • Seite 389

    389 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Figure 18-1. Serial Interface Channel 1 Block Diagram RE ARLD ERCE ERR TRF STRB BUSY 1 BUSY 0 Internal Bus Automatic Data Transmit/Receive Control Register Serial Operating Mode Register 1 ADTI 7 ADTI 4 ADTI 3 ADTI 2 ADTI 1 ADTI 0 5-Bit Counter Serial I/O Shift Register 1 (SIO1) Hand- shake Serial Clock Cou[...]

  • Seite 390

    390 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (1) Serial I/O shift register 1 (SIO1) This is an 8-bit register to carry out parallel/serial conversion and to carry out serial transmission/reception (shift operation) in synchronization with the serial clock. SIO1 is set with an 8-bit memory manipulation instruction. When the value in bit 7 (CSIE1) of se[...]

  • Seite 391

    391 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 18.3 Serial Interface Channel 1 Control Registers The following four types of registers are used to control serial interface channel 1. • Timer clock select register 3 (TCL3) • Serial operating mode register 1 (CSIM1) • Automatic data transmit/receive control register (ADTC) • Automatic data transmi[...]

  • Seite 392

    392 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Serial Interface Channel 1 Serial Clock Selection TCL37 TCL36 TCL35 TCL34 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 0 1 0 1 0 1 0 1 f XX /2 f XX /2 2 f XX /2 3 f XX /2 4 f XX /2 5 f XX /2 6 f XX /2 7 f XX /2 8 Setting prohibited f X /2 2 (1.25 MHz) f X /2 3 (625 kHz) f X /2 4 (313 kHz) f X /2 5 (156 k[...]

  • Seite 393

    393 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (2) Serial operating mode register 1 (CSIM1) This register sets serial interface channel 1 serial clock, operating mode, operation enable/stop and automatic transmit/receive operation enable/stop. CSIM1 is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets CSIM1 to 00H. Figure 18-3.[...]

  • Seite 394

    394 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (3) Automatic data transmit/receive control register (ADTC) This register sets automatic receive enable/disable, the operating mode, strobe output enable/disable, busy input enable/disable, error check enable/disable and displays automatic transmit/receive execution and error detection. ADTC is set with a 1[...]

  • Seite 395

    395 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Data Transfer Interval Specification (f XX = 5.0 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Minimum Note 2 18.4 s + 0.5/f SCK 31.2 s + 0.5/f SCK 44.0 s + 0.5/f SCK 56.8 s + 0.5/f SCK 6[...]

  • Seite 396

    396 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Data Transfer Interval Specification (f XX = 5.0 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Minimum Note 223.2 s + 0.5/f SCK 236.0 s + 0.5/f SCK 248.8 s + 0.5/f SCK 261.6 s + 0.5/f SCK[...]

  • Seite 397

    397 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Data Transfer Interval Specification (f XX = 2.5 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Minimum Note 2 36.8 s + 0.5/f SCK 62.4 s + 0.5/f SCK 88.0 s + 0.5/f SCK 113.6 s + 0.5/f SCK [...]

  • Seite 398

    398 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Data Transfer Interval Specification (f XX = 2.5 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Minimum Note 446.4 s + 0.5/f SCK 472.0 s + 0.5/f SCK 497.6 s + 0.5/f SCK 523.2 s + 0.5/f SCK[...]

  • Seite 399

    399 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Operation enable 6543210 7 Symbol CSIM1 CSIE1 DIR ATE 0 0 0 CSIM11 CSIM10 SCK1 (Input) CSIE1 0 FF68H 00H R/W Address After Reset R/W CSIM11 P20 PM21 P21 PM22 Note 2 Shift Register 1 Operation Serial Clock Counter Operation Control SI1/P20 Pin Function SCK1/P22 Pin Function × 1 0 1 0 × 00 1 × 1 Note 1 Not[...]

  • Seite 400

    400 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Operation enable SCK1 (Input) CSIE1 0 CSIM11 P20 PM21 P21 PM22 Note 3 Shift Register 1 Operation Serial Clock Counter Operation Control SI1/P20 Pin Function SCK1/P22 Pin Function × 1 0 1 0 × 00 1 × 1 Note 2 Note 2 Note 2 Note 2 Count operation SI1 (Input) ××××× Operation stop Clear P20 (CMOS input/o[...]

  • Seite 401

    401 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (2) Communication operation The 3-wire serial I/O mode is used for data transmission/reception in 8-bit units. Bit-wise data transmission/ reception is carried out in synchronization with the serial clock. Shift operation of the serial I/O shift register 1 (SIO1) is carried out at the falling edge of the se[...]

  • Seite 402

    402 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Start bit switching is realized by switching the bit order write to SIO1. The SIO1 shift order remains unchanged. Thus, switching between MSB-first and LSB-first must be performed before writing data to SIO1. (4) Transfer start Serial transfer is started by setting transfer data to the serial I/O shift regi[...]

  • Seite 403

    403 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 18.4.3 3-wire serial I/O mode operation with automatic transmit/receive function This 3-wire serial I/O mode is used for transmission/reception of a maximum of 32-byte data without the use of software. Once transfer is started, the data prestored in the RAM can be transmitted by the set number of bytes, and[...]

  • Seite 404

    404 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Notes 1. If the external clock input has been selected with CSIM11 set to 0, set bit 1 (BUSY 1) and bit 2 (STRB) of the automatic data transmit/receive control register (ADTC) to 0, 0. 2. Can be used freely as port function. 3. Can be used as P20 (CMOS input/output) when only transmitter is used (clear bit [...]

  • Seite 405

    405 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 6543210 7 Symbol ADTC RE ARLD ERCE ERR TRF STRB BUSY1 BUSY0 FF69H 00H R/W Note 1 Address After Reset R/W BUSY1 0 1 1 Busy Input Control Not using busy input Busy input enable (active high) Busy input enable (active low) BUSY0 × 0 1 STRB 0 1 Strobe Output Control Strobe output disable Strobe output enable T[...]

  • Seite 406

    406 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (c) Automatic data transmit/receive interval specify register (ADTI) This register sets the automatic data transmit/receive function data transfer interval. ADTI is set with a 1-bit or 8-bit memory manipulation instruction. RESET input sets ADTI to 00H. Notes 1. The interval is dependent only on CPU process[...]

  • Seite 407

    407 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Data Transfer Interval Specification (f XX = 5.0 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Minimum Note 223.2 s + 0.5/f SCK 236.0 s + 0.5/f SCK 248.8 s + 0.5/f SCK 261.6 s + 0.5/f SCK[...]

  • Seite 408

    408 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Data Transfer Interval Specification (f XX = 2.5 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Minimum Note 2 36.8 s + 0.5/f SCK 62.4 s + 0.5/f SCK 88.0 s + 0.5/f SCK 113.6 s + 0.5/f SCK [...]

  • Seite 409

    409 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Data Transfer Interval Specification (f XX = 2.5 MHz Operation) ADTI4 ADTI3 ADTI2 ADTI1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 Minimum Note 446.4 s + 0.5/f SCK 472.0 s + 0.5/f SCK 497.6 s + 0.5/f SCK 523.2 s + 0.5/f SCK[...]

  • Seite 410

    410 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (2) Automatic transmit/receive data setting (a) Transmit data setting <1> Write transmit data from the least significant address FAC0H of internal buffer RAM (up to FADFH at maximum). The transmit data should be in the order from high-order address to low-order address. <2> Set to the automatic [...]

  • Seite 411

    411 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 SCK1 SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 CSIIF1 TRF SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 Interval (3) Communication operation (a) Basic transmission/reception mode This transmission/reception mode is the same as the 3-wire serial I/O mode in which specified number of data are [...]

  • Seite 412

    412 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Figure 18-9. Basic Transmission/Reception Mode Flowchart ADTP: Automatic data transmit/receive address pointer ADTI: Automatic data transmit/receive interval specify register SIO1: Serial I/O shift register 1 TRF: Bit 3 of automatic data transmit/receive control register (ADTC) Start Write transmit data in [...]

  • Seite 413

    413 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 In 6-byte transmission/reception (ARLD = 0, RE = 1) in basic transmit/receive mode, internal buffer RAM operates as follows. (i) Before transmission/reception (See Figure 18-10 (a).) After any data has been written to serial I/O shift register 1 (SIO1) (start trigger: this data is not transferred), transmit[...]

  • Seite 414

    414 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Receive data 1 (R1) Receive data 2 (R2) Receive data 3 (R3) Receive data 4 (R4) Receive data 5 (R5) Receive data 6 (R6) FADFH FAC5H FAC0H SIO1 1 CSIIF1 0 ADTP Receive data 1 (R1) Receive data 2 (R2) Receive data 3 (R3) Transmit data 4 (T4) Transmit data 5 (T5) Transmit data 6 (T6) FADFH FAC5H FAC0H Receive [...]

  • Seite 415

    415 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (b) Basic transmission mode In this mode, the specified number of 8-bit unit data are transmitted. Serial transmission is started by writing the desired data to serial I/O shift register 1 (SIO1) when bit 7 (CSIE1) of serial operation mode register 1 (CSIM1) is set at 1. When the final byte has been sent, a[...]

  • Seite 416

    416 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Figure 18-12. Basic Transmission Mode Flowchart ADTP: Automatic data transmit/receive address pointer ADTI: Automatic data transmit/receive interval specify register SIO1: Serial I/O shift register 1 TRF: Bit 3 of automatic data transmit/receive control register (ADTC) Start Write transmit data in internal [...]

  • Seite 417

    417 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Transmit data 1 (T1) Transmit data 2 (T2) Transmit data 3 (T3) Transmit data 4 (T4) Transmit data 5 (T5) Transmit data 6 (T6) FADFH FAC5H FAC0H SIO1 0 CSIIF1 5 ADTP –1 In 6-byte transmission (ARLD=0, RE=0) in basic transmit mode, internal buffer RAM operates as follows. (i) Before transmission (See Figure[...]

  • Seite 418

    418 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Transmit data 1 (T1) Transmit data 2 (T2) Transmit data 3 (T3) Transmit data 4 (T4) Transmit data 5 (T5) Transmit data 6 (T6) FADFH FAC5H FAC0H SIO1 1 CSIIF1 0 ADTP Transmit data 1 (T1) Transmit data 2 (T2) Transmit data 3 (T3) Transmit data 4 (T4) Transmit data 5 (T5) Transmit data 6 (T6) FADFH FAC5H FAC0H[...]

  • Seite 419

    419 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (c) Repeat transmission mode In this mode, data stored in the internal buffer RAM is transmitted repeatedly. Serial transmission is started by writing the desired data to serial I/O shift register 1 (SIO1) when bit 7 (CSIE1) of serial operation mode register 1 (CSIM1) is set at 1. Unlike the case of the bas[...]

  • Seite 420

    420 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Figure 18-15. Repeat Transmission Mode Flowchart ADTP: Automatic data transmit/receive address pointer ADTI: Automatic data transmit/receive interval specify register SIO1: Serial I/O shift register 1 Start Write transmit data in internal buffer RAM Set ADTP to the value (pointer value) obtained by subtract[...]

  • Seite 421

    421 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 In 6-byte transmission (ARLD = 1, RE = 0) in repeat transmit mode, internal buffer RAM operates as follows. (i) Before transmission (See Figure 18-16 (a).) After any data has been written to serial I/O shift register 1 (SIO1) (start trigger: this data is not transferred), transmit data 1 (T1) is transferred[...]

  • Seite 422

    422 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Transmit data 1 (T1) Transmit data 2 (T2) Transmit data 3 (T3) Transmit data 4 (T4) Transmit data 5 (T5) Transmit data 6 (T6) FADFH FAC5H FAC0H SIO1 0 CSIIF1 5 ADTP –1 Transmit data 1 (T1) Transmit data 2 (T2) Transmit data 3 (T3) Transmit data 4 (T4) Transmit data 5 (T5) Transmit data 6 (T6) FADFH FAC5H [...]

  • Seite 423

    423 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 SCK1 SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 Restart Command CSIE1 = 1, Write to SIO1 Suspend CSIE1 = 0 (Suspended Command) (d) Automatic transmission/reception suspending and restart Automatic transmission/reception can be temporarily suspende[...]

  • Seite 424

    424 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (4) Synchronization control Busy control and strobe control are functions for synchronizing sending and receiving between the master device and slave device. By using these functions, it is possible to detect bit slippage during sending and receiving. (a) Busy control option Busy control is a function which[...]

  • Seite 425

    425 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Furthermore, in the case that the busy control option is used, select the internal clock for the serial clock. The busy signal cannot be controlled with an external clock. The operation timing when the busy control option is used is shown in Figure 18-19. Caution Busy control cannot be used at the same time[...]

  • Seite 426

    426 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 Figure 18-20 Busy Signal and Wait Cancel (When BUSY0 = 0) (b) Busy & strobe control option Strobe control is a function for synchronizing the sending and receiving of data between a master device and slave device. When sending or receiving of 8 bit data ends, the strobe signal is output by the master de[...]

  • Seite 427

    427 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 SCK1 SO1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 STB BUSY SI1 D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 TRF Busy Input Valid Busy Input Release CSIIF1 Figure 18-21. Operation Timings When Using Busy & Strobe Control Option (BUSY0 = 0) Caution When TRF is cleared, the SO1 pin becomes low le[...]

  • Seite 428

    428 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (c) Bit Slippage Detection Function Through the Busy Signal During an auto send and receive operation, noise occur in the serial clock signal output by the master device and bit slippage may occur in the slave device side serial clock. At this time, if the strobe control option is not used, this bit slippag[...]

  • Seite 429

    429 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (5) Automatic transmit/receive interval time When using the automatic transmit/receive function, the read/write operations from/to the internal buffer RAM are performed after transmitting/receiving one byte. Therefore, an interval is inserted before the next transmit/ receive. Since the read/write operation[...]

  • Seite 430

    430 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 f X f CPU SCK1 SO1 SI1 T CPU T SCK D7 D6 D5 D4 D3 D2 D1 D0 D7 D6 D5 D4 D3 D2 D1 D0 Interval (a) When the automatic transmit/receive function is used by the internal clock If bit 1 (CSIM11) of serial operation mode register 1 (CSIM1) is set at (1), the internal clock operates. If the auto send and receive fu[...]

  • Seite 431

    431 CHAPTER 18 SERIAL INTERFACE CHANNEL 1 (b) When the automatic transmit/receive function is used by the external clock If bit 1 (CSIM11) of serial operation mode register 1 (CSIM1) is cleared to 0, external clock operation is set. When the automatic transmit/receive function is used by the external clock, it must be selected so that the interval [...]

  • Seite 432

    432 [MEMO][...]

  • Seite 433

    433 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 19.1 Serial Interface Channel 2 Functions Serial interface channel 2 has the following three modes. • Operation stop mode • Asynchronous serial interface (UART) mode • 3-wire serial I/O mode (1) Operation stop mode This mode is used when serial transfer is not carried out to reduce power consumption. [...]

  • Seite 434

    434 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 19.2 Serial Interface Channel 2 Configuration Serial interface channel 2 consists of the following hardware. Table 19-1. Serial Interface Channel 2 Configuration Item Configuration Register Transmit shift register (TXS) Receive shift register (RXS) Receive buffer register (RXB) Control register Serial opera[...]

  • Seite 435

    435 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 Internal Bus Asynchronous Serial Interface Mode Register Asynchronous Serial Interface Status Register Receive Buffer Register (RXB/SIO2) Direction Control Circuit Receive Shift Register (RXS) Reception Control Circuit RxD/SI2/ P70 TxD/SO2/ P71 INTSR/INTCSI2 CSIE2 CSIM 22 CSCK INTSER SCK Output Control Circ[...]

  • Seite 436

    436 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 TPS3 TPS2 TPS1 TPS0 Internal Bus MDL3 MDL2 MDL1 MDL0 Baud Rate Generator Control Register 4 TXE CSIE2 5-Bit Counter Selector Selector Decoder 1/2 Selector Transmit Clock 1/2 Selector Receive Clock Match Match MDL0 to MDL3 5-Bit Counter RXE Start Bit Detection Selector f xx to f xx /2 10 TPS0 to TPS3 SCK ASC[...]

  • Seite 437

    437 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (1) Transmit shift register (TXS) This register is used to set the transmit data. The data written in TXS is transmitted as serial data. If the data length is specified as 7 bits, bits 0 to 6 of the data written in TXS are transferred as transmit data. Writing data to TXS starts the transmit operation. TXS [...]

  • Seite 438

    438 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 6543210 7 Symbol CSIM2 CSIE2 0 0 0 0 CSIM 22 CSCK 0 FF72H 00H R/W Address After Reset R/W CSCK 0 1 Serial Operating Mode Selection UART mode 3-wire serial I/O mode CSIM22 0 1 First Bit Specification MSB LSB CSIE2 0 1 Operation Control in 3-wire Serial I/O Mode Operation stopped Operation enabled 19.3 Serial[...]

  • Seite 439

    439 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 6543210 7 Symbol ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W Address After Reset R/W SCK 0 1 Clock Selection in Asynchronous Serial Interface Mode Input clock from off-chip to ASCK pin Dedicated baud rate generator output Note ISRM 0 1 Control of Reception Completion Interrupt Request in Case of Error[...]

  • Seite 440

    440 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (2) 3-wire Serial I/O Mode Table 19-2. Serial Interface Channel 2 Operating Mode Settings (1) Operation Stop Mode P72/SCK2 /ASCK Pin Functions P71/SO2 /TxD Pin Functions P70/SI2 /RxD Pin Functions Shift Clock Start Bit TXE RXE SCK CSIE2 CSIM22 CSCK PM70 P70 PM71 P71 PM72 P72 ASIM CSIM2 1 0 1 0 1 1 0 0 0 0 0[...]

  • Seite 441

    441 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 PE 6543210 7 Symbol ASIS 0 0 0 0 0 FE OVE FF71H 00H R Address After Reset R/W OVE 0 1 Overrun Error Flag Overrun error not generated Overrun error generated Note 1 (When next receive operation is completed before data from receive buffer register is read) FE 0 1 Framing Error Flag Framing error not generate[...]

  • Seite 442

    442 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 Baud Rate Generator Input Clock Selection MDL3 MDL2 MDL1 MDL0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 f SCK /16 f SCK /17 f SCK /18 f SCK /19 f SCK /20 f SCK /21 f SCK /22 f SCK /23 f SCK /24 f SCK /25 f SCK /26 f SCK /2[...]

  • Seite 443

    443 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 Figure 19-6. Baud Rate Generator Control Register Format (2/2) 5-Bit Counter Source Clock Selection TPS3 TPS2 TPS1 TPS0 n MCS = 1 MCS = 0 0000 f XX /2 10 f XX /2 10 (4.9 kHz) f X /2 11 (2.4 kHz) 11 0101 f XX f X (5.0 MHz) f X /2 (2.5 MHz) 1 0110 f XX /2 f X /2 (2.5 MHz) f X /2 2 (1.25 MHz) 2 0111 f XX /2 2 [...]

  • Seite 444

    444 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 The baud rate transmit/receive clock generated is either a signal scaled from the main system clock, or a signal scaled from the clock input from the ASCK pin. (a) Generation of baud rate transmit/receive clock by means of main system clock The transmit/receive clocks generated by scaling the main system cl[...]

  • Seite 445

    445 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (b) Generation of baud rate transmit/receive clock by means of external clock from ASCK pin The transmit/receive clock is generated by scaling the clock input from the ASCK pin. The baud rate generated from the clock input from the ASCK pin is obtained with the following expression. [Baud rate] = [Hz] f ASC[...]

  • Seite 446

    446 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 19.4 Serial Interface Channel 2 Operation Serial interface channel 2 has the following three modes. • Operation stop mode • Asynchronous serial interface (UART) mode • 3-wire serial I/O mode 19.4.1 Operation stop mode In the operation stop mode, serial transfer is not performed, and therefore power co[...]

  • Seite 447

    447 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 SL 6543210 7 Symbol ASIM TXE RXE PS1 PS0 CL ISRM SCK FF70H 00H R/W Address After Reset R/W RXE 0 1 Receive Operation Control Receive operation stopped Receive operation enabled TXE 0 1 Transmit Operation Control Transmit operation stopped Transmit operation enabled (b) Asynchronous serial interface mode reg[...]

  • Seite 448

    448 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 6543210 7 Symbol CSIM2 CSIE2 0 0 0 0 CSIM 22 CSCK 0 CSCK 0 1 Serial Operating Mode Selection UART mode 3-wire serial I/O mode CSIM22 0 1 First Bit Specification MSB LSB CSIE2 0 1 Operation Control in 3-wire Serial I/O Mode Operation stopped Operation enabled FF72H 00H R/W Address After Reset R/W 19.4.2 Asyn[...]

  • Seite 449

    449 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 6543210 7 Symbol ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W Address After Reset R/W SCK 0 1 Clock Selection in Asynchronous Serial Interface Mode Input clock from off-chip to ASCK pin Dedicated baud rate generator output Note ISRM 0 1 Control of Reception Completion Interrupt Request in Case of Error[...]

  • Seite 450

    450 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 PE 6543210 7 Symbol ASIS 0 0 0 0 0 FE OVE FF71H 00H R Address After Reset R/W OVE 0 1 Overrun Error Flag Overrun error not generated Overrun error generated Note 1 (When next receive operation is completed before data from receive buffer register is read) FE 0 1 Framing Error Flag Framing error not generate[...]

  • Seite 451

    451 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 Baud Rate Generator Input Clock Selection MDL3 MDL2 MDL1 MDL0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 f SCK /16 f SCK /17 f SCK /18 f SCK /19 f SCK /20 f SCK /21 f SCK /22 f SCK /23 f SCK /24 f SCK /25 f SCK /26 f SCK /27 f SCK [...]

  • Seite 452

    452 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 5-Bit Counter Source Clock Selection TPS3 TPS2 TPS1 TPS0 n MCS = 1 MCS = 0 0000 f XX /2 10 f X /2 10 (4.9 kHz) f X /2 11 (2.4 kHz) 11 0101 f XX f X (5.0 MHz) f X /2 (2.5 MHz) 1 0110 f XX /2 f X /2 (2.5 MHz) f X /2 2 (1.25 MHz) 2 0111 f XX /2 2 f X /2 2 (1.25 MHz) f X /2 3 (625 kHz) 3 1000 f XX /2 3 f X /2 3[...]

  • Seite 453

    453 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 The baud rate transmit/receive clock generated is either a signal scaled from the main system clock, or a signal scaled from the clock input from the ASCK pin. (i) Generation of baud rate transmit/receive clock by means of main system clock The transmit/receive clock is generated by scaling the main system [...]

  • Seite 454

    454 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (ii) Generation of baud rate transmit/receive clock by means of external clock from ASCK pin The transmit/receive clock is generated by scaling the clock input from the ASCK pin. The baud rate generated from the clock input from the ASCK pin is obtained with the following expression. [Baud rate] = [Hz] f AS[...]

  • Seite 455

    455 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (2) Communication operation (a) Data format The transmit/receive data format is as shown in Figure 19-7. Figure 19-7. Asynchronous Serial Interface Transmit/Receive Data Format 1 data frame is composed of each of the bits shown below. • Start bits .................. 1 bit • Character bits ......... 7 bi[...]

  • Seite 456

    456 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (b) Parity types and operation The parity bit is used to detect a bit error in the communication data. Normally, the same kind of parity bit is used on the transmitting side and the receiving side. With even parity and odd parity, a one-bit (odd number) error can be detected. With 0 parity and no parity, an[...]

  • Seite 457

    457 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 D1 D2 D6 D7 Parity D0 TxD (Output) INTST STOP START D1 D2 D6 D7 Parity D0 TxD (Output) INTST STOP START (c) Transmission A transmit operation is started by writing transmit data to the transmit shift register (TXS). The start bit, parity bit and stop bit(s) are added automatically. When the transmit operati[...]

  • Seite 458

    458 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (d) Reception When bit 6 (RXE) of the asynchronous serial interface mode register (ASIM) is set (1), a receive operation is enabled and sampling of the RxD pin input is performed. RxD pin input sampling is performed using the serial clock specified by ASIM. When the RxD pin input becomes low, the baud rate [...]

  • Seite 459

    459 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (e) Receive errors Three kinds of errors can occur during a receive operation: a parity error, framing error, or overrun error. The data reception result error flag is set in the asynchronous serial interface status register (ASIS) and at the same time a receive error interrupt request (INTSER) is generated[...]

  • Seite 460

    460 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (3) UART mode cautions (a) If bit 7 (TXE) of the asynchronous serial interface mode register (ASIM) is cleared to (0) during transmission and sending operation is halt, be sure to set the transmit shift register (TXS) to FFH, then set TXE to 1 before executing the next transmission. (b) If bit 6 (RXE) of AS[...]

  • Seite 461

    461 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 19.4.3 3-wire serial I/O mode The 3-wire serial I/O mode is useful for connection of peripheral I/Os and display controllers, etc., which incorporate a conventional synchronous clocked serial interface, such as the 75X/XL Series, 78K Series, 17K Series, etc. Communication is performed using three lines: the[...]

  • Seite 462

    462 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 6543210 7 Symbol ASIM TXE RXE PS1 PS0 CL SL ISRM SCK FF70H 00H R/W Address After Reset R/W SCK 0 1 Clock Selection in Asynchronous Serial Interface Mode Input clock from off-chip to ASCK pin Dedicated baud rate generator output ISRM 0 1 Control of Reception Completion Interrupt Request in Case of Error Gene[...]

  • Seite 463

    463 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 Baud Rate Generator Input Clock Selection MDL3 MDL2 MDL1 MDL0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 f SCK /16 f SCK /17 f SCK /18 f SCK /19 f SCK /20 f SCK /21 f SCK /22 f SCK /23 f SCK /24 f SCK /25 f SCK /26 f SCK /2[...]

  • Seite 464

    464 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 5-Bit Counter Source Clock Selection TPS3 TPS2 TPS1 TPS0 n MCS = 1 MCS = 0 0000 f XX /2 10 f X /2 10 (4.9 kHz) f X /2 11 (2.4 kHz) 11 0101 f XX f X (5.0 MHz) f X /2 (2.5 MHz) 1 0110 f XX /2 f X /2 (2.5 MHz) f X /2 2 (1.25 MHz) 2 0111 f XX /2 2 f X /2 2 (1.25 MHz) f X /2 3 (625 kHz) 3 1000 f XX /2 3 f X /2 3[...]

  • Seite 465

    465 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 When the internal clock is used as the serial clock in the 3-wire serial I/O mode, set BRGC as described below. BRGC setting is not required if an external serial clock is used. (i) When the baud rate generator is not used: Select a serial clock frequency with TPS0 to TPS3. Be sure then to set MDL0 to MDL3 [...]

  • Seite 466

    466 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 SI2 SCK2 12345678 DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0 SO2 DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0 SRIF Transfer Start at the Falling Edge of SCK2 End of Transfer (2) Communication operation In the 3-wire serial I/O mode, data transmission/reception is performed in 8-bit units. Data is transmitted/ received bit by bit i[...]

  • Seite 467

    467 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 (3) MSB/LSB switching as the start bit The 3-wire serial I/O mode enables to select transfer to start from MSB or LSB. Figure 19-13 shows the configuration of the transmit shift register (TXS/SIO2) and internal bus. As shown in the figure, MSB/LSB can be read/written in reverse form. MSB/LSB switching as th[...]

  • Seite 468

    468 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 19.4.4 Restrictions on using UART mode In the UART mode, a receive completion interrupt request (INTSR) is generated after a certain period of time following the generation and clearing of the receive error interrupt request (INTSER). Thereby, the phenomenon shown below may occur. Details If the bit 1 (ISRM[...]

  • Seite 469

    469 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 RxD (Input) INTSR INTSER (when Framing or Overrun Error is Generated) INTSER (when Parity Error is Generated) D0 T1 T2 D1 D2 D6 D7 STOP ST ART Parity Figure 19-15. Period that Reading Receive Buffer Register Is Prohibited T1 : The amount of time for one unit of data sent in the baud rate selected with the b[...]

  • Seite 470

    470 CHAPTER 19 SERIAL INTERFACE CHANNEL 2 [Example] INTSER is Generated 7 Clocks (MIN.) of CPU Clock (Time from Interrupt Request to Servicing) Instructions for 2205 clocks (MIN.) of CPU clock are required. UART Receive Error Interrupt (INTSER) Servicing EI RETI MOV A,RXB Main Processing[...]

  • Seite 471

    471 CHAPTER 20 REAL-TIME OUTPUT PORT 20.1 Real-Time Output Port Functions Data set previously in the real-time output buffer register can be transferred to the output latch by hardware concurrently with timer interrupt request or external interrupt request generation, then output externally. This is called the real-time output function. The pins th[...]

  • Seite 472

    472 CHAPTER 20 REAL-TIME OUTPUT PORT 20.2 Real-Time Output Port Configuration The real-time output port consists of the following hardware. Table 20-1. Real-time Output Port Configuration Item Configuration Register Real-time output buffer register (RTBL, RTBH) Control register Port mode register 12 (PM12) Real-time output port mode register (RTPM)[...]

  • Seite 473

    473 CHAPTER 20 REAL-TIME OUTPUT PORT (1) Real-time output buffer register (RTBL, RTBH) Addresses of RTBL and RTBH are mapped individually in the Special function register (SFR) area as shown in Figure 20-2. When specifying 4 bits × 2 channels as the operating mode, data are set individually in RTBL and RTBH. When specifying 8 bits × 1 channel as [...]

  • Seite 474

    474 CHAPTER 20 REAL-TIME OUTPUT PORT 20.3 Real-Time Output Port Control Registers The following three registers control the real-time output port. • Port mode register 12 (PM12) • Real-time output port mode register (RTPM) • Real-time output port control register (RTPC) (1) Port mode register 12 (PM12) This register sets the input or output m[...]

  • Seite 475

    475 CHAPTER 20 REAL-TIME OUTPUT PORT (3) Real-time output port control register (RTPC) This register sets the real-time output port operating mode and output trigger. Table 20-3 shows the relation between the operating mode of the real-time output port and output trigger. RTPC is set with a 1-bit or 8-bit memory manipulation instruction. RESET inpu[...]

  • Seite 476

    476 [MEMO][...]

  • Seite 477

    477 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 21.1 Interrupt Function Types The following three types of interrupt functions are used. (1) Non-maskable interrupt This interrupt is acknowledged unconditionally even in the interrupt disabled status. It does not undergo interrupt priority control and is given top priority over all other interrupt reques[...]

  • Seite 478

    478 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 0 – INTWDT 21.2 Interrupt Sources and Configuration Combining all the factors in interrupts, non-maskable interrupts, maskable interrupts and software interrupts, there are a total of 22 source (see Table 21-1 ). Table 21-1. Interrupt Source List (1/2) Interrupt Source Name Trigger Watchdog timer overfl[...]

  • Seite 479

    479 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Table 21-1. Interrupt Source List (2/2) Interrupt Source Name Trigger INTTM3 Reference time interval signal from Internal 001EH (B) watch timer INTTM00 Generation of 16-bit timer register, 0020H capture/compare register (CR00) match signal INTTM01 Generation of 16-bit timer register, 0022H capture/compare[...]

  • Seite 480

    480 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Internal Bus IE PR ISP MK IF Priority Control Circuit Vector Table Address Generator Standby Release Signal Interrupt Request Sampling Clock Edge Detector Sampling Clock Select Register (SCS) External Interrupt Mode Register (INTM0) Internal Bus IE PR ISP MK IF Interrupt Request Priority Control Circuit V[...]

  • Seite 481

    481 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Internal Bus Priority Control Circuit Vector Table Address Generator Interrupt Request External Interrupt Mode Register (INTM0, INTM1) Edge Detector Interrupt Request IE PR ISP MK IF Priority Control Circuit Vector Table Address Generator Standby Release Signal Internal Bus Figure 21-1. Basic Configuratio[...]

  • Seite 482

    482 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 21.3 Interrupt Function Control Registers The following six types of registers are used to control the interrupt functions. • Interrupt request flag register (IF0L, IF0H, IF1L) • Interrupt mask flag register (MK0L, MK0H, MK1L) • Priority specify flag register (PR0L, PR0H, PR1L) • External interrup[...]

  • Seite 483

    483 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 7 PIF6 Symbol IF0L 6 PIF5 5 PIF4 4 PIF3 3 PIF2 2 PIF1 1 PIF0 0 TMIF4 Address FFE0H 00H After Reset R/W R/W × × IF × 0 1 Interrupt Request Flag No interrupt request signal Interrupt request signal is generated; Interrupt request state 7 TMIF01 IF0H 6 TMIF00 5 TMIF3 4 STIF 3 SRIF 2 SERIF 1 CSIIF1 0 CSIIF[...]

  • Seite 484

    484 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 7 PMK6 Symbol MK0L 6 PMK5 5 PMK4 4 PMK3 3 PMK2 2 PMK 1 PMK 0 TMMK4 Address FFE4H FFH After Reset R/W R/W × × MK × 0 1 Interrupt Servicing Control Interrupt servicing enabled Interrupt servicing disabled 7 TMMK01 MK0H 6 TMMK00 5 TMMK3 4 STMK 3 SRMK 2 SERMK 1 CSIMK1 0 CSIMK0 7 WTMK Note MK1L 6 1 5 1 4 1 [...]

  • Seite 485

    485 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 7 PPR6 Symbol PR0L 6 PPR5 5 PPR4 4 PPR3 3 PPR2 2 PPR1 1 PPR0 0 TMPR4 Address FFE8H FFH After Reset R/W R/W 0 1 Priority Level Selection High priority level Low priority level 7 TMPR01 PR0H 6 TMPR00 5 TMPR3 4 STPR 3 SRPR 2 SERPR 1 CSIPR1 0 CSIPR0 7 1 PR1L 6 1 5 1 4 1 3 1 2 ADPR 1 TMPR2 0 TMPR1 FFE9H FFH R/[...]

  • Seite 486

    486 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Address FFECH 00H After Reset R/W R/W 0 0 1 1 INTP0 Valid Edge Selection Falling edge Rising edge Setting prohibited Both falling and rising edges ES11 7 ES31 Symbol INTM0 6 ES30 5 ES21 4 ES20 3 ES11 2 ES10 1 0 0 0 0 1 0 1 ES10 0 0 1 1 INTP1 Valid Edge Selection Falling edge Rising edge Setting prohibited[...]

  • Seite 487

    487 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Address FFEDH 00H After Reset R/W R/W 0 0 1 1 INTP3 Valid Edge Selection Falling edge Rising edge Setting prohibited Both falling and rising edges ES41 7 ES71 Symbol INTM1 6 ES70 5 ES61 4 ES60 3 ES51 2 ES50 1 ES41 0 ES40 0 1 0 1 ES40 0 0 1 1 INTP4 Valid Edge Selection Falling edge Rising edge Setting proh[...]

  • Seite 488

    488 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Address FF47H 00H After Reset R/W R/W 0 0 1 1 INTP0 Sampling Clock Selection f xx /2 N f xx /2 7 f xx /2 5 f xx /2 6 SCS1 7 0 Symbol SCS 6 0 5 0 4 0 3 0 2 0 1 SCS1 0 SCS0 0 1 0 1 SCS0 MCS = 1 MCS = 0 f x /2 7 (39.1 kHz) f x /2 5 (156.3 kHz) f x /2 6 (78.1 kHz) f x /2 8 (19.5 kHz) f x /2 6 (78.1 kHz) f x /[...]

  • Seite 489

    489 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS (b) When input is equal to or twice the sampling cycle (t SMP ) The noise elimination circuit sets the interrupt request flag (PIF0) at (1) when the sampled INTP0 input level is active twice in succession. Figure 21-8 shows the input/output timing of the noise elimination circuit. Figure 21-8. Noise Elimi[...]

  • Seite 490

    490 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS (6) Program status word (PSW) The program status word is a register to hold the instruction execution result and the current status for interrupt request. The IE flag to set maskable interrupt enable/disable and the ISP flag to control multiple interrupt processing are mapped. In addition to being able to[...]

  • Seite 491

    491 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 21.4 Interrupt Servicing Operations 21.4.1 Non-maskable interrupt acknowledge operation A non-maskable interrupt request is received without condition even when in the interrupt request reception prohibited state. It does not undergo interrupt priority control and has highest priority over all other inter[...]

  • Seite 492

    492 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS WDTM4=1 (with watchdog timer mode selected)? Overflow in WDT? WDTM3=0 (with non-maskable interrupt selected)? Interrupt request generation WDT interrupt servicing? Interrupt control register unaccessed? Interrupt service start Interrupt request held pending Reset processing Interval timer Start No Yes Yes[...]

  • Seite 493

    493 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Figure 21-12. Non-Maskable Interrupt Request Acknowledge Operation (a) If a new non-maskable interrupt request is generated during non-maskable interrupt servicing program execution (b) If two non-maskable interrupt requests are generated during non-maskable interrupt servicing program execution Main Rout[...]

  • Seite 494

    494 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 21.4.2 Maskable Interrupt request reception For a maskable interrupt request, the interrupt request flag is set at (1) and if the mask (MK) flag of that interrupt is cleared (0), it is possible for it to be received. A vector interrupt request is received if an interrupt enable state exists (when the IE f[...]

  • Seite 495

    495 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Figure 21-13. Interrupt Request Acknowledge Processing Algorithm XXIF : Interrupt Request Flag XXMK : Interrupt Mask Flag XXPR : Priority Order Specification Flag IE : Flag which controls reception of maskable interrupt requests (1 = permitted, 0 = prohibited) ISP : Flag which shows the priority order of [...]

  • Seite 496

    496 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Figure 21-14. Interrupt Request Acknowledge Timing (Minimum Time) Remark 1 clock : (f CPU : CPU clock) Figure 21-15. Interrupt Request Acknowledge Timing (Maximum Time) Remark 1 clock : (f CPU : CPU clock) f CPU 1 Instruction Divide Instruction PSW and PC Save, Jump to Interrupt Servicing 6 Clocks Interru[...]

  • Seite 497

    497 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 21.4.3 Software interrupt request acknowledge operation A software interrupt request is received by the execution of a BRK command. A software interrupt cannot be prohibited. If a software interrupt request is received, the contents of the program status word (PSW) and the program counter (PC) are saved t[...]

  • Seite 498

    498 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Table 21-4. Interrupt Request Enabled for Multiple Interrupt During Interrupt Servicing Maskable Interrupt Request PR = 0 PR = 1 IE = 1 IE = 0 IE = 1 IE = 0 Non-maskable interrupt D D D D D ISP=0 E E D D D ISP=1 E E D E D Software interrupt E E D E D Remarks 1. E : Multiple interrupt enable 2. D : Multipl[...]

  • Seite 499

    499 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Main Processing EI INTxx (PR=1) INTyy (PR=0) IE=0 EI RETI INTxx Servicing INTzz (PR=0) IE=0 EI RETI INTyy Servicing IE=0 RETI INTzz Servicing Figure 21-16. Multiple Interrupt Example (1/2) Example 1 Example of multiple interrupt requests being generated twice. During processing of interrupt INTxx, 2 inter[...]

  • Seite 500

    500 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Main Processing INTxx Servicing INTyy Servicing INTxx (PR=0) 1 Instruction Execution IE=0 INTyy (PR=0) IE=0 RETI RETI EI Example 3 Example of a multiple interrupt not being generated because an interrupt was not permitted. In processing of interrupt INTxx, interrupt reception was not permitted (the IE com[...]

  • Seite 501

    501 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 21.4.5 Interrupt request reserve Among the commands, there are some for which, even if an interrupt request is generated while they are being executed, reception of the interrupt request is held until execution of the next command is completed. The commands of this type (interrupt request hold commands) a[...]

  • Seite 502

    502 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS Internal bus MK IF Test input signal Standby release signal 21.5 Test Functions When a clock timer overflow occurs and when the port 4 falling edge is detected, a corresponding test input flag is set (1) and a standby release signal is generated. Unlike the interrupt function, vector processing is not exe[...]

  • Seite 503

    503 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS (1) Interrupt request flag register 1L (IF1L) It indicates whether a watch timer overflow is detected or not. It is set by a 1-bit memory manipulation instruction and 8-bit memory manipulation instruction. It is set to 00H by the RESET signal input. Figure 21-19. Format of Interrupt Request Flag Register [...]

  • Seite 504

    504 CHAPTER 21 INTERRUPT AND TEST FUNCTIONS 7 0 Symbol KRM 6 0 5 0 4 0 3 0 2 0 1 KRMK 0 KRIF Address FFF6H 02H After Reset R/W R/W 0 1 Key Return Signal Not detected Detected (port 4 falling edge detection) KRIF 0 1 Standby Mode Control by Key Return Signal Standby mode release enabled Standby mode release disabled KRMK (3) Key return mode register[...]

  • Seite 505

    505 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION 22.1 External Device Expansion Functions The external device expansion functions connect external devices to areas other than the internal ROM, RAM, and SFR. Connection of external devices uses ports 4 to 6. Ports 4 to 6 control address/data, read/write strobe, wait, address strobe etc. Table 22-1. [...]

  • Seite 506

    506 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION Memory maps when using the external device expansion function are as follows. Figure 22-1. Memory Map When Using External Device Expansion Function (1/2) (a) Memory Map of the µ PD78056F and 78056FY, and of the µ PD78P058F and 78P058FY when the internal PROM is 48 Kbytes. FFFFH SFR Internal High-S[...]

  • Seite 507

    507 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION FFFFH SFR Internal High-Speed RAM FF00H FEFFH FB00H FAFFH FAE0H FADFH FAC0H FABFH F800H F7FFH F400H F3FFH F000H EFFFH 0000H Reserved Internal Buffer RAM Reserved Internal Expansion RAM Reserved Single-chip Mode FFFFH SFR Internal High-Speed RAM FF00H FEFFH FB00H FAFFH FAE0H FADFH FAC0H FABFH F800H F[...]

  • Seite 508

    508 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION 7 0 Symbol MM 6 0 5 PW1 4 PW0 3 0 2 MM2 1 MM1 0 MM0 Address FFF8H 10H After Reset R/W R/W MM2 MM1 MM0 Single-chip/ Memory Expansion Mode Selection P40 to P47, P50 to P57, P64 to P67 Pin state P40 to P47 P50 to P53 P54, P55 P56, P57 P64 to P67 00 0 00 1 01 1 10 0 10 1 11 1 Single-chip mode 256-byte m[...]

  • Seite 509

    509 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION (2) Memory size switching register (IMS) This register specifies the internal memory size. In principle, use IMS in a default status. However, when using the external device expansion function with the µ PD78058F, 78P058F, 78058FY and 78P058FY, set IMS so that the internal ROM capacity is 56 Kbytes[...]

  • Seite 510

    510 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION 22.3 External Device Expansion Function Timing Timing control signal output pins in the external memory expansion mode are as follows. (1) RD pin (Alternate function: P64) Read strobe signal output pin. The read strobe signal is output in data accesses and instruction fetches from external memory. D[...]

  • Seite 511

    511 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION ASTB RD Lower Address Operation Code AD0 to AD7 A8 to A15 Higher Address WAIT ASTB RD AD0 to AD7 A8 to A15 Lower Address Operation Code Higher Address Internal Wait Signal ( 1-clock wait ) ASTB RD AD0 to AD7 A8 to A15 Lower Address Operation Code Higher Address Figure 22-4. Instruction Fetch from Ex[...]

  • Seite 512

    512 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION ASTB RD Lower Address Read Data AD0 to AD7 A8 to A15 Higher Address WAIT ASTB RD AD0 to AD7 A8 to A15 Lower Address Read Data Higher Address Internal Wait Signal (1-clock wait) Higher Address ASTB RD AD0 to AD7 A8 to A15 Lower Address Read Data Figure 22-5. External Memory Read Timing (a) No wait (P[...]

  • Seite 513

    513 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION ASTB WR Higher Address AD0 to AD7 A8 to A15 WAIT Hi-Z Lower Address Write Data ASTB WR AD0 to AD7 A8 to A15 Lower Address Write Data Higher Address Internal Wait Signal ( 1-clock wait ) Hi-Z ASTB WR AD0 to AD7 A8 to A15 Lower Address Write Data Hi-Z Higher Address Figure 22-6. External Memory Write [...]

  • Seite 514

    514 CHAPTER 22 EXTERNAL DEVICE EXPANSION FUNCTION ASTB RD WR Higher Address AD0 to AD7 A8 to A15 WAIT Hi-Z Lower Address Write Data Read Data Lower Address Higher Address Internal Wait Signal (1-clock wait) Hi-Z ASTB RD WR AD0 to AD7 A8 to A15 Write Data Read Data ASTB RD WR AD0 to AD7 A8 to A15 Lower Address Write Data Higher Address Hi-Z Read Dat[...]

  • Seite 515

    515 CHAPTER 23 STANDBY FUNCTION 23.1 Standby Function and Configuration 23.1.1 Standby function The standby function is designed to decrease power consumption of the system. The following two modes are available. (1) HALT mode HALT instruction execution sets the HALT mode. The HALT mode is intended to stop the CPU operation clock. System clock osci[...]

  • Seite 516

    516 CHAPTER 23 STANDBY FUNCTION STOP Mode Clear X1 Pin Voltage Waveform V SS a 23.1.2 Standby function control register A wait time after the STOP mode is cleared upon interrupt request till the oscillation stabilizes is controlled with the oscillation stabilization time select register (OSTS). OSTS is set with an 8-bit memory manipulation instruct[...]

  • Seite 517

    517 CHAPTER 23 STANDBY FUNCTION 23.2 Standby Function Operations 23.2.1 HALT mode (1) HALT mode set and operating status The HALT mode is set by executing the HALT instruction. It can be set with the main system clock or the subsystem clock. The operating status in the HALT mode is described below. Table 23-1. HALT Mode Operating Status Setting of [...]

  • Seite 518

    518 CHAPTER 23 STANDBY FUNCTION HALT Instruction Interrupt Request Wait Standby Release Signal Operating Mode Clock HALT Mode Wait Oscillation Operating Mode (2) HALT mode clear The HALT mode can be cleared with the following four types of sources. (a) Clear upon unmasked interrupt request The HALT mode is cleared when an unmasked interrupt request[...]

  • Seite 519

    519 CHAPTER 23 STANDBY FUNCTION (d) Clear upon RESET input The HALT mode is cleared upon RESET signal input. As is the case with normal reset operation, a program is executed after branching to the reset vector address. Figure 23-3. HALT Mode Release by RESET Input Remarks 1. f X : main system clock oscillation frequency 2. ( ): f X : 5.0 MHz Table[...]

  • Seite 520

    520 CHAPTER 23 STANDBY FUNCTION 23.2.2 STOP mode (1) STOP mode set and operating status The STOP mode is set by executing the STOP instruction. It can be set only with the main system clock. Cautions 1. When the STOP mode is set, the X2 pin is internally connected to V DD via a pull-up resistor to minimize the leakage current at the crystal oscilla[...]

  • Seite 521

    521 CHAPTER 23 STANDBY FUNCTION STOP Instruction Wait (Time set by OSTS) Oscillation Stabilization Wait Status Operating Mode Oscillation Operationg Mode STOP Mode Oscillation Stop Oscillation Standby Release Signal Clock Interrupt Request (2) STOP mode release The STOP mode can be cleared with the following three types of sources. (a) Release by u[...]

  • Seite 522

    522 CHAPTER 23 STANDBY FUNCTION RESET Signal Operating Mode Clock Reset Period STOP Mode Oscillation Stop Oscillation Stabilization Wait Status Operating Mode Oscillation Wait (2 17 /f x : 26.2 ms) STOP Instruction Oscillation (c) Release by RESET input The STOP mode is cleared upon RESET input, and after the lapse of the oscillation stabilization [...]

  • Seite 523

    523 RESET Count Clock Reset Control Circuit Watchdog Timer Stop Over- flow Reset Signal Interrupt Function CHAPTER 24 RESET FUNCTION 24.1 Reset Function The following two operations are available to generate the reset signal. (1) External reset input with RESET pin (2) Internal reset by watchdog timer overrun time detection External reset and inter[...]

  • Seite 524

    524 CHAPTER 24 RESET FUNCTION RESET Internal Reset Signal Port Pin Delay Delay Hi-Z X1 Normal Operation Reset Period (Oscillation Stop) Oscillation Stabilization Time Wait Normal Operation (Reset Processing) Stop Status (Oscillation Stop) STOP Instruction Execution RESET Internal Reset Signal Port Pin Delay Delay Hi-Z X1 Normal Operation Reset Peri[...]

  • Seite 525

    525 CHAPTER 24 RESET FUNCTION Table 24-1. Hardware Status After Reset (1/2) Hardware Status after Reset Program counter (PC) Note 1 The contents of reset vector tables (0000H and 0001H) are set. Stack pointer (SP) Undefined Program status word (PSW) 02H RAM Data memory Undefined Note 2 General register Undefined Note 2 Port (Output latch) Ports 0 t[...]

  • Seite 526

    526 CHAPTER 24 RESET FUNCTION Table 24-1. Hardware Status after Reset (2/2) Hardware Status after Reset Watch timer Mode control register (TMC2) 00H Clock select register (TCL2) 00H Mode register (WDTM) 00H Clock select register (TCL3) 88H Shift registers (SIO0, SIO1) Undefined Mode registers (CSIM0, CSIM1, CSIM2) 00H Serial bus interface control r[...]

  • Seite 527

    527 Match CORENn CORSTn Program counter (PC) Comparator Correction address register n (CORADn) Internal bus Correction control register Correction branch request signal (BR !7FDH) CHAPTER 25 ROM CORRECTION 25.1 ROM Correction Functions The µ PD78058F, 78058FY Subseries can replace part of a program in the mask ROM with a program in the internal ex[...]

  • Seite 528

    528 CHAPTER 25 ROM CORRECTION FF3AH/FF3BH 0000H Symbol 15 CORAD0 0 Address FF38H/FF39H After Reset 0000H R/W R/W CORAD1 R/W (1) Correction address registers 0 and 1 (CORAD0, CORAD1) These registers set the start address (correction address) of the instruction(s) to be corrected in the mask ROM. The ROM correction corrects two places (max.) of the p[...]

  • Seite 529

    529 CHAPTER 25 ROM CORRECTION 7 0 6 0 5 0 4 0 COREN1 CORST1 COREN0 CORST0 Symbol CORCN Address FF8AH After Reset COREN0 0 1 CORST0 0 1 COREN1 0 1 CORST1 0 1 R/W R/W Note 00H Correction address register 0 and fetch address match detection Not detected Detected Correction address register 0 and fetch address match detection control Disabled Enabled C[...]

  • Seite 530

    530 CHAPTER 25 ROM CORRECTION 25.4 ROM Correction Application (1) Store the correction address and instruction after correction (patch program) to nonvolatile memory (such as EEPROM TM ) outside the microcontroller. When two places should be corrected, store the branch destination judgment program as well. The branch destination judgment program ch[...]

  • Seite 531

    531 CHAPTER 25 ROM CORRECTION No Yes Initialization Load the contents of external nonvolatile memory into internal expansion RAM Correction address register setting ROM correction enabled Is ROM correction used ? Note ROM correction Main program (2) Assemble in advance the initialization routine as shown in Figure 25-6 to correct the program. Figur[...]

  • Seite 532

    532 CHAPTER 25 ROM CORRECTION No Yes Internal ROM program start Does fetch address match with correction address? Set correction status flag Correction branch (branch to address F7FDH) Correction program execution ROM correction Figure 25-7. ROM Correction Operation[...]

  • Seite 533

    533 CHAPTER 25 ROM CORRECTION ADD A, #2 BR !1002H BR !F702H ADD A, #1 MOV B, A 0000H 0080H Program start 1000H 1002H Internal ROM Internal Expansion RAM F400H F702H F7FDH F7FFH (1) (2) (3) EFFFH 25.5 ROM Correction Example The example of ROM correction when the instruction at address 1000H “ADD A, #1” is changed to “ADD A, #2” is as follows[...]

  • Seite 534

    534 CHAPTER 25 ROM CORRECTION Correction Place Internal ROM Internal ROM JUMP FFFFH F7FFH F7FDH xxxxH 0000H (1) (2) (3) BR !JUMP Correction Program 25.6 Program Execution Flow Figures 25-9 and 25-10 show the program transition diagrams when the ROM correction is used. Figure 25-9. Program Transition Diagram (When One Place Is Corrected) (1) Branche[...]

  • Seite 535

    535 CHAPTER 25 ROM CORRECTION Internal ROM Correction Place 1 Internal ROM JUMP Internal ROM (1) (2) (3) (4) (5) (6) (7) (8) FFFFH F7FFH F7FDH yyyyH xxxxH 0000H BR !JUMP Destination judge program Correction program 2 Correction program 1 Correction Place 2 Figure 25-10. Program Transition Diagram (When Two Places Are Corrected) (1) Branches to addr[...]

  • Seite 536

    536 CHAPTER 25 ROM CORRECTION 25.7 Cautions on ROM Correction (1) Address values set in correction address registers 0 and 1 (CORAD0 and CORAD1) must be addresses where instruction codes are stored. (2) Correction address registers 0 and 1 (CORAD0 and CORAD1) should be set when the correction enable flags (COREN0, COREN1) are “0” (when correcti[...]

  • Seite 537

    537 CHAPTER 26 µ PD78P058F, 78P058FY The µ PD78P058F and 78P058FY are products which have one time PROM incorporated into them, which it is only possible to write to once. The differences between PROM products ( µ PD78P058F and 78P058FY) and ROM products ( µ PD78056F, 78056FY, 78058F and 78058FY) are shown in Table 26-1. Table 26-1. Differences[...]

  • Seite 538

    538 CHAPTER 26 µ PD78P058F, 78P058FY 26.1 Memory Size Switching Register In the µ PD78P058F and 78P058FY, internal memory can be selected through the memory size select register (IMS). The same memory mapping as that of mask ROM versions that have a different internal memory can be done by setting IMS. IMS is set with an 8-bit memory manipulation[...]

  • Seite 539

    539 CHAPTER 26 µ PD78P058F, 78P058FY 7 0 Symbol IXS 6 0 5 0 4 0 3 IXRAM3 2 IXRAM2 1 IXRAM1 0 IXRAM0 Address FFF4H 0AH After Reset Internal Extension RAM Capacity Selection IXRAM3 IXRAM2 IXRAM1 1024 bytes 10 1 Setting prohibited Other than above IXRAM0 0 R/W W 0 bytes 11 00 26.2 Internal Expansion RAM Size Switching Register The internal expansion [...]

  • Seite 540

    540 CHAPTER 26 µ PD78P058F, 78P058FY Program inhibit High impedance 26.3 PROM Programming The µ PD78P058F and 78P058FY include on-chip PROM in a 60 Kbyte configuration as program memory. To write a program into the µ PD78P058F or 78P058FY PROM, make the device enter the PROM programming mode by setting the levels of the V PP and RESET pins as sp[...]

  • Seite 541

    541 CHAPTER 26 µ PD78P058F, 78P058FY (3) Standby mode Setting CE to H sets the standby mode. In this mode, data output becomes high impedance irrespective of the status of OE. (4) Page data latch mode Setting CE to H, PGM to H, and OE to L at the start of the page write mode sets the page data latch mode. In this mode, 1-page 4-byte data is latche[...]

  • Seite 542

    542 CHAPTER 26 µ PD78P058F, 78P058FY 26.3.2 PROM write procedure Figure 26-3. Page Program Mode Flowchart Start Address = G V DD = 6.5 V, V PP = 12.5 V X = 0 Latch Address = Address + 1 Latch Address = Address + 1 Latch Address = Address + 1 Latch X = X + 1 0.1-ms program pulse Verify 4 Bytes Pass Address = N? No Pass V DD = 4.5 to 5.5 V, V PP = V[...]

  • Seite 543

    543 CHAPTER 26 µ PD78P058F, 78P058FY Page Data Latch Page Program Program Verify Data Input Data Output Hi-Z A2 to A16 A0, A1 D0 to D7 V PP V DD V PP V DD +1.5 V DD V DD V IH CE PGM OE V IL V IH V IL V IH V IL Figure 26-4. Page Program Mode Timing[...]

  • Seite 544

    544 CHAPTER 26 µ PD78P058F, 78P058FY Figure 26-5. Byte Program Mode Flowchart Start Address = G V DD = 6.5 V, V PP = 12.5 V X = 0 X = X + 1 0.1-ms program pulse Verify Address = N? V DD = 4.5 to 5.5 V, V PP = V DD All bytes verified? End of write Fail Fail Pass Yes All Pass No Pass Defective product No Yes X = 10? Address = Address + 1 Remark: G =[...]

  • Seite 545

    545 CHAPTER 26 µ PD78P058F, 78P058FY A0 to A16 D0 to D7 Program Program Verify Data Input Data Output V PP V DD V DD +1.5 V DD V IH V IL V IH V IL V IH V IL V PP V DD CE PGM OE Figure 26-6. Byte Program Mode Timing Cautions 1. Be sure to apply V DD before applying V PP , and remove it after removing V PP . 2. V PP must not exceed +13.5 V including[...]

  • Seite 546

    546 CHAPTER 26 µ PD78P058F, 78P058FY Address Input A0 to A16 CE (Input) OE (Input) D0-D7 Hi-Z Data Output Hi-Z 26.3.3 PROM read procedure PROM contents can be read onto the external data bus (D0 to D7) using the following procedure. (1) Fix the RESET pin low, and supply +5 V to the V PP pin. Unused pins are handled as shown in paragraph, (2) PROM [...]

  • Seite 547

    547 CHAPTER 26 µ PD78P058F, 78P058FY 26.4 Screening of One-Time PROM Versions One-time PROM versions cannot be fully tested by NEC before shipment due to the structure of one-time PROM. Therefore, after users have written data into the PROM, screening should be implemented by user: that is, store devices at high temperature for one day as specifie[...]

  • Seite 548

    548 [MEMO][...]

  • Seite 549

    549 CHAPTER 27 INSTRUCTION SET This chapter describes each instruction set of the µ PD78058F and 78058FY Subseries as list table. For details of its operation and operation code, refer to the separate document 78K/0 Series USER’S MANUAL—Instructions (U12326E) .[...]

  • Seite 550

    550 CHAPTER 27 INSTRUCTION SET 27.1 Legends Used in Operation List 27.1.1 Operand identifiers and description methods Operands are described in “Operand” column of each instruction in accordance with the description method of the instruction operand identifier (refer to the assembler specifications for detail). When there are two or more descri[...]

  • Seite 551

    551 CHAPTER 27 INSTRUCTION SET 27.1.2 Description of “operation” column A : A register; 8-bit accumulator X : X register B : B register C : C register D : D register E : E register H : H register L : L register AX : AX register pair; 16-bit accumulator BC : BC register pair DE : DE register pair HL : HL register pair PC : Program counter SP : S[...]

  • Seite 552

    552 CHAPTER 27 INSTRUCTION SET 27.2 Operation List Clock Flag Note 1 Note 2 ZA C C Y r, #byte 2 4 – r ← byte saddr, #byte 3 6 7 (saddr) ← byte sfr, #byte 3 – 7 sfr ← byte A, r Note 3 12 – A ← r r, A Note 3 12 – r ← A A, saddr 2 4 5 A ← (saddr) saddr, A 2 4 5 (saddr) ← A A, sfr 2 – 5 A ← sfr sfr, A 2 – 5 sfr ← A A, !add[...]

  • Seite 553

    553 CHAPTER 27 INSTRUCTION SET Clock Flag Note 1 Note 2 ZA C C Y rp, #word 3 6 – rp ← word saddrp, #word 4 8 10 (saddrp) ← word sfrp, #word 4 – 10 sfrp ← word AX, saddrp 2 6 8 AX ← (saddrp) saddrp, AX 2 6 8 (saddrp) ← AX MOVW AX, sfrp 2 – 8 AX ← sfrp sfrp, AX 2 – 8 sfrp ← AX AX, rp Note 3 1 4 – AX ← rp rp, AX Note 3 1 4 ?[...]

  • Seite 554

    554 CHAPTER 27 INSTRUCTION SET Clock Flag Note 1 Note 2 ZA C C Y A, #byte 2 4 – A, CY ← A – byte ×× × saddr, #byte 3 6 8 (saddr), CY ← (saddr) – byte ×× × A, r Note 3 2 4 – A, CY ← A – r ×× × r, A 2 4 – r, CY ← r – A ×× × A, saddr 2 4 5 A, CY ← A – (saddr) ×× × A, !addr16 3 8 9 + n A, CY ← A – (addr16) ?[...]

  • Seite 555

    555 CHAPTER 27 INSTRUCTION SET Clock Flag Note 1 Note 2 ZA C C Y A, #byte 2 4 – A ← A byte × saddr, #byte 3 6 8 (saddr) ← (saddr) byte × A, r Note 3 24 – A ← A r × r, A 2 4 – r ← r A × A, saddr 2 4 5 A ← A (saddr) × A, !addr16 3 8 9 + n A ← A (addr16) × A, [HL] 1 4 5 + n A ← A (HL) × A, [HL + byte] 2 8 9 + n A ← A (HL +[...]

  • Seite 556

    556 CHAPTER 27 INSTRUCTION SET Clock Flag Note 1 Note 2 ZA C C Y ADDW AX, #word 3 6 – AX, CY ← AX + word ×× × SUBW AX, #word 3 6 – AX, CY ← AX – word ×× × CMPW AX, #word 3 6 – AX – word ×× × MULU X 2 16 – AX ← A × X DIVUW C 2 25 – AX (Quotient), C (Remainder) ← AX ÷ C r1 2 – r ← r + 1 ×× saddr 2 4 6 (saddr) ?[...]

  • Seite 557

    557 CHAPTER 27 INSTRUCTION SET Clock Flag Note 1 Note 2 ZA C C Y CY, saddr.bit 3 6 7 CY ← CY (saddr.bit) × CY, sfr.bit 3 – 7 CY ← CY sfr.bit × AND1 CY, A.bit 2 4 – CY ← CY A.bit × CY, PSW.bit 3 – 7 CY ← CY PSW.bit × CY, [HL].bit 2 6 7 + n CY ← CY (HL).bit × CY, saddr.bit 3 6 7 CY ← CY (saddr.bit) × CY, sfr.bit 3 – 7 CY ←[...]

  • Seite 558

    558 CHAPTER 27 INSTRUCTION SET Clock Flag Note 1 Note 2 ZA C C Y (SP – 1) ← (PC + 3) H , (SP – 2) ← (PC + 3) L , PC ← addr16, SP ← SP – 2 (SP – 1) ← (PC + 2) H , (SP – 2) ← (PC + 2) L , CALLF !addr11 2 5 – PC 15 – 11 ← 00001, PC 10 – 0 ← addr11, SP ← SP – 2 (SP – 1) ← (PC + 1) H , (SP – 2) ← (PC + 1) L , [...]

  • Seite 559

    559 CHAPTER 27 INSTRUCTION SET Clock Flag Note 1 Note 2 ZA C C Y saddr.bit, $addr16 3 8 9 PC ← PC + 3 + jdisp8 if(saddr.bit) = 1 sfr.bit, $addr16 4 – 11 PC ← PC + 4 + jdisp8 if sfr.bit = 1 BT A.bit, $addr16 3 8 – PC ← PC + 3 + jdisp8 if A.bit = 1 PSW.bit, $addr16 3 – 9 PC ← PC + 3 + jdisp8 if PSW.bit = 1 [HL].bit, $addr16 3 10 11 + n [...]

  • Seite 560

    560 CHAPTER 27 INSTRUCTION SET 27.3 Instructions Listed by Addressing Type (1) 8-bit instructions MOV, XCH, ADD, ADDC, SUB, SUBC, AND, OR, XOR, CMP, MULU, DIVUW, INC, DEC, ROR, ROL, RORC, ROLC, ROR4, ROL4, PUSH, POP, DBNZ[...]

  • Seite 561

    561 CHAPTER 27 INSTRUCTION SET Second Operand [HL + byte] #byte A r Note sfr saddr !addr16 PSW [DE] [HL] [HL + B] $addr16 1 None First Operand [HL + C] A ADD MOV MOV MOV MOV MOV MOV MOV MOV ROR ADDC XCH XCH XCH XCH XCH XCH XCH ROL SUB ADD ADD ADD ADD ADD RORC SUBC ADDC ADDC ADDC ADDC ADDC ROLC AND SUB SUB SUB SUB SUB OR SUBC SUBC SUBC SUBC SUBC XOR[...]

  • Seite 562

    562 CHAPTER 27 INSTRUCTION SET (2) 16-bit instructions MOVW, XCHW, ADDW, SUBW, CMPW, PUSH, POP, INCW, DECW Second Operand First Operand AX ADDW MOVW MOVW MOVW MOVW MOVW SUBW XCHW CMPW rp MOVW MOVW Note INCW DECW PUSH POP sfrp MOVW MOVW saddrp MOVW MOVW !addr16 MOVW SP MOVW MOVW Note Only when rp = BC, DE, HL (3) Bit manipulation instructions MOV1, [...]

  • Seite 563

    563 CHAPTER 27 INSTRUCTION SET AX !addr16 !addr11 [addr5] $addr16 (4) Call/instructions/branch instructions CALL, CALLF, CALLT, BR, BC, BNC, BZ, BNZ, BT, BF, BTCLR, DBNZ Second Operand First Operand Basic instruction BR CALL CALLF CALLT BR BR BC BNC BZ BNZ Compound BT instruction BF BTCLR DBNZ (5) Other instructions ADJBA, ADJBS, BRK, RET, RETI, RE[...]

  • Seite 564

    564 [MEMO][...]

  • Seite 565

    565 APPENDIX A. DIFFERENCES AMONG µ PD78054, 78058F, AND 780058 SUBSERIES The major differences among the µ PD78054, 78058F, and 780058 Subseries are shown in Table A-1. Table A-1. Major Differences Among µ PD78054, 78058F, and 780058 Subseries (1/2) Product Name µ PD78054 Subseries µ PD78058F Subseries µ PD780058 Subseries Item EMI noise cou[...]

  • Seite 566

    566 APPENDIX A. DIFFERENCES AMONG µ PD78054, 78058F, AND 780058 SUBSERIES Table A-1. Major Differences Among µ PD78054, 78058F, and 780058 Subseries (2/2) Product Name µ PD78054 Subseries µ PD78058F Subseries µ PD780058 Subseries Item Emulation probe EP-78230GC-R, EP-780058GC-R, EP-78054GK-R EP-780058GK-R Device file DF78054 DF780058 Package ?[...]

  • Seite 567

    567 APPENDIX B DEVELOPMENT TOOLS The following development tools are available for the development of systems that employ the µ PD78058F and 78058FY Subseries. Figure B-1 shows the configuration of the development tools.[...]

  • Seite 568

    568 APPENDIX B DEVELOPMENT TOOLS Figure B-1. Development Tool Configuration (1/2) (1) When using in-circuit emulator IE-78K0-NS Debugging tools • System simulator • Integrated debugger • Device file Language processing software • Assembler package • C compiler package • C library source file • Device file Tool for PROM writing • PG-[...]

  • Seite 569

    569 APPENDIX B DEVELOPMENT TOOLS Figure B-1. Development Tool Configuration (2/2) (2) When using in-circuit emulator IE-78001-R-A Remark The areas shown with dotted lines differ depending on the development environment. Refer to B.3.1 Hardware . Debugging tools • System simulator • Integrated debugger • Device file Language processing softwar[...]

  • Seite 570

    570 APPENDIX B DEVELOPMENT TOOLS B.1 Language Processing Software RA78K/0 Program that converts program written in mnemonic into object codes that Assembler package can be executed by microcontroller. In addition, automatic functions to generate symbol table and optimize branch instructions are also provided. Used in combination with optional devic[...]

  • Seite 571

    571 APPENDIX B DEVELOPMENT TOOLS B.2 PROM Programming Tool B.2.1 Hardware PG-1500 This is a PROM programmer capable of programming the single-chip microcontroller with on-chip PROM programmer PROM by manipulating from the stand-alone or host machine through connection of the separately available programmer adapter and the attached board. It can als[...]

  • Seite 572

    572 APPENDIX B DEVELOPMENT TOOLS B.3 Debugging Tool B.3.1 Hardware (1/2) (1) When using in-circuit emulator IE-78K0-NS IE-78K0-NS Note The in-circuit emulator serves to debug hardware and software when In-circuit emulator developing application systems using a 78K/0 Series product. It corresponds to integrated debugger (ID78K0-NS). This emulator sh[...]

  • Seite 573

    573 APPENDIX B DEVELOPMENT TOOLS B.3.1 Hardware (2/2) (2) When using in-circuit emulator IE-78001-R-A IE-78001-R-A Note 1 The in-circuit emulator serves to debug hardware and software when In-circuit emulator developing application systems using a 78K/0 Series product. It corresponds to integrated debugger (ID78K0). This emulator should be used in [...]

  • Seite 574

    574 APPENDIX B DEVELOPMENT TOOLS B.3.2 Software (1/2) SM78K0 This simulator can debug target system at C source level or assembler level while System simulator simulating operation of target system on host machine. SM78K0 runs on Windows. By using SM78K0, logic and performance of application can be verified without in-circuit emulator independently[...]

  • Seite 575

    575 APPENDIX B DEVELOPMENT TOOLS B.3.2 Software (2/2) ID78K0-NS Note This is a control program that is used to debug the 78K/0 Series. Integrated debugger It uses Windows on a personal computer and OSF/Motif TM on EWS as a (Supports the in-circuit graphical user interface, and has the appearance and operability conforming emulator IE-78K0-NS) to th[...]

  • Seite 576

    576 APPENDIX B DEVELOPMENT TOOLS B.4 OS for IBM PC The following OSs for the IBM PC are supported. Table B-1. OS for IBM PC OS Version PC DOS Ver. 5.02 to Ver. 6.3 J6.1/V Note to J6.3/V Note IBM DOS TM J5.02/V Note MS-DOS Ver. 5.0 to Ver. 6.22 5.0/V Note to 6.2/V Note Note Only English mode is supported. Caution Although Ver. 5.0 or later have a ta[...]

  • Seite 577

    577 APPENDIX B DEVELOPMENT TOOLS Drawing and Footprint for Conversion Socket (EV-9200GC-80) Figure B-2. EV-9200GC-80 Drawings (For Reference Only) A F D 1 No .1 pin inde x E EV -9200GC-80 B C M N O L K S R Q P I H J G EV -9200GC-80-G1E ITEM MILLIMETERS INCHES A B C D E F G H I J K L M N O P Q R S 18.0 14.4 14.4 18.0 4-C 2.0 0.8 6.0 16.0 18.7 6.0 16[...]

  • Seite 578

    578 APPENDIX B DEVELOPMENT TOOLS Figure B-3. EV-9200GC-80 Footprints (For Reference Only) F E D G H I J K L C B A 0.026 × 0.748=0.486 0.026 × 0.748=0.486 EV-9200GC-80-P1 ITEM MILLIMETERS INCHES A B C D E F G H I J K L 19.7 15.0 15.0 19.7 6.0 ± 0.05 6.0 ± 0.05 0.35 ± 0.02 2.36 ± 0.03 2.3 1.57 ± 0.03 0.776 0.591 0.591 0.776 0.236 0.236 0.014 0[...]

  • Seite 579

    579 APPENDIX B DEVELOPMENT TOOLS Drawing of Conversion Adapter (TGK-080SDW) Figure B-4. TGK-080SDW Drawings (For Reference) (unit: mm) ITEM MILLIMETERS INCHES b 0.25 0.010 c 5.3 0.209 a 0.5x19=9.5±0.10 0.020x0.748=0.374±0.004 d 5.3 0.209 h 1.85±0.2 0.073±0.008 i 3.5 0.138 j 2.0 0.079 e 1.3 0.051 f 3.55 g 0.3 0.012 0.140 ITEM MILLIMETERS INCHES [...]

  • Seite 580

    580 [MEMO][...]

  • Seite 581

    581 APPENDIX C EMBEDDED SOFTWARE This chapter describes the embedded software that is available for the µ PD78058F and 78058FY Subseries to allow users to develop and maintain application programs for these subseries.[...]

  • Seite 582

    582 APPENDIX C EMBEDDED SOFTWARE C.1 Real-time OS (1/2) RX78K/0 RX78K/0 is real-time OS conforming to µ ITRON specifications. Real-time OS Tool (configurator) that generates nucleus of RX78K/0 and plural information tables is supplied. Used in combination with an optional assembler package (RA78K/0) and device file (DF78054). <Precautions when [...]

  • Seite 583

    583 APPENDIX C EMBEDDED SOFTWARE Real-time OS (2/2) MX78K0 µ ITRON-specification subset OS. Nucleus of MX78K0 is supplied. OS This OS performs task management, event management, and time management. It controls the task execution sequence for task management and selects the task to be executed next. <Precautions when using MX78K0 under PC envir[...]

  • Seite 584

    584 [MEMO][...]

  • Seite 585

    585 APPENDIX D REGISTER INDEX D.1 Register Index (Register Name) [A] A/D conversion result register (ADCR) ............................................................................................................. 2 64 A/D converter input select register (ADIS) .....................................................................................[...]

  • Seite 586

    586 APPENDIX D REGISTER INDEX Interrupt request flag register 1L (IF1L) ................................................................................................... 483, 503 Interrupt timing specify register (SINT) ........................................................................... 298, 316, 351, 360, 370 [K] Key return mode register[...]

  • Seite 587

    587 APPENDIX D REGISTER INDEX [S] Sampling clock select register (SCS) ......................................................................................................... 186, 488 Serial bus interface control register (SBIC) ............................................ 296, 302, 314, 333, 349, 355, 360, 369 Serial I/O shift register 0 (SIO0) [...]

  • Seite 588

    588 APPENDIX D REGISTER INDEX CR00: Capture/compare register 00 .......................................................................................................... 1 77 CR01: Capture/compare register 01 .......................................................................................................... 1 77 CR10: Compare registers 10 .[...]

  • Seite 589

    589 APPENDIX D REGISTER INDEX PCC: Processor clock control register ..................................................................................................... 1 57 PM0: Port mode register 0 .............................................................................................................. 130, 146 PM12: Port mode register 12 .[...]

  • Seite 590

    590 APPENDIX D REGISTER INDEX TOC1: 8-bit timer output control register ................................................................................................... 22 3 TXS: Transmit shift register ..................................................................................................................... 4 37 [W] WDTM: Watchdog ti[...]

  • Seite 591

    591 APPENDIX E REVISION HISTORY Major revisions by edition and revised chapters are shown below. Edition Major Revisions from Previous Edition Revised Chapters 2nd The following products have already been developed: Throughout µ PD78056GC- ××× -8BT, 78058FGC- ××× -8BT, 78P058FGC-8BT, 78056FYGC- ××× -8BT, 78058FYGC- ××× -88BT The block [...]

  • Seite 592

    592 [MEMO][...]

  • Seite 593

    Although NEC has taken all possible steps to ensure that the documentation supplied to our customers is complete, bug free and up-to-date, we readily accept that errors may occur. Despite all the care and precautions we've taken, you may encounter problems in the documentation. Please complete this form whenever you' d like to report erro[...]