NEC PD754144 manual

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

Ir para a página of

Bom manual de uso

As regras impõem ao revendedor a obrigação de fornecer ao comprador o manual com o produto NEC PD754144. A falta de manual ou informações incorretas fornecidas ao consumidor são a base de uma queixa por não conformidade do produto com o contrato. De acordo com a lei, pode anexar o manual em uma outra forma de que em papel, o que é frequentemente utilizado, anexando uma forma gráfica ou manual electrónicoNEC PD754144 vídeos instrutivos para os usuários. A condição é uma forma legível e compreensível.

O que é a instrução?

A palavra vem do latim "Instructio" ou instruir. Portanto, no manual NEC PD754144 você pode encontrar uma descrição das fases do processo. O objetivo do manual é instruir, facilitar o arranque, a utilização do equipamento ou a execução de determinadas tarefas. O manual é uma coleção de informações sobre o objeto / serviço, um guia.

Infelizmente, pequenos usuários tomam o tempo para ler o manual NEC PD754144, e um bom manual não só permite conhecer uma série de funcionalidades adicionais do dispositivo, mas evita a formação da maioria das falhas.

Então, o que deve conter o manual perfeito?

Primeiro, o manual NEC PD754144 deve conte:
- dados técnicos do dispositivo NEC PD754144
- nome do fabricante e ano de fabricação do dispositivo NEC PD754144
- instruções de utilização, regulação e manutenção do dispositivo NEC PD754144
- sinais de segurança e certificados que comprovam a conformidade com as normas pertinentes

Por que você não ler manuais?

Normalmente, isso é devido à falta de tempo e à certeza quanto à funcionalidade específica do dispositivo adquirido. Infelizmente, a mesma ligação e o arranque NEC PD754144 não são suficientes. O manual contém uma série de orientações sobre funcionalidades específicas, a segurança, os métodos de manutenção (mesmo sobre produtos que devem ser usados), possíveis defeitos NEC PD754144 e formas de resolver problemas comuns durante o uso. No final, no manual podemos encontrar as coordenadas do serviço NEC na ausência da eficácia das soluções propostas. Atualmente, muito apreciados são manuais na forma de animações interessantes e vídeos de instrução que de uma forma melhor do que o o folheto falam ao usuário. Este tipo de manual é a chance que o usuário percorrer todo o vídeo instrutivo, sem ignorar especificações e descrições técnicas complicadas NEC PD754144, como para a versão papel.

Por que ler manuais?

Primeiro de tudo, contem a resposta sobre a construção, as possibilidades do dispositivo NEC PD754144, uso dos acessórios individuais e uma gama de informações para desfrutar plenamente todos os recursos e facilidades.

Após a compra bem sucedida de um equipamento / dispositivo, é bom ter um momento para se familiarizar com cada parte do manual NEC PD754144. Atualmente, são cuidadosamente preparados e traduzidos para sejam não só compreensíveis para os usuários, mas para cumprir a sua função básica de informação

Índice do manual

  • Página 1

    User’s Manual Printed in Japan µ PD754144, 754244 4-Bit Single-Chip Micr ocontr oller s µ PD754144 µ PD754244 Document No . U10676EJ3V0UM00 (3rd edition) Date Published Nov ember 2002 N CP(K) 1997[...]

  • Página 2

    2 User’ s Manual U10676EJ3V0UM [MEMO][...]

  • Página 3

    3 User’ s Manual U10676EJ3V0UM EEPROM is a trademark of NEC Electronics Corporation. MS-DOS is either a registered trademark or a trademark of Microsoft Corporation in the United States and/or other countries. IBM DOS, PC/AT, and PC DOS are trademarks of International Business Machines Corporation. This product cannot be used for an IC card (SMAR[...]

  • Página 4

    4 User ’ s Manual U10676EJ3V0UM These commodities, technology or software, must be exported in accordance with the export administration regulations of the exporting country. Diversion contrary to the law of that country is prohibited. The information in this document is current as of July, 2002. The information is subject to change without notic[...]

  • Página 5

    5 User ’ s Manual U10676EJ3V0UM Regional Information • Device availability • Ordering information • Product release schedule • Availability of related technical literature • Development environment specifications (for example, specifications for third-party tools and components, host computers, power plugs, AC supply voltages, and so fo[...]

  • Página 6

    6 User ’ s Manual U10676EJ3V0UM Major Revisions in This Edition Pages Description p.210 Correction of description in figure in 7.9 Application of Interrupt (6) Executing pending interrupt - interrupt occurs during interrupt service (INTBT has higher priority and INTT0 and INTT2 have lower priority) p.253 Correction of instruction code of “ BR B[...]

  • Página 7

    7 User’ s Manual U10676EJ3V0UM INTRODUCTION Readers This manual is intended for user engineers who wish to understand the functions of the µ PD754144 and 754244 and design application systems using these microcontrollers. Purpose This manual is intended to give users an understanding of the hardware functions of the µ PD754144 and 754244 descri[...]

  • Página 8

    8 User’ s Manual U10676EJ3V0UM Related Documents The related documents indicated in this pub lication may include preliminary versions. Howe v er , preliminar y versions are not marked as such. Documents related to devices Document Name Document No. µ PD754144, 754244 Data Sheet U10040E µ PD754144, 754244 User’s Manual This manual 75XL Series[...]

  • Página 9

    9 User’ s Manual U10676EJ3V0UM T ABLE OF CONTENTS CHAPTER 1 GENERAL ..................................................................................................................... 17 1.1 Functional Outline ............................................................................................................. 18 1.2 Ordering Inf ormati[...]

  • Página 10

    10 User’ s Manual U10676EJ3V0UM 4.6 Accumulator ........................................................................................................................ 7 0 4.7 Stack P ointer (SP) and Stac k Bank Select Register (SBS) .......................................... 70 4.8 Program Status W ord (PSW) ....................................[...]

  • Página 11

    11 User’ s Manual U10676EJ3V0UM CHAPTER 7 INTERRUPT AND TEST FUNCTIONS ........................................................................ 1 86 7.1 Configuration of Interrupt Controller .............................................................................. 18 6 7.2 T ypes of Interrupt Sour ces and V ector T able .....................[...]

  • Página 12

    12 User’ s Manual U10676EJ3V0UM 11.4.10 Branch instructions ................................................................................................................ 2 79 11.4.11 Subroutine/stack control instructions .................................................................................... 283 11.4.12 Interrupt control instr uct[...]

  • Página 13

    13 User’ s Manual U10676EJ3V0UM LIST OF FIGURES (1/3) Figure No . Title P age 3-1 Selecting MBE = 0 Mode and MBE = 1 Mode .................................................................................. 33 3-2 Data Memory Configuration and Addressing Range for Each Addressing Mode ............................ 35 3-3 Updating Address of Static R[...]

  • Página 14

    14 User’ s Manual U10676EJ3V0UM LIST OF FIGURES (2/3) Figure No . Title P age 6-18 Example of Incorrect Resonator Connection ..................................................................................... 1 09 6-19 CPU Clock Switching Example ...................................................................................................[...]

  • Página 15

    15 User’ s Manual U10676EJ3V0UM LIST OF FIGURES (3/3) Figure No . Title P age 7-9 Interrupt Nesting by Changing Interrupt Status Flag ........................................................................ 1 99 7-10 Block Diagr am of KR4 to KR7 ......................................................................................................[...]

  • Página 16

    16 User’ s Manual U10676EJ3V0UM LIST OF T ABLES T able No . Title P age 2-1 Pin Functions of Digital I/O P or ts ....................................................................................................... 2 4 2-2 Functions of Non-P or t Pins ..............................................................................................[...]

  • Página 17

    17 User’ s Manual U10676EJ3V0UM CHAPTER 1 GENERAL The µ PD754144 and 754244 are 4-bit single-chip microcontrollers in the NEC 75XL Series, the successor to the 75X Series that boasts a wealth of variations. The µ PD754144 and 754244 have extended CPU functions compared to the µ PD75048, a 75X Series product with on-chip EEPROM, enabling high-s[...]

  • Página 18

    CHAPTER 1 GENERAL 18 User’ s Manual U10676EJ3V0UM 1.1 Functional Outline Item µ PD754144 µ PD754244 Instruction execution time • 4, 8, 16, 64 µ s (at f CC = 1.0 MHz) • 0.95, 1.91, 3.81, 15.3 µ s (at f X = 4.19 MHz) • 0.67, 1.33, 2.67, 10.7 µ s (at f X = 6.00 MHz) On-chip Mask ROM 4096 × 8 bits (0000H to 0FFFH) memory RAM 128 × 4 bits[...]

  • Página 19

    CHAPTER 1 GENERAL 19 User’ s Manual U10676EJ3V0UM 1.2 Ordering Information Part Number Package µ PD754141GS- ××× -BA5 20-pin plastic SOP (7.62 mm (300)) µ PD754141GS- ××× -GJG 20-pin plastic SSOP (7.62 mm (300)) µ PD754244GS- ××× -BA5 20-pin plastic SOP (7.62 mm (300)) µ PD754244GS- ××× -GJG 20-pin plastic SSOP (7.62 mm (300)) Rem[...]

  • Página 20

    CHAPTER 1 GENERAL 20 User’ s Manual U10676EJ3V0UM 1.4 Block Diagram Basic interval timer/watchdog timer 8-bit timer counter #0 8-bit timer counter #1 8-bit timer counter #2 Cascaded 16-bit timer counter Interrupt control Programmable threshold port INTBT RESET INTT0 TOUT INTT1 INTT2 PTO0/P30 PTO1/P31 PTO2/P32 INT0/P61 KRREN KR4/P70- KR7/P73 AV RE[...]

  • Página 21

    CHAPTER 1 GENERAL 21 User ’ s Manual U10676EJ3V0UM 1.5 Pin Configuration (Top View) • Pin configuration of µ PD754144 • 20-pin plastic SOP (7.62 mm (300)) µ PD754144GS- ××× -BA5 • 20-pin plastic SSOP (7.62 mm (300)) µ PD754144GS- ××× -GJG 1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 RESET CL1 CL2 V SS IC V DD P60/AV REF P61/I[...]

  • Página 22

    CHAPTER 1 GENERAL 22 User ’ s Manual U10676EJ3V0UM • Pin configuration of µ PD754244 • 20-pin plastic SOP (7.62 mm (300)) µ PD754244GS- ××× -BA5 • 20-pin plastic SSOP (7.62 mm (300)) µ PD754244GS- ××× -GJG IC: Internally Connected (Directly connect to V DD .) 1 2 3 4 5 6 7 8 9 10 20 19 18 17 16 15 14 13 12 11 RESET X1 X2 V SS IC V [...]

  • Página 23

    CHAPTER 1 GENERAL 23 User’ s Manual U10676EJ3V0UM Pin Name P30 to P33: Port 3 P60 to P63: Port 6 P70 to P73: Port 7 P80: Port 8 KR4 to KR7: Key return 4 to 7 INT0: External vectored interrupt 0 PTH00, PTH01: Programmable threshold port analog input 0, 1 PTO0 to PTO2: Programmable timer output 0 to 2 KRREN: Key return reset enable CL1, CL2: RC osc[...]

  • Página 24

    24 User’ s Manual U10676EJ3V0UM CHAPTER 2 PIN FUNCTIONS 2.1 Pin Functions of µ PD754244 Table 2-1. Pin Functions of Digital I/O Ports Pin Name I/O Alternate Function 8-Bit After Reset I/O Circuit Function I/O Type Note 1 P30 I/O PTO0 × Input E-B P31 PTO1 P32 PTO2 P33 – P60 I/O AV REF × Input F -A P61 INT0 P62 PTH00 P63 PTH01 P70 Input KR4 ×[...]

  • Página 25

    CHAPTER 2 PIN FUNCTIONS 25 User’ s Manual U10676EJ3V0UM Table 2-2. Functions of Non-Port Pins Pin Name I/O Alternate Function After Reset I/O Circuit Function Type Note PTO0 Output P3 0 Timer counter output pins. Input E-B PTO1 P31 PTO2 P32 INT0 Input P61 Edge-detected vectored interrupt input Input F -A (edge to be detected is selectable). Noise[...]

  • Página 26

    CHAPTER 2 PIN FUNCTIONS 26 User’ s Manual U10676EJ3V0UM 2.2 Description of Pin Functions 2.2.1 P30 to P33 (Port 3) ... I/O pins shared with PTO0 to PTO2 P60 to P63 (Port 6) ... I/O pins shared with AV REF , INT0, PTH00, PTH01 P80 (Port 8) ... I/O pin These are 4-bit I/O ports with output latches (ports 3 and 6) and a 1-bit I/O port with an output[...]

  • Página 27

    CHAPTER 2 PIN FUNCTIONS 27 User’ s Manual U10676EJ3V0UM 2.2.4 INT0 ... input pin shared with port 6 This pin inputs the vectored interrupt signal detected by the edge. A noise eliminator is selectable for INT0. The edge to be detected can be specified by using the edge detection mode register (IM0). (1) INT0 (bits 0 and 1 of IM0) (a) Active at ri[...]

  • Página 28

    CHAPTER 2 PIN FUNCTIONS 28 User’ s Manual U10676EJ3V0UM 2.2.8 AV REF ... input pin shared with port 6 This is a reference voltage input pin. An analog reference voltage for the programmable threshold port is input. 2.2.9 CL1 and CL2 ( µ PD754144 only) These pins are used to connect the RC oscillator resistor (R) and capacitor (C) of the system c[...]

  • Página 29

    CHAPTER 2 PIN FUNCTIONS 29 User ’ s Manual U10676EJ3V0UM 2.2.12 IC The IC (Internally Connected) pin sets the test mode in which the µ PD754244 is tested before shipment. Usually, you should directly connect the IC pin to the V DD pin with as short a wiring length as possible. If a voltage difference is generated between the IC and V DD pins bec[...]

  • Página 30

    CHAPTER 2 PIN FUNCTIONS 30 User ’ s Manual U10676EJ3V0UM 2.3 Pin I/O Circuits The following diagrams show the I/O circuits of the pins of the µ PD754244. Note that in these diagrams the I/ O circuits have been slightly simplified. Type A Type B Type D Type E-B Type B-A Type F-A V DD IN P-ch N-ch Data Output disable N-ch P-ch IN OUT V DD P-ch Out[...]

  • Página 31

    CHAPTER 2 PIN FUNCTIONS 31 User’ s Manual U10676EJ3V0UM 2.4 Processing of Unused Pins Table 2-3. Recommended Connection of Unused Pins Pin Recommended Connection P30/PTO0 Input: Independently connect to V SS or V DD via a resistor. P31/PTO1 Output: Leave open. P32/PTO2 P33 P60/AV REF P61/INT0 P62/PTH00 P63/PTH01 P70/KR4 Connect to V DD . P71/KR5 [...]

  • Página 32

    32 User’ s Manual U10676EJ3V0UM CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP The 75XL architecture employed for the µ PD754244 has the following features. • Internal RAM: 4K words × 4 bits MAX. (12-bit address) • Expandability peripheral hardware To realize these superb features, the following techniques have been employed. (1) Bank co[...]

  • Página 33

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 33 User’ s Manual U10676EJ3V0UM Figure 3-1. Selecting MBE = 0 Mode and MBE = 1 Mode Internal hardware and static RAM manipulation repeated. ; MBE = 0 by vector table <Main program> SET 1 MBE CLR 1 MBE MBE = 1 MBE = 0 SET 1 MBE MBE = 1 <Subroutine> CLR1 MBE RET RETI MBE = 0 (Interrupt s[...]

  • Página 34

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 34 User ’ s Manual U10676EJ3V0UM 3.1.2 Addressing mode of data memory The 75XL architecture employed for the µ PD754244 provides the seven types of addressing modes shown in Table 3-1. This means that the data memory space can be efficiently addressed by the bit length of the data to be processed[...]

  • Página 35

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 35 User ’ s Manual U10676EJ3V0UM Figure 3-2. Data Memory Configuration and Addressing Range for Each Addressing Mode 000H 01FH 020H 07FH 0FFH 400H 41FH 4FFH F80H FB0H FBFH FC0H FF0H FFFH General- purpose register area Data area (SRAM) Data area (EEPROM16 × 8) Memory bank 4 Peripheral hardware are[...]

  • Página 36

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 36 User ’ s Manual U10676EJ3V0UM Table 3-1. Addressing Modes Addressing Mode Representation Specified Address • When MBE = 0 When mem = 00H to 7FH: MB = 0 When mem = 80H to FFH: MB = 15 • When MBE = 1: MB = MBS 4-bit direct addressing mem Address specified by MB and mem. • When MBE = 0 When [...]

  • Página 37

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 37 User’ s Manual U10676EJ3V0UM (2) 4-bit direct addressing (mem) This addressing mode is used to directly address the entire memory space in 4-bit units by using the operand of an instruction. Like the 1-bit direct addressing mode, the area that can be addressed is fixed to the data area of addre[...]

  • Página 38

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 38 User ’ s Manual U10676EJ3V0UM Examples 1. To compare data 50H to 57H with data 60H to 67H DATA1 EQU 57H DATA2 EQU 67H SET1 MBE SEL MB0 MOV D, #DATA1 SHR 4 MOV HL, #DATA2 AND 0FFH LOOP : MOV A, @DL SKE A, @HL ; A = (HL)? BR NO ; NO DECS L ; YES, L ← L – 1 BR LOOP 2. To clear data memory of 0[...]

  • Página 39

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 39 User ’ s Manual U10676EJ3V0UM Figure 3-3. Updating Address of Static RAM 0XH FXH @DL 4-bit transfer DECS D INCS D DECS L INCS L @HL 4-bit manipulation 8-bit manipuIation DECS H INCS H DECS L INCS L Auto decrement Auto increment DECS HL INCS HL Direct addressing bit manipulation 4-bit transfer 8[...]

  • Página 40

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 40 User ’ s Manual U10676EJ3V0UM (5) 8-bit register indirect addressing (@HL) This addressing mode is used to indirectly address the entire data memory space in 8-bit units by using a data pointer (HL register pair). In this addressing mode, data is processed in 8-bit units, that is, the 4-bit dat[...]

  • Página 41

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 41 User ’ s Manual U10676EJ3V0UM (6) Bit manipulation addressing This addressing mode is used to manipulate the entire memory space in bit units (such as Boolean processing and bit transfer). While the 1-bit direct addressing mode can only be used with the instructions that set, reset, or test a b[...]

  • Página 42

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 42 User ’ s Manual U10676EJ3V0UM (b) Specific address bit register indirect addressing (pmem, @L) This addressing mode is to indirectly specify and successively manipulate the bits of the peripheral hardware units such as I/O ports. The data memory addresses to which this addressing mode can be ap[...]

  • Página 43

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 43 User ’ s Manual U10676EJ3V0UM (c) Special 1-bit direct addressing (@H+mem.bit) This addressing mode enables bit manipulation in the entire memory space. The higher 4 bits of the data memory address of the memory bank specified by MBE and MBS are indirectly specified by the H register, and the l[...]

  • Página 44

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 44 User ’ s Manual U10676EJ3V0UM (7) Stack addressing This addressing mode is used to save or restore data when interrupt servicing or subroutine processing is executed. The address of data memory bank 0 pointed to by the stack pointer (8 bits) is specified in this addressing mode. In addition to [...]

  • Página 45

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 45 User ’ s Manual U10676EJ3V0UM RBE Register Bank Fixed to 0 Remark × = don ’ t care RBE is automatically saved or restored during subroutine processing and therefore can be set while subroutine processing is under execution. When interrupt servicing is executed, RBE is automatically saved or [...]

  • Página 46

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 46 User ’ s Manual U10676EJ3V0UM Figure 3-4. Example of Using Register Banks <Main program> <Single interrupt> <Nesting of two interrupts> ; RBE = 1 <Nesting of three interrupts> ; RBE = 0 ; RBE = 0 in vector table in vector table in vector table PUSH BS SEL RB1 PUSH rp RB [...]

  • Página 47

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 47 User ’ s Manual U10676EJ3V0UM (1) To use as 4-bit registers When the general-purpose register area is used as a 4-bit register area, a total of eight general-purpose registers, X, A, B, C, D, E, H, and L, specified by RBE and RBS can be used as shown in Figure 3-5. Of these registers, A plays a[...]

  • Página 48

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 48 User ’ s Manual U10676EJ3V0UM Figure 3-5. Configuration of General-Purpose Registers (4-Bit Processing) X H D B X H D B X H D B X H D B 01H 03H 05H 07H 09H 0BH 0DH 0FH 11H 13H 15H 17H 19H 1BH 1DH 1FH A L E C A L E C A L E C A L E C 00H 02H 04H 06H 08H 0AH 0CH 0EH 10H 12H 14H 16H 18H 1AH 1CH 1EH[...]

  • Página 49

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 49 User ’ s Manual U10676EJ3V0UM Figure 3-6. Configuration of General-Purpose Registers (8-Bit Processing) XA HL DE BC XA' HL' DE' BC' 00H 02H 04H 06H 08H 0AH 0CH 0EH When RBE RBS = 0 XA HL DE BC XA' HL' DE' BC' 10H 12H 14H 16H 18H 1AH 1CH 1EH When RBE RBS =[...]

  • Página 50

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 50 User ’ s Manual U10676EJ3V0UM 3.3 Memory-Mapped I/O The µ PD754244 employs memory-mapped I/O that maps peripheral hardware units such as I/O ports and timers to addresses F80H to FFFH on the data memory space, as shown in Figure 3-2. Therefore, no special instructions to control the peripheral[...]

  • Página 51

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 51 User ’ s Manual U10676EJ3V0UM Figure 3-7 shows the I/O map of the µ PD754244. The meanings of the symbols shown in this figure are as follows. • Symbol ............ Name indicating the address of an internal hardware unit Can be written in operands of instructions • R/ W ................. [...]

  • Página 52

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 52 User’ s Manual U10676EJ3V0UM ................................................................................ ................................................................................ Figure 3-7. µ PD754244 I/O Map (1/8) Hardware name (symbol) Number of bits that Bit Address R/W can be [...]

  • Página 53

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 53 User ’ s Manual U10676EJ3V0UM Figure 3-7. µ PD754244 I/O Map (2/8) Hardware name (symbol) Number of bits that Bit Address R/W can be manipulated manipulation Remarks b3 b2 b1 b0 1-bit 4-bit 8-bit addressing F90H Timer counter 2 mode register (TM2) R/W (W) – – Bit manipulation can be perfor[...]

  • Página 54

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 54 User ’ s Manual U10676EJ3V0UM Figure 3-7. µ PD754244 I/O Map (3/8) Hardware name (symbol) Number of bits that Bit Address R/W can be manipulated manipulation Remarks b3 b2 b1 b0 1-bit 4-bit 8-bit addressing FA0H Timer counter 0 mode register (TM0) R/W (W) – mem.bit Bit manipulation can be pe[...]

  • Página 55

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 55 User ’ s Manual U10676EJ3V0UM ................................................................................ ................................................................................ CY Note 1 SK2 Note 1 SK1 Note 1 SK0 Note 1 INTA register (INTA) –– IEBT IRQBT INTB register (INTB) [...]

  • Página 56

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 56 User ’ s Manual U10676EJ3V0UM Figure 3-7. µ PD754244 I/O Map (5/8) Hardware name (symbol) Number of bits that Bit Address R/W can be manipulated manipulation Remarks b3 b2 b1 b0 1-bit 4-bit 8-bit addressing FC0H Bit sequential buffer 0 (BSB0) R/W mem.bit FC1H Bit sequential buffer 1 (BSB1) R/W[...]

  • Página 57

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 57 User ’ s Manual U10676EJ3V0UM Figure 3-7. µ PD754244 I/O Map (6/8) Hardware name (symbol) Number of bits that Bit Address R/W can be manipulated manipulation Remarks b3 b2 b1 b0 1-bit 4-bit 8-bit addressing FD0H Unmounted to FD3H FD4H Programmable threshold port (PTH0) R – mem.bit FD5H Unmou[...]

  • Página 58

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 58 User ’ s Manual U10676EJ3V0UM Figure 3-7. µ PD754244 I/O Map (7/8) Hardware name (symbol) Number of bits that Bit Address R/W can be manipulated manipulation Remarks b3 b2 b1 b0 1-bit 4-bit 8-bit addressing FE0H Unmounted to FE7H FE8H PM33 PM32 PM31 PM30 R/W – – Port mode register group A [...]

  • Página 59

    CHAPTER 3 FEATURES OF ARCHITECTURE AND MEMORY MAP 59 User ’ s Manual U10676EJ3V0UM Figure 3-7. µ PD754244 I/O Map (8/8) Hardware name (symbol) Number of bits that Bit Address R/W can be manipulated manipulation Remarks b3 b2 b1 b0 1-bit 4-bit 8-bit addressing FF0H Unmounted to FF2H FF3H Port 3 (PORT3) R/W – fmem.bit pmem.@L FF4H Unmounted FF5H[...]

  • Página 60

    60 User’ s Manual U10676EJ3V0UM CHAPTER 4 INTERNAL CPU FUNCTION 4.1 Function to Select MkI and MkII Modes 4.1.1 Difference between MkI and MkII modes The CPU of the µ PD754244 has two modes to be selected: MkI and MkII. These modes can be selected by using bit 3 of the stack bank select register (SBS). • MkI mode: In this mode, the µ PD754144[...]

  • Página 61

    CHAPTER 4 INTERNAL CPU FUNCTION 61 User’ s Manual U10676EJ3V0UM 4.1.2 Setting stack bank select register (SBS) The MkI mode or MkII mode is selected by using the stack bank select register (SBS). Figure 4-1 shows the format of this register. The stack bank select register is set by using a 4-bit memory manipulation instruction. To use the MkI mod[...]

  • Página 62

    CHAPTER 4 INTERNAL CPU FUNCTION 62 User ’ s Manual U10676EJ3V0UM 4.2 Program Counter (PC) ··· 12 bits This is a binary counter that holds an address of the program memory. Figure 4-2. Configuration of Program Counter PC11 PC10 PC9 PC8 PC7 PC6 PC5 PC4 PC3 PC2 PC1 PC0 The value of the program counter (PC) is usually automatically incremented by [...]

  • Página 63

    CHAPTER 4 INTERNAL CPU FUNCTION 63 User ’ s Manual U10676EJ3V0UM 4.3 Program Memory (ROM) ··· 4096 × 8 bits The program memory stores a program, interrupt vector table, the reference table of the GETI instruction, and table data. The program memory is addressed by the program counter. The table data can be referenced by using a table referenc[...]

  • Página 64

    CHAPTER 4 INTERNAL CPU FUNCTION 64 User ’ s Manual U10676EJ3V0UM Figure 4-3. Program Memory Map 76 0 MBE RBE Internal reset start address (higher 4 bits) Internal reset start address (lower 8 bits) MBE RBE INTBT start address (higher 4 bits) INTBT start address (lower 8 bits) MBE RBE INT0 start address (higher 4 bits) INT0 start address (lower 8 [...]

  • Página 65

    CHAPTER 4 INTERNAL CPU FUNCTION 65 User ’ s Manual U10676EJ3V0UM 4.4 Data Memory (RAM) ... 128 words × 4 bits The data memory consists of data areas and a peripheral hardware area as shown in Figure 4-4. The data memory consists the following banks with each bank made up of 256 words × 4 bits. • Memory bank 0 (data areas) • Memory bank 4 (E[...]

  • Página 66

    CHAPTER 4 INTERNAL CPU FUNCTION 66 User ’ s Manual U10676EJ3V0UM 4.4.2 Specifying bank of data memory A memory bank is specified by a 4-bit memory bank select register (MBS) when bank specification is enabled by setting a memory bank enable flag (MBE) to 1 (MBS = 0, 4, or 15). When bank specification is disabled (MBS = 0), bank 0 or 15 is automat[...]

  • Página 67

    CHAPTER 4 INTERNAL CPU FUNCTION 67 User ’ s Manual U10676EJ3V0UM Figure 4-4. Data Memory Map 000H 01FH 020H 07FH 080H 0FFH 400H 41FH 420H 4FFH F80H FFFH 128 × 4 Not incorporated 16 × 8 Not incorporated 128 × 4 (96 × 4) (32 × 4) 0 4 15 General-purpose register area Stack area Data area static RAM (128 × 4) Data area EEPROM (16 × 8) Peripher[...]

  • Página 68

    CHAPTER 4 INTERNAL CPU FUNCTION 68 User ’ s Manual U10676EJ3V0UM The contents of the data memory are undefined at reset. Therefore, they must be initialized at the beginning of program execution (RAM clear). Otherwise, unexpected bugs may occur. Example To clear RAM at addresses 000H to 07FH SET1 MBE SEL MB0 MOV XA, #00H MOV HL, #04H RAMC0 : MOV [...]

  • Página 69

    CHAPTER 4 INTERNAL CPU FUNCTION 69 User ’ s Manual U10676EJ3V0UM 0 3 B 0 3 C 0 3 D 0 3 E 0 3 H 0 3 L 0 3 X 0 3 A One bank 000H 001H 002H 003H 004H 005H 006H 007H 008H 00FH 010H 017H 018H . . . . . 01FH Same configura- tion as bank 0 Same configura- tion as bank 0 Same configura- tion as bank 0 Register bank 0 Register bank 1 Register bank 2 Regis[...]

  • Página 70

    CHAPTER 4 INTERNAL CPU FUNCTION 70 User ’ s Manual U10676EJ3V0UM 4.6 Accumulator With the µ PD754244, the A register or XA register pair functions as an accumulator. The A register plays a central role in 4-bit data processing, while the XA register pair is used for 8-bit data processing. When a bit manipulation instruction is used, the carry fl[...]

  • Página 71

    CHAPTER 4 INTERNAL CPU FUNCTION 71 User ’ s Manual U10676EJ3V0UM When 00H is set to SP as the initial value, memory bank 0 specified by SBS is used as the stack area, starting from the highest address (07FH). The stack area can be used only in memory bank 0. If stack operation is performed from address 000H onwards, the stack pointer will point t[...]

  • Página 72

    CHAPTER 4 INTERNAL CPU FUNCTION 72 User ’ s Manual U10676EJ3V0UM Figure 4-9. Data Saved to Stack Memory (MkI Mode) Stack SP – 1 SP PUSH instruction Stack PC11-PC8 PC3-PC0 PC7-PC4 CALL, CALLF instruction Stack Interrupt SP – 2 SP – 1 SP SP – 3 PC11-PC8 PC3-PC0 PC7-PC4 SP – 2 SP – 1 SP SP – 3 SP – 4 SP – 5 MBE RBE 00 MBE RBE 00 CY[...]

  • Página 73

    CHAPTER 4 INTERNAL CPU FUNCTION 73 User ’ s Manual U10676EJ3V0UM Figure 4-11. Data Saved to Stack Memory (MkII Mode) Stack SP – 1 SP PUSH instruction Stack PC11-PC8 PC3-PC0 PC7-PC4 CALL, CALLA, CALLF instruction Stack Interrupt SP – 4 SP – 3 SP – 2 SP – 5 PC11-PC8 PC3-PC0 PC7-PC4 SP – 2 SP – 1 SP SP – 3 SP – 4 SP – 5 00 00 00 [...]

  • Página 74

    CHAPTER 4 INTERNAL CPU FUNCTION 74 User ’ s Manual U10676EJ3V0UM 4.8 Program Status Word (PSW) ... 8 Bits The program status word (PSW) consists of flags closely related to the operations of the processor. PSW is mapped to addresses FB0H and FB1H of the data memory space, and the 4 bits of address FB0H can be manipulated by using a memory manipul[...]

  • Página 75

    CHAPTER 4 INTERNAL CPU FUNCTION 75 User ’ s Manual U10676EJ3V0UM Table 4-4. Carry Flag Manipulation Instruction Instruction (Mnemonic) Operation and Processing of Carry Flag Carry flag manipulation SET1 CY Sets CY to 1 instruction CLR1 CY Clears CY to 0 NOT1 CY Inverts content of CY SKT CY Skips if content of CY is 1 Bit transfer instruction MOV1[...]

  • Página 76

    CHAPTER 4 INTERNAL CPU FUNCTION 76 User ’ s Manual U10676EJ3V0UM (3) Interrupt status flags (IST1 and IST0) The interrupt status flags record the status of the processing under execution (for details, refer to Table 7-3 IST, IST0, and Interrupt Servicing ). Table 4-5. Contents of Interrupt Status Flags IST1 IST0 Status of Processing Being Execute[...]

  • Página 77

    CHAPTER 4 INTERNAL CPU FUNCTION 77 User ’ s Manual U10676EJ3V0UM (5) Register bank enable flag (RBE) This flag specifies whether the register bank of the general-purpose registers is expanded or not. RBE can be set or reset at any time by using a bit manipulation instruction, regardless of the setting of the memory bank. When this flag is set to [...]

  • Página 78

    CHAPTER 4 INTERNAL CPU FUNCTION 78 User ’ s Manual U10676EJ3V0UM 4.9 Bank Select Register (BS) The bank select register (BS) consists of a register bank select register (RBS) and a memory bank select register (MBS) which specify the register bank and the memory bank to be used, respectively. RBS and MBS are set by the SEL RBn and SEL MBn instruct[...]

  • Página 79

    CHAPTER 4 INTERNAL CPU FUNCTION 79 User ’ s Manual U10676EJ3V0UM RBE Register Bank (2) Register bank select register (RBS) The register bank select register specifies a register bank to be used as general-purpose registers. It can select bank 0 to 3. RBS is set by the SEL RBn instruction (n = 0-3). When the RESET signal is asserted, RBS is initia[...]

  • Página 80

    80 User’ s Manual U10676EJ3V0UM CHAPTER 5 EEPROM The µ PD754244 incorporates not only a 128-word × 4-bit static RAM but also a 16-word × 8-bit EEPROM (Electrically Erasable PROM) as data memory. EEPROM, unlike static RAM, can retain its contents when the power is turned off. Unlike EPROM, contents can electrically be erased without using ultra[...]

  • Página 81

    CHAPTER 5 EEPROM 81 User’ s Manual U10676EJ3V0UM 5.3 EEPROM Write Control Register (EWC) The EEPROM write control register (EWC) is an 8-bit register used to control manipulation of EEPROM. Figure 5-1 shows its configuration. Figure 5-1. Format of EEPROM Write Control Register ERE 7 EWTC6 6 EWTC5 5 EWTC4 4 EWE 3 EWST 2 – 1 – 0 FCEH Address EW[...]

  • Página 82

    CHAPTER 5 EEPROM 82 User ’ s Manual U10676EJ3V0UM Cautions 1. The write time depends on the system clock oscillation frequency. 2. Set EWTC4-EWTC6 so that the write time is as follows. With µ PD754144 ··· 18 × 2 8 /f CC (4.6 ms: f CC = 1.0 MHz) With µ PD754244 ··· 4.0 ms MIN., 10.0 ms MAX. Clear EWE to 0 after writing. 3. Be sure to clea[...]

  • Página 83

    CHAPTER 5 EEPROM 83 User ’ s Manual U10676EJ3V0UM 5.5 EEPROM Manipulation Method 5.5.1 EEPROM manipulation instructions Instructions that can be used to manipulate the EEPROM are shown below, divided into read instructions and write instructions. (1) Read manipulation instructions Instruction Group Mnemonic Operand Transfer instruction MOV XA, @H[...]

  • Página 84

    CHAPTER 5 EEPROM 84 User ’ s Manual U10676EJ3V0UM 5.5.2 Read manipulation The following procedure is used to read EEPROM. EWST, ERE and EWE can be set simultaneously by an 8-bit memory manipulation instruction to EWC. <1> Check that the write status flag (EWST) is 0 (write enabled = writing is currently not being performed). <2> Set t[...]

  • Página 85

    CHAPTER 5 EEPROM 85 User ’ s Manual U10676EJ3V0UM 5.5.3 Write manipulation Use the following procedure to write to EEPROM. Any instruction other than one related to EEPROM writing can be executed even during an EEPROM write operation. EWST, EWTC and EWE can be set simultaneously by an 8-bit memory manipulation instruction to EWC. <1> Check [...]

  • Página 86

    CHAPTER 5 EEPROM 86 User ’ s Manual U10676EJ3V0UM Example Set the write time to 18 × 2 8 /f X and after checking the EEPROM write status flag (EWST), write 8-bit data (0AH) at 08H of memory bank 4. SET1 MBE SEL MB15 ; Selection of bank 15 MOV XA, #01011000B ; Write enable MOV EWC, XA ; Set the write time to 18 × 2 8 /f X SKF EWST BR A1 SEL MB4 [...]

  • Página 87

    CHAPTER 5 EEPROM 87 User ’ s Manual U10676EJ3V0UM 5.6 Cautions on EEPROM Writing Cautions on EEPROM writing are shown below. Be sure to read these before writing to EEPROM. Cautions 1. Before writing, make sure that EWST is 0. While EEPROM is being written, if a write instruction is executed again, the instruction executed later is ignored. 2. Th[...]

  • Página 88

    88 User’ s Manual U10676EJ3V0UM CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 6.1 Digital I/O Ports The µ PD754244 uses memory mapped I/O, and all the I/O ports are mapped to the data memory space. Figure 6-1. Data Memory Address of Digital Ports FF0H FF1H FF2H FF3H FF4H FF5H FF6H FF7H FF8H P33 P63 P73 – Address 3 P32 P62 P72 – 2 P31 P61 P71 – 1 [...]

  • Página 89

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 89 User ’ s Manual U10676EJ3V0UM 6.1.1 Types, features, and configurations of digital I/O ports Table 6-1 shows the types of digital I/O ports. Figures 6-2 to 6-9 show the configuration of each port. Table 6-1. Types and Features of Digital Ports Port Function Operation and Features Remarks PORT3 4-bit I/O C[...]

  • Página 90

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 90 User ’ s Manual U10676EJ3V0UM Figure 6-2. P3n Configuration (n = 0 to 2) Input buffer MPX Output latch PM3n PTOn Output buffer Input buffer POGA bit 3 V DD Pull-up resistor P-ch P3n/PTOn Internal bus Figure 6-3. P33 Configuration Input buffer MPX Output latch PM33 Output buffer Input buffer POGA bit 3 V D[...]

  • Página 91

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 91 User ’ s Manual U10676EJ3V0UM Figure 6-4. P60 Configuration Input buffer MPX Output latch PM60 Output buffer POGA bit 6 V DD Pull-up resistor P-ch P60/AV REF AV REF Input buffer with hysteresis characteristics Internal bus Figure 6-5. P61 Configuration Internal bus Output latch PM61 Output buffer POGA bit[...]

  • Página 92

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 92 User ’ s Manual U10676EJ3V0UM Figure 6-6. P62 Configuration Input buffer Output latch PM62 POGA bit 6 V DD Pull-up resistor P-ch P62/PTH00 PTH00 Internal bus MPX Output buffer Input buffer with hysteresis characteristics Figure 6-7. P63 Configuration Input buffer Output latch PM63 POGA bit 6 V DD Pull-up [...]

  • Página 93

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 93 User’ s Manual U10676EJ3V0UM Figure 6-8. P7n Configuration (n = 0 to 3) One-shot pulse generator Key return reset V DD Pull-up resistor (mask option) P70/KR4 P71/KR5 P72/KR6 P73/KR7 Interrupt control Falling edge detector Internal bus Input buffer Input buffer with hysteresis characteristics Figure 6-9. P[...]

  • Página 94

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 94 User ’ s Manual U10676EJ3V0UM 6.1.2 Setting I/O mode The input or output mode of each I/O port is set by the corresponding port mode register as shown in Figure 6- 10. Ports 3 and 6 can be set to the input or output mode in 1-bit units by using port mode register group A (PMGA). Port 8 is set to the input[...]

  • Página 95

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 95 User ’ s Manual U10676EJ3V0UM Figure 6-10. Format of Each Port Mode Register Specification 0 Input mode (output buffer off) 1 Output mode (output buffer on) Port mode register group A 765432 10 PM30 PM31 PM33 PM32 PM60 PM61 PM62 PM63 Address PMGA FE8H Symbol Sets P30 to input or output mode Sets P31 to in[...]

  • Página 96

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 96 User ’ s Manual U10676EJ3V0UM 6.1.3 Digital I/O port manipulation instruction Because all the I/O ports of the µ PD754244 are mapped to the data memory space, they can be manipulated by using data memory manipulation instructions. Table 6-2 shows these data memory manipulation instructions, which are con[...]

  • Página 97

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 97 User ’ s Manual U10676EJ3V0UM Table 6-2. I/O Pin Manipulation Instructions PORT PORT3 PORT6 PORT7 PORT8 Instruction IN A, PORTn Note 1 IN XA, PORTn Note 1 – OUT PORTn, A Note 1 – OUT PORTn, XA Note 1 – MOV A, PORTn Note 1 MOV XA, PORTn Note 1 – MOV PORTn, A Note 1 MOV PORTn, XA Note 1 – XCH A, P[...]

  • Página 98

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 98 User ’ s Manual U10676EJ3V0UM 6.1.4 Operation of digital I/O port The operations of each port and port pin when a data memory manipulation instruction is executed to manipulate a digital I/O port differ depending on whether the port is set to the input or output mode (refer to Table 6-3 ). This is because[...]

  • Página 99

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 99 User ’ s Manual U10676EJ3V0UM Table 6-3. Operation When I/O Port Is Manipulated Operation of Port and Pin Input mode Output mode SKT <1> Tests pin data Tests output latch data SKF <1> MOV1 CY, <1> Transfers pin data to CY Transfers output latch data to CY AND1 CY, <1> Performs oper[...]

  • Página 100

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 100 User ’ s Manual U10676EJ3V0UM 6.1.5 Connecting pull-up resistor Each port pin of the µ PD754244 can be connected to a pull-up resistor. Some pins can be connected to a pull- up resistor via software and others can be connected by a mask option. Table 6-4 shows how to specify the connection of the pull-u[...]

  • Página 101

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 101 User ’ s Manual U10676EJ3V0UM 6.1.6 I/O timing of digital I/O port Figure 6-12 shows the timing at which data is output to the output latch and the timing at which the pin data or the data of the output latch is loaded to the internal bus. Figure 6-13 shows the ON timing when an on-chip pull-up resistor [...]

  • Página 102

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 102 User ’ s Manual U10676EJ3V0UM Figure 6-13. ON Timing of Internal Pull-up Resistor Connected via Software Instruction execution Pull-up resistor specification re g ister Internal pull-up resistor setting instruction 2 machine cycles Φ 0 Φ 1[...]

  • Página 103

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 103 User ’ s Manual U10676EJ3V0UM 6.2 Clock Generator The clock generator supplies various clocks to the CPU and peripheral hardware units and controls the operation mode of the CPU. 6.2.1 Configuration of clock generator Figure 6-14 shows the configuration of the clock generator. Figure 6-14. Block Diagram [...]

  • Página 104

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 104 User ’ s Manual U10676EJ3V0UM Figure 6-14. Block Diagram of Clock Generator (2/2) (b) µ PD754244 Crystal/Ceramic Oscillation X1 X2 System clock oscillator Oscillation stops 1/2 1/4 1/16 f X Divider 1/4 Φ HALT F/F S RQ S R Q STOP F/F PCC0 PCC1 PCC2 PCC3 PCC2, PCC3 clear HALT Note STOP Note Wait release [...]

  • Página 105

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 105 User ’ s Manual U10676EJ3V0UM 6.2.2 Function and operation of clock generator The clock generator generates the following types of clocks and controls the operation mode of the CPU in the standby mode. • System clock f X • CPU clock Φ • Clock to peripheral hardware The operation of the clock gener[...]

  • Página 106

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 106 User ’ s Manual U10676EJ3V0UM (1) Processor clock control register (PCC) PCC is a 4-bit register that selects the CPU clock Φ with the lower 2 bits and controls the CPU operation mode with the higher 2 bits (refer to Figure 6-15 ). When either bit 3 or 2 of this register is set to “ 1 ” , the standb[...]

  • Página 107

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 107 User ’ s Manual U10676EJ3V0UM Figure 6-15. Format of Processor Clock Control Register PCC3 3210 FB3H Address PCC Symbol PCC2 PCC1 PCC0 CPU operating mode control bits PCC3 PCC2 Operating mode 0 0 Normal operating mode 0 1 HALT mode 1 0 STOP mode 1 1 Setting prohibited CPU clock selection bits ( µ PD7541[...]

  • Página 108

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 108 User ’ s Manual U10676EJ3V0UM X1 X2 V SS Crystal or ceramic resonator PD754244 µ X1 X2 External clock PD754244 µ (2) System clock oscillator (a) µ PD754144 (RC oscillation) The system clock oscillator oscillates by means of a resistor (R) and capacitor (C) connected to the CL1 and CL2 pins. An externa[...]

  • Página 109

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 109 User ’ s Manual U10676EJ3V0UM Cautions 1. The X2 pin of the µ PD754244 is internally pulled up to V DD by a resistor of 50 k Ω (typ.) in the STOP mode. 2. Wire the portion enclosed by the dotted lines in Figures 6-16 and 6-17 as follows to prevent adverse influence by wiring capacitance when using the[...]

  • Página 110

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 110 User ’ s Manual U10676EJ3V0UM Figure 6-18. Example of Incorrect Resonator Connection (2/3) (b) Crossed signal line µ PD754144 CL1 CL2 V SS PORTn (n = 3, 6-8) µ • PD754144 µ • PD754244 µ PD754244 X1 X2 V SS PORTn (n = 3, 6-8) (c) High alternating current close to signal line µ PD754144 CL1 CL2 V [...]

  • Página 111

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 111 User ’ s Manual U10676EJ3V0UM Figure 6-18. Example of Incorrect Resonator Connection (3/3) (d) Current flowing through power line of oscillator (potential at points A, B, and C changes) µ PD754144 CL1 CL2 V SS PORTn (n = 3, 6-8) V DD AB High current µ • PD754144 µ • PD754244 µ PD754244 X1 X2 V SS[...]

  • Página 112

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 112 User’ s Manual U10676EJ3V0UM 6.2.3 Setting CPU clock (1) Time required to switch CPU clock The CPU clock can be switched by using the lower 2 bits of PCC. The processor does not operate with the selected clock, however, immediately after data has been written to the registers; it operates with the pre- c[...]

  • Página 113

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 113 User’ s Manual U10676EJ3V0UM Figure 6-19. CPU Clock Switching Example <1> Wait time Note 1 to secure the oscillation stabilization time in response to RESET signal generation. <2> The CPU starts operating at the lowest system clock speed Note 2 . <3> The PCC is rewritten and the device [...]

  • Página 114

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 114 User ’ s Manual U10676EJ3V0UM 6.3 Basic Interval Timer/Watchdog Timer The µ PD754244 has an 8-bit basic interval timer/watchdog timer that has the following functions. (a) Interval timer operation to generate reference time interrupt (b) Watchdog timer operation to detect program hang-up and reset CPU ([...]

  • Página 115

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 115 User ’ s Manual U10676EJ3V0UM 6.3.2 Basic interval timer mode register (BTM) BTM is a 4-bit register that controls the operation of the basic interval timer (BT). This register is set by a 4-bit memory manipulation instruction. Bit 3 of BT can be manipulated by a bit manipulation instruction. Example To [...]

  • Página 116

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 116 User ’ s Manual U10676EJ3V0UM Figure 6-21. Format of Basic Interval Timer Mode Register Note In the µ PD754244 only, wait time is selectable when standby mode is released. In the µ PD754144, wait time is always fixed to 2 9 /f CC (512 µ s at 1.0 MHz). 3210 BTM0 BTM1 BTM2 BTM3 Address BTM F85H Symbol P[...]

  • Página 117

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 117 User ’ s Manual U10676EJ3V0UM 6.3.3 Watchdog timer enable flag (WDTM) WDTM is a flag that enables assertion of the reset signal when an overflow occurs. This flag is set by a bit manipulation instruction. Once this flag has been set, it cannot be cleared by an instruction. Example To set watchdog timer f[...]

  • Página 118

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 118 User’ s Manual U10676EJ3V0UM 6.3.4 Operation as basic interval timer When WDTM is reset to “0”, the interrupt request flag (IRQBT) is set by the overflow of the basic interval timer (BT), and the basic interval timer/watchdog timer operates as the basic interval timer. BT is always incremented by the[...]

  • Página 119

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 119 User’ s Manual U10676EJ3V0UM Initial setting 6.3.5 Operation as watchdog timer The basic interval timer/watchdog timer operates as a watchdog timer that asserts the internal reset signal when an overflow occurs in the basic interval timer (BT), if WDTM is set to “1”. However, if the overflow occurs d[...]

  • Página 120

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 120 User ’ s Manual U10676EJ3V0UM Example To use the µ PD754244 as a watchdog timer with a time interval of 5.46 ms (at f X = 6.0 MHz). Note Divide the program into several modules, each of which is completed within the set time of BTM (5.46 ms), and clear BT at the end of each module. If a hang-up occurs, [...]

  • Página 121

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 121 User ’ s Manual U10676EJ3V0UM 6.3.6 Other functions The basic interval timer/watchdog timer has the following functions, regardless of the operations as the basic interval timer or watchdog timer. <1> Selects and counts wait time after standby mode has been released <2> Reads count value (1) [...]

  • Página 122

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 122 User’ s Manual U10676EJ3V0UM 6.4 Timer Counter The µ PD754244 incorporates a three-channel timer counter. The timer counter has the following functions. (a) Programmable interval timer operation (b) Square wave output of any frequency to PTO0-PTO2 pins (c) Count value read function The timer counter can[...]

  • Página 123

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 123 User’ s Manual U10676EJ3V0UM Figure 6-23. Block Diagram of Timer Counter (Channel 0) Note Execution of the instruction Caution Be sure to clear bits 1 and 0 to 0 when setting data to TM0. – TM06 TM05 TM04 TM03 TM02 0 0 TM0 8 Internal bus 8 8 Modulo register (8) MPX From clock generator SET1 Note TMOD0 [...]

  • Página 124

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 124 User ’ s Manual U10676EJ3V0UM Figure 6-24. Block Diagram of Timer Counter (Channel 1) Note Execution of the instruction 8 Internal bus TM16 – TM15 TM14 TM13 TM12 TM11 TM10 TM1 Timer counter (channel 2) output From clock generator MPX Decoder 8 Modulo register (8) 8 TMOD1 Comparator (8) 8 Count register[...]

  • Página 125

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 125 User’ s Manual U10676EJ3V0UM Figure 6-25. Block Diagram of Timer Counter (Channel 2) Note Execution of the instruction Caution Be sure to clear bit 7 to 0 when setting data to TC2. 8 Internal bus – TM26 TM25 TM24 TM23 TM22 TM21 TM20 From clock generator MPX Decoder 8 High-level period setting modulo re[...]

  • Página 126

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 126 User ’ s Manual U10676EJ3V0UM (1) Timer counter mode registers (TM0, TM1, TM2) A timer counter mode register (TMn) is an 8-bit register that controls the corresponding timer counter. Figures 6-26 to 6-28 show the formats of the various mode registers. The timer counter mode register is set by an 8-bit me[...]

  • Página 127

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 127 User ’ s Manual U10676EJ3V0UM Figure 6-26. Format of Timer Counter Mode Register (Channel 0) Note Be sure to clear bits 0 and 1 to 0 when setting data to TM0. Caution After a reset, all bits of TM0 become "0", therefore when operating the timer it is necessary to set the count pulse value first[...]

  • Página 128

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 128 User ’ s Manual U10676EJ3V0UM Figure 6-27. Format of Timer Counter Mode Register (Channel 1) (1/2) 765432 10 PD754244: f X = 6.0 MHz TM10 TM11 TM13 TM12 TM14 TM15 TM16 – Address TM1 FA8H Symbol Count pulse (CP) select bit TM16 Count pulse (CP) TM15 0 Overflow of timer counter (channel 2) 1 f X /2 5 (18[...]

  • Página 129

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 129 User ’ s Manual U10676EJ3V0UM Figure 6-27. Format of Timer Counter Mode Register (Channel 1) (2/2) TM13 Clears counter and IRQT1 flag when "1" is written. Starts count operation if bit 2 is set to "1". Timer start command bit Operation mode TM12 0 1 Stops (count value retained) Count [...]

  • Página 130

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 130 User ’ s Manual U10676EJ3V0UM Figure 6-28. Format of Timer Counter Mode Register (Channel 2) (1/2) 765432 10 PD754244: f X = 6.0 MHz TM20 TM21 TM23 TM22 TM24 TM25 TM26 – Address TM2 F90H Symbol Count pulse (CP) select bit TM26 Count pulse (CP) TM25 0 f X /2 (3.00 MHz) 1 f X (6.0 MHz) 1 0 0 1 1 f X /2 8[...]

  • Página 131

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 131 User ’ s Manual U10676EJ3V0UM Figure 6-28. Format of Timer Counter Mode Register (Channel 2) (2/2) TM23 Clears counter and IRQT2 flag when "1" is written. Starts count operation if bit 2 is set to "1". Timer start command bit Operation mode TM22 0 1 Stops (count value retained) Count [...]

  • Página 132

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 132 User ’ s Manual U10676EJ3V0UM (2) Timer counter output enable flags (TOE0, TOE1) Timer counter output enable flags TOE0 and TOE1 enable or disable output to the PTO0 and PTO1 pins in the timer out F/F (TOUT F/F) status. The timer out F/F is inverted by a match signal from the comparator. When bit 3 (time[...]

  • Página 133

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 133 User ’ s Manual U10676EJ3V0UM (3) Timer counter control register (TC2) The timer counter control register (TC2) is an 8-bit register that controls the timer counter (channel 2). Figure 6-30 shows the format of this register. This register controls timer output enable carrier generator mode used in combin[...]

  • Página 134

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 134 User’ s Manual U10676EJ3V0UM 6.4.2 Operation in 8-bit timer counter mode In this mode, the timer counter is used as an 8-bit timer counter. In this case, the timer counter operates as an 8-bit programmable interval timer or counter. (1) Register setting In the 8-bit timer counter mode, the following four[...]

  • Página 135

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 135 User ’ s Manual U10676EJ3V0UM Figure 6-31. Setting of Timer Counter Mode Register (1/3) (a) Timer counter (channel 0) 765432 10 Count pulse (CP) select bit 0 Note 0 Note TM03 TM02 TM04 TM05 TM06 – Address TM0 FA0H Symbol TM06 Count pulse (CP) TM05 1 f X /2 10 0 f X /2 8 0 1 1 1 1 f X /2 4 1 Setting pro[...]

  • Página 136

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 136 User ’ s Manual U10676EJ3V0UM Figure 6-31. Setting of Timer Counter Mode Register (2/3) (b) Timer counter (channel 1) 765432 10 TM10 TM11 TM13 TM12 TM14 TM15 TM16 – Address TM1 FA8H Symbol TM13 Clears counter and IRQT1 flag when "1" is written. Starts count operation if bit 2 is set to "[...]

  • Página 137

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 137 User ’ s Manual U10676EJ3V0UM Figure 6-31. Setting of Timer Counter Mode Register (3/3) (c) Timer counter (channel 2) 765432 10 TM20 TM21 TM23 TM22 TM24 TM25 TM26 – Address TM2 F90H Symbol TM23 Clears counter and IRQT2 flag when "1" is written. Starts count operation if bit 2 is set to "[...]

  • Página 138

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 138 User ’ s Manual U10676EJ3V0UM (b) Timer counter control register (TC2) In the 8-bit timer counter mode, set TC2 as shown in Figure 6-32 (for the format of TC2, refer to Figure 6-30 Format of Timer Counter Control Register ). TC2 is manipulated by an 8- or 4-bit, or bit manipulation instruction. The value[...]

  • Página 139

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 139 User ’ s Manual U10676EJ3V0UM [Timer set time] (cycle) is calculated by dividing [contents of modulo register + 1] by [count pulse (CP) frequency] selected by the mode register. T (sec) = = (n+1) (resolution) where, T (sec): Timer set time (seconds) f CP (Hz): CP frequency (Hz) n: Contents of modulo regi[...]

  • Página 140

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 140 User ’ s Manual U10676EJ3V0UM Table 6-7. Resolution and Longest Set Time (8-Bit Timer Counter Mode) (2/3) (TM10 = 0, TM11 = 0, TM20 = 0, TM21 = 0) 8-bit timer counter (channel 2) Mode Register 8-bit Timer Counter (Channel 2) TM26 TM25 TM24 Resolution Longest set time 0 1 0 333 ns 85.3 µ s 0 1 1 167 ns 4[...]

  • Página 141

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 141 User ’ s Manual U10676EJ3V0UM Table 6-7. Resolution and Longest Set Time (8-Bit Timer Counter Mode) (3/3) (TM10 = 0, TM11 = 0, TM20 = 0, TM21 = 0) (c) µ PD754144: at 1.0 MHz 8-bit timer counter (channel 0) Mode Register 8-bit Timer Counter (Channel 0) TM06 TM05 TM04 Resolution Longest set time 1 0 0 102[...]

  • Página 142

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 142 User ’ s Manual U10676EJ3V0UM (3) Timer counter operation (8-bit) The timer counter operates as follows. Figure 6-34 shows the configuration when the timer counter operates. <1> The count pulse (CP) is selected by the timer counter mode register (TMn) and is input to the timer counter count registe[...]

  • Página 143

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 143 User ’ s Manual U10676EJ3V0UM Figure 6-34. Configuration When Timer Counter Operates MPX Internal clock Timer counter modulo register (TMODn) Comparator Timer counter count register (Tn) CP TOUT F/F PTOn Coinci- dence Clear INTTn (lRQTn set signal) Figure 6-35. Count Operation Timing Count pulse (CP) Tim[...]

  • Página 144

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 144 User ’ s Manual U10676EJ3V0UM (4) Application of 8-bit timer counter mode As an interval timer that generates an interrupt at 50 ms intervals Note • Set the higher 4 bits of the timer counter mode register (TMn) to 0100B, and select 62.5 ms (at f X = 4.19 MHz of µ PD754244) as the longest set time. ?[...]

  • Página 145

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 145 User ’ s Manual U10676EJ3V0UM 6.4.3 Operation in PWM pulse generator mode (PWM mode) In this mode, the timer counter (channel 2) is used as a PWM pulse generator. The timer counter operates as an 8-bit PWM pulse generator. When the timer counter (channel 2) is used as a PWM pulse generator, the timer cou[...]

  • Página 146

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 146 User’ s Manual U10676EJ3V0UM Figure 6-36. Setting of Timer Counter Mode Register 765432 10 TM20 TM21 TM23 TM22 TM24 TM25 TM26 – Address TM2 F90H Symbol TM23 Clears counter and IRQT2 flag when "1" is written. Starts count operation if bit 2 is set to "1". Timer start command bit Oper[...]

  • Página 147

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 147 User ’ s Manual U10676EJ3V0UM (b) Timer counter control register (TC2) In the PWM mode, set TC2 as shown in Figure 6-37 (for the format of TC2, refer to Figure 6-30 Format of Timer Counter Control Register) . TC2 is manipulated by an 8-, 4-, or bit manipulation instruction. TC2 is cleared to 00H when the[...]

  • Página 148

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 148 User ’ s Manual U10676EJ3V0UM (2) PWM pulse generator operation The timer counter (channel 2) in PWM pulse generator mode has two registers, a high-level period setting timer counter modulo register (TMOD2H) and a low-level period setting timer counter modulo register (TMOD2). Figure 6-38 shows the PWM p[...]

  • Página 149

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 149 User ’ s Manual U10676EJ3V0UM Figure 6-38. PWM Pulse Generator Operating Configuration Note This is the IRQT2 set signal. It is only set when TMOD2 matches T2. Figure 6-39. PWM Pulse Generator Operating Timing Timer counter (channel 2) operation and carrier clock (Modulo register H (TMOD2H) = 1, modulo r[...]

  • Página 150

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 150 User ’ s Manual U10676EJ3V0UM . . (3) Application of PWM mode To output a pulse with a frequency of 38.0 kHz (cycle of 26.3 µ s) and a duty factor of 1/3 to the PTO2 pin Note • Set the higher 4 bits of the timer counter mode register (TM2) to 0011B and select 61.0 µ s as the longest set time. • Set[...]

  • Página 151

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 151 User’ s Manual U10676EJ3V0UM 6.4.4 Operation in 16-bit timer counter mode In this mode, two timer counter channels, 1 and 2, are used in combination to implement 16-bit programmable interval timer or event timer operation. (1) Register setting In the 16-bit timer counter mode, the following seven registe[...]

  • Página 152

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 152 User’ s Manual U10676EJ3V0UM Figure 6-40. Setting of Timer Counter Mode Registers TM20 TM21 TM23 TM22 TM24 TM25 TM26 – TM2 F90H TM23 Clears counter and IRQTn flag when "1" is written. Starts count operation if bit 2 is set to "1". Timer start command bit Operation mode TM22 0 1 Stop[...]

  • Página 153

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 153 User ’ s Manual U10676EJ3V0UM (b) Timer counter control register (TC2) In the 16-bit timer counter mode, set TC2 as shown in Figure 6-41 (for the format of TC2, refer to Figure 6-30 Format of Timer Counter Control Register ). TC2 is manipulated by an 8-, 4-, or bit manipulation instruction. TC2 is cleare[...]

  • Página 154

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 154 User’ s Manual U10676EJ3V0UM (2) Time setting of timer counter [Timer set time] (cycle) is calculated by dividing [contents of modulo register + 1] by [count pulse (CP) frequency] selected by the mode register. T (sec) = = (n+1) (resolution) where, T (sec): Timer set time (seconds) f CP (Hz): CP frequenc[...]

  • Página 155

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 155 User ’ s Manual U10676EJ3V0UM Table 6-8. Resolution and Longest Set Time (16-Bit Timer Counter Mode) (2/2) (TM10 = 0, TM11 = 1, TM20 = 0, TM21 = 1) (c) µ PD754244: at 4.19 MHz Mode Register 16-Bit Timer Counter TM26 TM25 TM24 Resolution Longest Set Time 0 1 0 477 ns 31.3 ms 0 1 1 238 ns 15.6 ms 1 0 0 24[...]

  • Página 156

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 156 User’ s Manual U10676EJ3V0UM (3) Timer counter operation (at 16-bit) The timer counter operates as follows. Figure 6-42 shows the configuration when the timer counter operates. <1> The count pulse (CP) is selected by timer counter mode registers TM1 and TM2 and is input to timer counter count regis[...]

  • Página 157

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 157 User’ s Manual U10676EJ3V0UM Figure 6-42. Configuration When Timer Counter Operates Other internal clock is ignored MPX Timer counter modulo register (TMOD1) Comparator Timer counter count register (T1) CP Match Clear T2 overflow MPX CP Comparator Clear TOUT F/F INTT2 (IRQT2 set signal) PTO2 Internal clo[...]

  • Página 158

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 158 User ’ s Manual U10676EJ3V0UM Figure 6-43. Timing of Count Operation Remark m: Set value of timer counter module register (TMOD1) n: Set value of timer counter modulo register (TMOD2) Count pulse (CP) Timer counter modulo register (TMOD2) Timer counter count register (T2) Timer counter count register (T1[...]

  • Página 159

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 159 User ’ s Manual U10676EJ3V0UM (4) Application of 16-bit timer counter mode As an interval timer that generates an interrupt at 5-second intervals Note • Set the higher 4 bits of the mode register (TM1) to 0010B, and select the overflow of timer counter count register (T2). • Set the higher 4 bits of [...]

  • Página 160

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 160 User ’ s Manual U10676EJ3V0UM 6.4.5 Operation in carrier generator mode (CG mode) In the PWM mode, timer counter channels 1 and 2 operate in combination to implement an 8-bit carrier generator operation. When using CG mode, use it in combination with channel 1 and channel 2 of the timer counter. Timer co[...]

  • Página 161

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 161 User ’ s Manual U10676EJ3V0UM Figure 6-44. Setting of Timer Counter Mode Register (n = 1, 2) TM20 TM21 TM23 TM22 TM24 TM25 TM26 – TM2 F90H TMn3 Clears counter and IRQTn flag when "1" is written. Starts count operation if bit 2 is set to "1". Timer start command bit Operation mode TM[...]

  • Página 162

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 162 User ’ s Manual U10676EJ3V0UM (b) Timer counter control register (TC2) In the CG mode, set the timer counter output enable flag (TOE1) and TC2 as shown in Figure 6-45 (for the format of TC2, refer to Figure 6-30 Format of Timer Counter Control Register ). TOE1 is manipulated by a bit manipulation instruc[...]

  • Página 163

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 163 User ’ s Manual U10676EJ3V0UM (2) Carrier generator operation The carrier generator operation is performed as follows. Figure 6-47 shows the configuration of the timer counter in the carrier generator mode. (a) Timer counter (channel 1) operation The timer counter (channel 1) in carrier generator mode de[...]

  • Página 164

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 164 User ’ s Manual U10676EJ3V0UM <4> The operations <2> and <3> are repeated. <5> The no return zero data is reloaded from NRZB to NRZ when timer counter channel 1 generates an interrupt. <6> A carrier clock or high level is output when NRZ is set to 1 by the remote controller [...]

  • Página 165

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 165 User ’ s Manual U10676EJ3V0UM Figure 6-47. Configuration in Carrier Generator Mode Other internal clock is ignored MPX Timer counter modulo register (TMOD1) Comparator Timer counter count register (T1) CP Clear TOUT F/F PTO1 PTO2 Carrier clock NRZB NRZ High-level period setting timer counter modulo regis[...]

  • Página 166

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 166 User ’ s Manual U10676EJ3V0UM Figure 6-48. Carrier Generator Operation Timing <1> Timer (channel 2) operation and carrier clock (Modulo register H (TMOD2H) = i, Modulo register (TMOD2) = k) Count pulse (CP) Timer counter count register (T2) Carrier clock 0 k1 2 i – 1 i 012 k – 1 k 0123 <2>[...]

  • Página 167

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 167 User ’ s Manual U10676EJ3V0UM Remark If a timer (channel 1) interrupt is generated when the PTO2 pin is low and the carrier clock is high (NRZ = 0, carrier clock = high level), the carrier is output to the PTO2 pin from the pulse after the carrier clock. If a timer (channel 1) interrupt is generated when[...]

  • Página 168

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 168 User ’ s Manual U10676EJ3V0UM (3) Application of CG mode To use the timer counter as a carrier generator for remote controller signal transmission The examples shown below apply to the operation of the µ PD754244 at f X = 4.19 MHz. With f X = 6.0 MHz operation of the µ PD754244 and f CC = 1.0 MHz opera[...]

  • Página 169

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 169 User ’ s Manual U10676EJ3V0UM <2> To output a leader code with a 9 ms period to output a carrier clock and a 4.5 ms period to output a low level (Refer to the figure below.) • Set the higher 4 bits of the timer counter mode register (TM1) to 0110B and select 15.6 ms as the longest set time. • S[...]

  • Página 170

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 170 User ’ s Manual U10676EJ3V0UM <3> To output a custom code with a 0.56 ms period to output a carrier clock when data is “ 1 ” , a 1.69 ms to output a low level, a 0.56 ms to output a carrier clock when data is “ 0 ” , and a 0.56 ms period to output a low level (refer to the figure below). ?[...]

  • Página 171

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 171 User ’ s Manual U10676EJ3V0UM <Program example> In the following example, it is assumed that the output latch of the PTO2 pin is cleared to “ 0 ” and that the output mode has been set. It is also assumed that the carrier clock is generated with the status of the program in the preceding example[...]

  • Página 172

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 172 User ’ s Manual U10676EJ3V0UM BR SEND_1_F ; If data is 0, proceeds to transmission processing of next data with PTO2 pin outputting low level CALL !SEND_D_1 BR SEND_1_F SEND_END : ; Completes transmission of 16 bits of data ; <subroutine> GET_DATA: ; Searches data of BSB indicated by @L. Sets value[...]

  • Página 173

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 173 User’ s Manual U10676EJ3V0UM 6.4.6 Notes on using timer counter (1) Error when timer starts After the timer has been started (bit 3 of TMn has been set to “1”), the time required for generation of the match signal, which is calculated by the expression (contents of modulo register + 1) × resolution,[...]

  • Página 174

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 174 User ’ s Manual U10676EJ3V0UM (2) Note on starting timer Usually, count register Tn and interrupt request flag IRQTn are cleared when the timer is started (bit 3 of TMn is set to “ 1 ” ). However, if the timer is in an operation mode, and if IRQTn is set as soon as the timer is started, IRQTn may not[...]

  • Página 175

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 175 User ’ s Manual U10676EJ3V0UM (3) Notes on changing count pulse When it is specified to change the count pulse (CP) by rewriting the contents of the timer counter mode register (TMn), the specification becomes valid immediately after execution of the instruction that commands the specification. Clock A s[...]

  • Página 176

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 176 User ’ s Manual U10676EJ3V0UM (4) Operation after changing modulo register The contents of the timer counter modulo register (TMODn) and high-level period setting timer counter modulo register (TMOD2H) are changed as soon as an 8-bit data memory manipulation instruction has been executed. n Rewrite instr[...]

  • Página 177

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 177 User ’ s Manual U10676EJ3V0UM (5) Note on application of carrier generator (on starting) When the carrier clock is generated, after the timer has been started (by setting bit 3 of TM2 to “ 1 ” ), the high- level period of the initial carrier clock may deviate by up to one clock of the count pulse (CP[...]

  • Página 178

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 178 User ’ s Manual U10676EJ3V0UM (6) Notes on application of carrier generator (reload) To output a carrier to the PTO2 pin, the time required for the initial carrier to be generated deviates by up to one carrier clock after reloading (the contents of the no return zero buffer flag (NRZB) are transferred to[...]

  • Página 179

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 179 User ’ s Manual U10676EJ3V0UM (7) Notes on application of carrier generator (restarting) If forced reloading is performed by directly rewriting the contents of the no return zero flag (NRZ) and then the timer is restarted (by setting bit 3 of TM2 to “ 1 ” ) when the carrier clock is high (TOUT F/F ho[...]

  • Página 180

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 180 User’ s Manual U10676EJ3V0UM 6.5 Programmable Threshold Port (Analog Input Port) The µ PD754244 provides analog input pins (PTH00, PTH01) whose threshold voltage (reference voltage) is selectable within sixteen steps. The following operations can be performed with these analog input pins. (1) Comparator[...]

  • Página 181

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 181 User’ s Manual U10676EJ3V0UM Figure 6-49. Block Diagram of Programmable Threshold Port PTH00 PTH01 AV REF 1 2 R R R 1 2 R MPX V REF PTHM7 PTHM PTHM6 PTHM5 PTHM4 PTHM3 PTHM2 PTHM1 PTHM0 8 Operate/stop Standby mode signal + – + – PTH0 Programmable threshold port input latch (2) Input buffer Input buffe[...]

  • Página 182

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 182 User’ s Manual U10676EJ3V0UM 0.5 16 15.5 16 6.5.2 Programmable threshold port mode (PTHM) register PTHM is an 8-bit register that controls the programmable threshold port operation, and it is set by an 8-bit memory manipulation instruction. The threshold voltage can be selected by specifying the lower fo[...]

  • Página 183

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 183 User ’ s Manual U10676EJ3V0UM 6.5.3 Programmable threshold port application (1) An analog input voltage input to the PTH00 pin is A/D converted with 4-bit resolution. Figure 6-51. Application Example of Programmable Threshold Port PTH00 input voltage Reference voltage (V REF ) AV REF 7.5/16 ⋅ AV REF V [...]

  • Página 184

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 184 User ’ s Manual U10676EJ3V0UM 6.6 Bit Sequential Buffer ... 16 Bits The bit sequential buffer (BSB) is a special data memory used for bit manipulation. It can manipulate bits by sequentially changing the address and bit specification. Therefore, this buffer is useful for processing data with a long bit l[...]

  • Página 185

    CHAPTER 6 PERIPHERAL HARDWARE FUNCTION 185 User ’ s Manual U10676EJ3V0UM Example For serial output of the 16-bit data of BUFF1, 2 from bit 0 of port 3 CLR1 MBE MOV XA, BUFF1 MOV BSB0, XA ; Sets BSB0, 1 MOV XA, BUFF2 MOV BSB2, XA ; Sets BSB2, 3 MOV L, #0 LOOP0: SKT BSB0, @L ; Tests specified bit of BSB BR LOOP1 NOP ; Dummy (to adjust timing) SET1 [...]

  • Página 186

    186 User’ s Manual U10676EJ3V0UM CHAPTER 7 INTERRUPT AND TEST FUNCTIONS The µ PD754244 has six vectored interrupt sources and one test input that can be used for various applications. The interrupt controller of the µ PD754244 has unique features and can service interrupts at extremely high speed. (1) Interrupt function (a) Hardware-controlled [...]

  • Página 187

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 187 User’ s Manual U10676EJ3V0UM Figure 7-1. Block Diagram of Interrupt Controller Notes 1. Noise eliminator (Standby release is disable when noise eliminator is selected.) 2. Does not have the INT2 pin. The interrupt request flag (IRQ2) is set at the KRn pin falling edge when IM20 = 1 and IM21 = 0. Internal[...]

  • Página 188

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 188 User ’ s Manual U10676EJ3V0UM 7.2 Types of Interrupt Sources and Vector Table The µ PD754244 has the following six interrupt sources and nesting of interrupts can be controlled by software. Table 7-1. Types of Interrupt Sources Interrupt Source Internal/External Vectored Interrupt Request Signal (Vector[...]

  • Página 189

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 189 User ’ s Manual U10676EJ3V0UM Figure 7-2. Interrupt Vector Table MBE MBE MBE MBE MBE Address 0002H 0004H 0006H 0008H 000AH 000CH 000EH RBE RBE RBE RBE RBE INTBT start address (higher 4 bits) INTBT start address (lower 8 bits) INT0 start address (higher 4 bits) INT0 start address (lower 8 bits) INTT0 star[...]

  • Página 190

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 190 User’ s Manual U10676EJ3V0UM 7.3 Hardware Controlling Interrupt Function (1) Interrupt request flag and interrupt enable flag The µ PD754244 has the following six interrupt request flags (IRQ ××× ) corresponding to the respective interrupt sources. INT0 interrupt request flag (IRQ0) BT interrupt requ[...]

  • Página 191

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 191 User ’ s Manual U10676EJ3V0UM Table 7-2. Signals Setting Interrupt Request Flags Interrupt Request Flag Signal Setting Interrupt Request Flag Interrupt Enable Flag Set by reference time interval signal from basic interval timer watchdog timer Set by detection of edge of INT0/P61 pin input signal. Edge to[...]

  • Página 192

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 192 User ’ s Manual U10676EJ3V0UM Figure 7-3. Interrupt Priority Select Register IPS3 IPS2 IPS1 IPS0 32 1 0 IPS Symbol FB2H Address 00 0 0 0 0 1 1 1 1 0 1 1 0 0 1 1 1 0 1 0 1 0 1 No interrupts are handled as higher-priority interrupts. VRQ1 (INTBT) VRQ2 (INT0) Setting prohibited Note VRQ5 (INTT0) VRQ6 (INTT1[...]

  • Página 193

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 193 User ’ s Manual U10676EJ3V0UM (3) Hardware of INT0 (a) Figure 7-4 shows the configuration of INT0, which is an external interrupt input that can be detected at the rising or falling edge depending on the specification. INT0 also has a noise elimination function which uses a sampling clock (refer to Figur[...]

  • Página 194

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 194 User ’ s Manual U10676EJ3V0UM Figure 7-4. Configuration of INT0 Internal bus 4 IM0 Noise eliminator INT0/P61 Selector Selector Φ f X /64 IM03 Edge detector INT0 (IRQ0 set signal) IM00, IM01 IM02 Specifies edge to be detected. Selects sampling clock. Input buffer Note Even if f X /64 is selected, the HAL[...]

  • Página 195

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 195 User’ s Manual U10676EJ3V0UM Figure 7-6. Format of INT0 Edge Detection Mode Register (IM0) 3210 IM00 IM01 IM02 IM03 Address IM0 FB4H Symbol IM01 Specifies edge to be detected IM00 0 Rising edge 0 0 Falling edge 1 1 Both rising and falling edges 0 1 Ignored (interrupt request flag is not set) 1 IM02 Noise[...]

  • Página 196

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 196 User ’ s Manual U10676EJ3V0UM (4) Interrupt status flag The interrupt status flags (IST0 and IST1) indicate the status of the processing currently being executed by the CPU and are included in PSW. The interrupt priority controller controls nesting of interrupts according to the contents of these flags a[...]

  • Página 197

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 197 User’ s Manual U10676EJ3V0UM 7.4 Interrupt Sequence When an interrupt occurs, it is processed according to the procedure illustrated below. Figure 7-7. Interrupt Servicing Sequence Interrupt (INT ××× ) occurs Sets IRQ ××× IE ××× set? Corresponding VRQn occurs Pending until IE ××× is set NO YE[...]

  • Página 198

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 198 User ’ s Manual U10676EJ3V0UM 7.5 Nesting Control of Interrupts The µ PD754244 can nest interrupts by the following two methods. (1) Nesting with interrupt having high priority specified This method is the standard nesting method of the µ PD754244. One interrupt source is selected and nested. An interr[...]

  • Página 199

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 199 User ’ s Manual U10676EJ3V0UM (2) Nesting by changing interrupt status flags Nesting can be implemented if the interrupt status flags are changed by program. In other words, nesting is enabled when IST1 and IST0 are cleared to “ 0, 0 ” by an interrupt servicing program, and status 0 is set. This meth[...]

  • Página 200

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 200 User ’ s Manual U10676EJ3V0UM 7.6 Servicing of Interrupts Sharing Vector Address Because interrupt sources INTT1 and INTT2 share vector tables, you should select one or both of the interrupt sources in the following way. (1) To use one interrupt Of the two interrupt sources sharing a vector table, set th[...]

  • Página 201

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 201 User ’ s Manual U10676EJ3V0UM Examples 1. To use both INTT1 and INTT2 as having higher priority, and give priority to INTT2 DI SKTCLR IRQT2 ; IRQT2=1? BR VSUBBT EI RETI : VSUBBT: CLR1 IRQT1 EI RETI 2. To use both INTT1 and INTT2 as having lower priority, and give priority to INTT2 SKTCLR IRQT2 ; IRQT2 =1[...]

  • Página 202

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 202 User’ s Manual U10676EJ3V0UM 7.7 Machine Cycles Until Interrupt Servicing The number of machine cycles required from when an interrupt request flag (IRQxxx) has been set until the interrupt routine is executed is as follows. (1) If IRQxxx is set while interrupt control instruction is being executed If IR[...]

  • Página 203

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 203 User ’ s Manual U10676EJ3V0UM (2) If IRQxxx is set while instruction other than (1) is executed (a) If IRQxxx is set at the last machine cycle of the instruction under execution In this case, the one instruction following the instruction under execution is executed, three machine cycles of interrupt serv[...]

  • Página 204

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 204 User ’ s Manual U10676EJ3V0UM 7.8 Effective Usage of Interrupts Use the interrupt function effectively as follows. (1) Use different register banks for the normal routine and interrupt routine. The normal routine uses register banks 2 and 3 with RBE = 1 and RBS = 2. For the interrupt service routine for [...]

  • Página 205

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 205 User ’ s Manual U10676EJ3V0UM (1) Enabling or disabling interrupt Reset . . . <1> EI IE0 EI IET1 <2> EI . . . . . . <3> DI IE0 . . . . . . <4> DI . . . . . . . . . . . . . . . . <5> Disables interrupts Enables INT0 and INTT1 Enables INTT1 Disables interrupts <Main program[...]

  • Página 206

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 206 User ’ s Manual U10676EJ3V0UM (2) Example of using INTBT and INT0 (falling edge active): not nested (all interrupts have higher priority) SEL <1> Reset INT0 <4> RB2 MOV MOV CLR1 <2> A, #1 IM0, A IRQ0 EI EI EI EI . . . . . . . . . . . . . . . . . . . . . . . . . IEBT IE0 IET0 <3> S[...]

  • Página 207

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 207 User ’ s Manual U10676EJ3V0UM (3) Nesting of interrupts with higher priority (INTBT has higher priority and INTT0 and INTT2 have lower priority) <1> Reset INTT0 <2> SEL EI EI EI MOV MOV . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RB2 IEBT IET0 IET2 A, #9 IPS, A[...]

  • Página 208

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 208 User ’ s Manual U10676EJ3V0UM (4) Executing pending interrupt - interrupt input while interrupts are disabled - Reset EI IE0 . . . . . . . . . . . . EI . . . . . . . . . . . . . . . . . . . . EI IET0 . . . . . . . . . . . . . . . . . . . . <2> <1> INT0 <4> <lNT0 servicing program>[...]

  • Página 209

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 209 User ’ s Manual U10676EJ3V0UM (5) Executing pending interrupt - two interrupts with lower priority occur simultaneously - Reset EI IET0 EI IE0 EI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . INT0 INTT0 <1> <lNT0 servicing program> <lNTT0 servici[...]

  • Página 210

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 210 User’ s Manual U10676EJ3V0UM (6) Executing pending interrupt - interrupt occurs during interrupt service (INTBT has higher priority and INTT0 and INTT2 have lower priority) - Reset EI IEBT EI IET0 EI IET2 MOV A, #9 MOV IPS, A . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .[...]

  • Página 211

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 211 User ’ s Manual U10676EJ3V0UM (7) Enabling nesting of two interrupts - INTT0 and INT0 are nested doubly and INTBT and INTT2 are nested singly - Reset INTBT <1> EI EI EI EI EI IET0 IE0 IEBT IET2 Status 0 Status 0 <lNTBT servicing program> Status 0 Status 1 INTT0 <3> RETI <4> Status[...]

  • Página 212

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 212 User’ s Manual U10676EJ3V0UM 7.10 Test Function 7.10.1 Types of test sources The µ PD754244 has a test source, INT2. INT2 is an edge-detection testable input. Table 7-5. Types of Test Sources Test Source Internal/External INT2 (detects falling edge of input to KR4 to KR7 pins) External 7.10.2 Hardware c[...]

  • Página 213

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 213 User ’ s Manual U10676EJ3V0UM Figure 7-10. Block Diagram of KR4 to KR7 KR7/P73 KR6/P72 KR5/P71 KR4/P70 Nothing is assigned (in reset mode) Key return reset circuit Falling edge detector IM2 INT2 (IRQ2 setting signal) Input buffer 4 Internal bus Selector[...]

  • Página 214

    CHAPTER 7 INTERRUPT AND TEST FUNCTIONS 214 User ’ s Manual U10676EJ3V0UM Figure 7-11. Format of INT2 Edge Detection Mode Register (IM2) 3210 IM20 IM21 0 0 Address IM2 FB6H Symbol IM21 INT2 test source IM20 0 Assigned nothing 0 01 Other Test input pin – KR4-KR7 Inputs falling edge of any of KR4/P70 to KR7/P73 pin Setting prohibited Cautions 1. I[...]

  • Página 215

    215 User’ s Manual U10676EJ3V0UM CHAPTER 8 STANDBY FUNCTION The µ PD754244 possesses a standby function that reduces the power consumption of the system. This standby function can be implemented in the following two modes. • STOP mode • HALT mode The functions of the STOP and HALT modes are as follows. (1) STOP mode In this mode, the system [...]

  • Página 216

    CHAPTER 8 STANDBY FUNCTION 216 User’ s Manual U10676EJ3V0UM 8.1 Settings and Operating Statuses of Standby Mode Table 8-1. Operating Statuses in Standby Mode STOP Mode HALT Mode Instruction to be set STOP instruction HALT instruction Operating status Clock generator Operation stopped Only CPU clock Φ is stopped (oscillation continues) Basic inte[...]

  • Página 217

    CHAPTER 8 STANDBY FUNCTION 217 User’ s Manual U10676EJ3V0UM The STOP mode is set by the STOP instruction, and the HALT mode is set by the HALT instruction (the STOP and HALT instructions respectively set bits 3 and 2 of PCC). Be sure to write a NOP instruction after the STOP and HALT instructions. When changing the CPU operating clock by using th[...]

  • Página 218

    CHAPTER 8 STANDBY FUNCTION 218 User’ s Manual U10676EJ3V0UM 8.2 Releasing Standby Mode Both the STOP and HALT modes can be released when an interrupt request signal occurs that is enabled by the corresponding interrupt enable flag, or when the RESET signal is asserted. Furthermore, STOP mode can be released without altering the interrupt enable f[...]

  • Página 219

    CHAPTER 8 STANDBY FUNCTION 219 User ’ s Manual U10676EJ3V0UM Figure 8-1. Releasing Standby Mode (2/2) (c) Releasing HALT mode by RESET signal RESET signal Clock HALT instruction Operation mode HALT mode Wait Note Operation mode Oscillates (d) Releasing HALT mode by interrupt Standby release signal Clock HALT instruction Operation mode HALT mode O[...]

  • Página 220

    CHAPTER 8 STANDBY FUNCTION 220 User’ s Manual U10676EJ3V0UM <3> Clear again the IRQ used to release STOP mode to enter STOP mode. In this STOP mode, IRQ of the selected interrupt is set and HALT mode is entered. Then, after a wait time, the system returns to the normal operating mode. In the case of the µ PD754244, when the STOP mode has b[...]

  • Página 221

    CHAPTER 8 STANDBY FUNCTION 221 User ’ s Manual U10676EJ3V0UM Figure 8-3. STOP Mode Release by Key Return Reset or RESET Input IE ×××← 0 STOP NOP Key return reset or RESET input The differences between release by a key return reset and release by RESET input are as follows. RESET Input Key Return Reset Key return flag (KRF) 0 1 Watchdog flag [...]

  • Página 222

    CHAPTER 8 STANDBY FUNCTION 222 User ’ s Manual U10676EJ3V0UM 8.3 Operation After Release of Standby Mode (1) When the standby mode has been released by the RESET signal, the normal reset operation is performed. (2) When the standby mode has been released by an interrupt, whether or not a vectored interrupt is executed when the CPU has resumed ins[...]

  • Página 223

    CHAPTER 8 STANDBY FUNCTION 223 User ’ s Manual U10676EJ3V0UM (1) Application example of STOP mode (when using the µ PD754244 at f X = 6.0 MHz) <When using the STOP mode under the following conditions> • The STOP mode is set at the falling edge of INT0 and released at the rising edge. • All the I/O ports go into a high-impedance state ([...]

  • Página 224

    CHAPTER 8 STANDBY FUNCTION 224 User ’ s Manual U10676EJ3V0UM <Program example> (INT0 servicing program, MBE = 0) VSUB0: SKT PORT6.1 ; P61 = 1? BR PDOWN ; Power down SET1 BTM.3 ; Power on WAIT: SKT IRQBT ; Waits for 21.8 ms BR WAIT SKT PORT6.1 ; Checks chattering BR PDOWN MOV A, #0011B MOV PCC, A ; Sets high-speed mode MOV XA.# ×× H ; Sets[...]

  • Página 225

    CHAPTER 8 STANDBY FUNCTION 225 User ’ s Manual U10676EJ3V0UM (2) Application example of HALT mode (when using the µ PD754244 at f X = 6.0 MHz) <To perform intermittent operation under the following conditions> • The standby mode is set at the falling edge of INT0 and released at the rising edge. • In the standby mode, an intermittent o[...]

  • Página 226

    CHAPTER 8 STANDBY FUNCTION 226 User ’ s Manual U10676EJ3V0UM <Program example> BTAND4: SKTCLR IRQ0 ; INT0 = 1? BR VSUBBT ; N O SKT PORT6.1 ; P61 = 1? BR PDOWN ; Power down SET1 BTM.3 ; Starts BT WAIT: SKT IRQBT ; Waits for 175 ms BR WAIT SKT PORT6.1 BR PDOWN MOV A, #0011B ; High-speed mode MOV PCC, A [EI IEn] ; IEn ← 1 RETI PDOWN: MOV A, [...]

  • Página 227

    227 User’ s Manual U10676EJ3V0UM CHAPTER 9 RESET FUNCTION 9.1 Configuration and Operation of Reset Function Three types of reset signals are used: the external reset signal (RESET), a reset signal from the basic interval timer/watchdog timer, and a key return reset. When any one of these reset signals is input, the internal reset signal is assert[...]

  • Página 228

    CHAPTER 9 RESET FUNCTION 228 User’ s Manual U10676EJ3V0UM Figure 9-2. Reset Operation by RESET Signal RESET signal HALT mode Operation mode or standby mode Internal reset operation Operation mode Wait Note Note µ PD754244: The following two times can be selected by the mask option. 2 17 /f X (21.8 ms at 6.0 MHz, 31.3 ms at 4.19 MHz) 2 15 /f X (5[...]

  • Página 229

    CHAPTER 9 RESET FUNCTION 229 User ’ s Manual U10676EJ3V0UM When RESET Signal Asserted in Standby Mode When RESET Signal Asserted During Operation Hardware Basic inter- val timer/ watchdog timer Timer counter (T0) Timer counter (T1) Table 9-1. Status of Each Hardware Unit After Reset (1/3) Notes 1. If STOP mode is entered during an EEPROM write op[...]

  • Página 230

    CHAPTER 9 RESET FUNCTION 230 User ’ s Manual U10676EJ3V0UM Counter (T2) Modulo register (TMOD2) High-level period setting modulo register (TMOD2H) Mode register (TM2) TOE2, TOUT F/F REMC, NRZ, NRZB Programmable threshold port mode register (PTHM) Processor clock control register (PCC) Interrupt request flag (IRQ ××× ) Interrupt enable flag (IE[...]

  • Página 231

    CHAPTER 9 RESET FUNCTION 231 User ’ s Manual U10676EJ3V0UM 9.2 Watchdog Flag (WDF), Key Return Flag (KRF) WDF and KRF are mapped to bit 2 and 3 of address FC6H respectively. The contents of WDF and KRF are undefined initially, but they are initialized to “ 0 ” by external RESET signal generation. WDF is cleared by a watchdog timer overflow si[...]

  • Página 232

    CHAPTER 9 RESET FUNCTION 232 User ’ s Manual U10676EJ3V0UM Figure 9-4. KRF Operation in Generating Each Signal External RESET KRF Operation mode Operation mode HALT mode Operation mode Internal reset operation STOP mode Internal reset operation Internal reset operation HALT mode Operation mode STOP mode HALT mode Operation mode STOP instruction e[...]

  • Página 233

    233 User’ s Manual U10676EJ3V0UM CHAPTER 10 MASK OPTIONS The µ PD754144 and 754244 have the following mask options. Table 10-1. Selection of Mask Options Item µ PD754144 µ PD754244 P70/KR4 to P73/KR7 On-chip pull-up resistors specifiable in 1-bit units by mask option RESET pin On-chip pull-up resistors specifiable by mask option Oscillation st[...]

  • Página 234

    234 User’ s Manual U10676EJ3V0UM CHAPTER 11 INSTRUCTION SET The instruction set of the µ PD754244 is based on the instruction set of the 75X Series and therefore maintains compatibility with the 75X Series, but with the following improved features. (1) Bit manipulation instructions for various applications (2) Efficient 4-bit manipulation instru[...]

  • Página 235

    CHAPTER 11 INSTRUCTION SET 235 User’ s Manual U10676EJ3V0UM 11.1.2 Bit manipulation instruction The µ PD754244 has reinforced bit test, bit transfer, and bit Boolean (AND, OR, and XOR) instructions, in addition to the ordinary bit manipulation (set and clear) instructions. The bit to be manipulated is specified in the bit manipulation addressing[...]

  • Página 236

    CHAPTER 11 INSTRUCTION SET 236 User’ s Manual U10676EJ3V0UM 11.1.4 Base number adjustment instruction Some applications require that the result of addition or subtraction of 4-bit data (which is carried out in binary) be converted into a decimal number or into a number with a base of 6, such as time. Therefore, the µ PD754244 is provided with ba[...]

  • Página 237

    CHAPTER 11 INSTRUCTION SET 237 User’ s Manual U10676EJ3V0UM 11.1.5 Skip instruction and number of machine cycles required for skipping The instruction set of the µ PD754244 configures a program where instructions may be or may not be skipped if a given condition is satisfied. If a skip condition is satisfied when a skip instruction is executed, [...]

  • Página 238

    CHAPTER 11 INSTRUCTION SET 238 User’ s Manual U10676EJ3V0UM Representation Description reg X, A, B, C, D, E, H, L reg1 X, B, C, D, E, H, L rp XA, BC, DE, HL rp1 BC, DE, HL rp2 BC, DE rp' XA, BC, DE, HL, XA', BC', DE', HL' rp'1 BC, DE, HL, XA', BC', DE', HL' rpa HL, HL+, HL–, DE, DL rpa1 DE, DL n[...]

  • Página 239

    CHAPTER 11 INSTRUCTION SET 239 User’ s Manual U10676EJ3V0UM (2) Conventions for explanation of operation A: A register; 4-bit accumulator B: B register C: C register D: D register E: E register H: H register L: L register X: X register XA: Register pair (XA); 8-bit accumulator BC: Register pair (BC) DE: Register pair (DE) HL: Register pair (HL) X[...]

  • Página 240

    CHAPTER 11 INSTRUCTION SET 240 User’ s Manual U10676EJ3V0UM *1 MB = MBE MBS (MBS = 0, 4, 15) *2 MB = 0 *3 MBE = 0: MB = 0 (000H to 07FH) MB = 15 (F80H to FFFH) MBE = 1: MB = MBS (MBS = 0, 4, 15) *4 MB = 15, fmem = FB0H to FBFH, FF0H to FFFH *5 MB = 15, pmem = FC0H to FFFH *6 addr = 0000H to 0FFFH *7 addr, addr1 = (Current PC) – 15 to (Current P[...]

  • Página 241

    CHAPTER 11 INSTRUCTION SET 241 User’ s Manual U10676EJ3V0UM (4) Explanation of machine cycle field S indicates the number of machine cycles required for an instruction with skip to execute the skip operation. The value of S varies as follows. • When skip is executed .............................................................................. [...]

  • Página 242

    CHAPTER 11 INSTRUCTION SET 242 User’ s Manual U10676EJ3V0UM Transfer MOV A, #n4 1 1 A ← n4 String effect A reg1, #n4 2 2 reg1 ← n4 XA, #n8 2 2 XA ← n8 String effect A HL, #n8 2 2 HL ← n8 String effect B rp2, #n8 2 2 rp2 ← n8 A, @HL 1 1 A ← (HL) *1 A, @HL+ 1 2 + S A ← (HL), then L ← L + 1 *1 L = 0 A, @HL– 1 2 + S A ← (HL), then[...]

  • Página 243

    CHAPTER 11 INSTRUCTION SET 243 User’ s Manual U10676EJ3V0UM Machine Cycle Instructions Mnemonic Operand Bytes Operation Skip Condition Addressing Area MOVT XA, @PCDE 1 3 XA ← (PC 11-8 + DE) ROM XA, @PCXA 1 3 XA ← (PC 11-8 + XA) ROM XA, @BCDE 1 3 XA ← (BCDE) ROM Note *6 XA, @BCXA 1 3 XA ← (BCXA) ROM Note *6 Bit transfer MOV1 CY, fmem.bit 2[...]

  • Página 244

    CHAPTER 11 INSTRUCTION SET 244 User’ s Manual U10676EJ3V0UM RORC A 1 1 CY ← A 0 , A 3 ← CY, A n–1 ← A n NOT A2 2 A ← A INCS reg 1 1 + S reg ← reg + 1 reg = 0 rp1 1 1 + S rp1 ← rp1 + 1 rp1 = 00H @HL 2 2 + S (HL) ← (HL) + 1 *1 (HL) = 0 mem 2 2 + S (mem) ← (mem) + 1 *3 (mem) = 0 DECS reg 1 1 + S reg ← reg – 1 reg = FH rp' [...]

  • Página 245

    CHAPTER 11 INSTRUCTION SET 245 User’ s Manual U10676EJ3V0UM Machine Cycle Instructions Mnemonic Operand Bytes Operation Skip Condition Addressing Area AND1 CY, fmem.bit 2 2 CY ← CY (fmem.bit) *4 CY, pmem.@L 2 2 CY ← CY (pmem 7-2 + L 3-2 .bit(L 1-0 )) *5 CY, @H + mem.bit 2 2 CY ← CY (H + mem 3-0 .bit) *1 OR1 CY, fmem.bit 2 2 CY ← CY (fmem.[...]

  • Página 246

    CHAPTER 11 INSTRUCTION SET 246 User’ s Manual U10676EJ3V0UM Subrou- tine/stack control Machine Cycle Instructions Mnemonic Operand Bytes Operation Skip Condition Addressing Area CALLA Note !addr1 3 3 (SP–6) (SP–3) (SP–4) ← PC 11-0 *11 (SP–5) ← 0, 0, 0, 0 (SP–2) ← × , × , MBE, RBE PC 11-0 ← addr1, SP ← SP – 6 CALL Note !add[...]

  • Página 247

    CHAPTER 11 INSTRUCTION SET 247 User’ s Manual U10676EJ3V0UM Machine Cycle Instructions Mnemonic Operand Bytes Operation Skip Condition Addressing Area Subrou- tine/stack control Interrupt control PUSH rp 1 1 (SP – 1) (SP – 2) ← rp, SP ← SP – 2 BS 2 2 (SP – 1) ← MBS, (SP – 2) ← RBS, SP ← SP–2 POP rp 1 1 rp ← (SP + 1) (SP), [...]

  • Página 248

    CHAPTER 11 INSTRUCTION SET 248 User’ s Manual U10676EJ3V0UM 11.3 Opcode of Each Instruction (1) Description of symbol of opcode R 2 R 1 R 0 reg 000 A 001 X 010L 011 H 100 E 101 D 110 C 111 B reg reg1 P 2 P 1 P 0 reg-pair 000 X A 001 X A ' 010 H L 011 H L ' 100 D E 101 D E ' 110 B C 111 B C ' rp' rp'1 Q 2 Q 1 Q 0 addr[...]

  • Página 249

    CHAPTER 11 INSTRUCTION SET 249 User’ s Manual U10676EJ3V0UM (2) Opcode for bit manipulation addressing *1 in the operand field indicates the following three types. • fmem.bit • pmem.@L • @H+mem.bit The second byte *2 of the opcode corresponding to the above addressing is as follows. *1 2nd Byte of Opcode Accessible Bit fmem. bit 1 0 B 1 B 0[...]

  • Página 250

    CHAPTER 11 INSTRUCTION SET 250 User’ s Manual U10676EJ3V0UM Instruction Mnemonic Operand Opcode B 1 B 2 B 3 Transfer MOV A , # n 4 0111I 3 I 2 I 1 I 0 reg1, #n4 10011010 I 3 I 2 I 1 I 0 1R 2 R 1 R 0 rp, #n8 10001 P 2 P 1 1I 7 I 6 I 5 I 4 I 3 I 2 I 1 I 0 A, @rpa1 11100 Q 2 Q 1 Q 0 XA, @HL 1010101000011000 @HL, A 11101000 @HL, XA 1010101000010000 A[...]

  • Página 251

    CHAPTER 11 INSTRUCTION SET 251 User’ s Manual U10676EJ3V0UM Opcode B 1 B 2 B 3 Operation ADDS A , # n 4 0110I 3 I 2 I 1 I 0 XA, #n8 10111001I 7 I 6 I 5 I 4 I 3 I 2 I 1 I 0 A , @ H L 11010010 XA, rp' 1010101011001 P 2 P 1 P 0 rp'1, XA 1010101011000 P 2 P 1 P 0 ADDC A , @ H L 10101001 XA, rp' 1010101011011 P 2 P 1 P 0 rp'1, XA 1[...]

  • Página 252

    CHAPTER 11 INSTRUCTION SET 252 User’ s Manual U10676EJ3V0UM Opcode B 1 B 2 B 3 INCS r e g 11000 R 2 R 1 R 0 r p 1 10001 P 2 P 1 P 0 @ H L 1001100100000010 m e m 10000010 D 7 D 6 D 5 D 4 D 3 D 2 D 1 D 0 DECS r e g 11001 R 2 R 1 R 0 r p ' 1010101001101 P 2 P 1 P 0 Comparison SKE reg, #n4 10011010 I 3 I 2 I 1 I 0 0R 2 R 1 R 0 @HL, #n4 100110010[...]

  • Página 253

    CHAPTER 11 INSTRUCTION SET 253 User’ s Manual U10676EJ3V0UM Opcode B 1 B 2 B 3 Branch BR !addr 1010101100 addr $addr1 0000 A 3 A 2 A 1 A 0 1111 S 3 S 2 S 1 S 0 PCDE 1001100100000100 PCXA 1001100100000000 BCDE 1001100100000101 BCXA 1001100100000001 BRA !addr1 101110100 addr1 BRCB !caddr 0101 caddr CALLA !addr1 101110110 addr1 CALL !addr 1010101101[...]

  • Página 254

    CHAPTER 11 INSTRUCTION SET 254 User’ s Manual U10676EJ3V0UM 11.4 Instruction Function and Application This section describes the functions and applications of the respective instructions. The instructions that can be used and the functions of the instructions differ between the MkI and MkII modes of the µ PD754144, and 754244. Read the descripti[...]

  • Página 255

    CHAPTER 11 INSTRUCTION SET 255 User’ s Manual U10676EJ3V0UM 11.4.1 Transfer instructions MO V A, #n4 Function: A ← n4 n4 = I 3-0 : 0-FH Transfers 4-bit immediate data n4 to the A register (4-bit accumulator). This instruction has a string effect (group A), and if MOV A, #n4 or MOV XA, #n8 follows this instruction, the string-effect instruction [...]

  • Página 256

    CHAPTER 11 INSTRUCTION SET 256 User’ s Manual U10676EJ3V0UM MO V A, @HL Function: A ← (HL) Transfers the contents of the data memory content addressed by register pair HL is transferred to the A register. MO V A, @HL+ Function: A ← (HL), L ← L+1 skip if L = 0H Transfers the contents of the data memory addressed by register pair HL to the A [...]

  • Página 257

    CHAPTER 11 INSTRUCTION SET 257 User’ s Manual U10676EJ3V0UM MO V XA, @HL Function: A ← (HL), X ← (HL+1) Transfers the contents of the data memory addressed by register pair HL to the A register, and the contents of the next memory address to the X register. If the contents of the L register are a odd number, an address whose least significant[...]

  • Página 258

    CHAPTER 11 INSTRUCTION SET 258 User’ s Manual U10676EJ3V0UM MO V mem, A Function: (mem) ← A mem = D 7-0 : 00H to FFH Transfers the contents of the A register to the data memory addressed by 8-bit immediate data mem. MO V mem, XA Function: (mem) ← A, (mem+1) ← X mem = D 7-0 : 00H to FEH Transfers the contents of the A register to the data me[...]

  • Página 259

    CHAPTER 11 INSTRUCTION SET 259 User’ s Manual U10676EJ3V0UM XCH A, @HL Function: A ↔ (HL) Exchanges the contents of the A register with the contents of the data memory addressed by register pair HL. XCH A, @HL+ Function: A ↔ (HL), L ← L+1 skip if L = 0H Exchanges the contents of the A register with the contents of the data memory addressed [...]

  • Página 260

    CHAPTER 11 INSTRUCTION SET 260 User’ s Manual U10676EJ3V0UM XCH XA, @HL Function: A ↔ (HL), X ↔ (HL+1) Exchanges the contents of the A register with the contents of the data memory addressed by register pair HL, and the contents of the X register with the contents of the next address. If the contents of the L register are an odd number, howev[...]

  • Página 261

    CHAPTER 11 INSTRUCTION SET 261 User’ s Manual U10676EJ3V0UM 11.4.2 Table reference instructions MO V XA, @PCDE Function: XA ← ROM (PC 11-8 +DE) Transfers the lower 4 bits of the table data in the program memory addressed when the lower 8 bits (PC 7-0 ) of the program counter (PC) are replaced with the contents of register pair DE, to the A regi[...]

  • Página 262

    CHAPTER 11 INSTRUCTION SET 262 User’ s Manual U10676EJ3V0UM Caution The MOVT XA, @PCDE instruction usually references the table data in page where the instruction exists. If the instruction is at address ×× FFH, however, the table data in the next page is referenced instead of the table data in the page where the instruction exists. 70 02FFH 03[...]

  • Página 263

    CHAPTER 11 INSTRUCTION SET 263 User ’ s Manual U10676EJ3V0UM MO VT XA, @PCXA Function: XA ← ROM (PC 11-8 +XA) Transfers the lower 4 bits of the table data in the program memory addressed when the lower 8 bits (PC 7-0 ) of the program counter (PC) are replaced with the contents of register pair XA, to the A register, and the higher 4 bits to the[...]

  • Página 264

    CHAPTER 11 INSTRUCTION SET 264 User ’ s Manual U10676EJ3V0UM MO VT XA, @BCXA Function: XA ← ROM (BCXA) Transfers the lower 4 bits of the table data (8-bit) in the program memory addressed by the B register and the contents of registers C, X, and A, to the A register, and the higher 4 bits to the X register. However, on the µ PD754244, register[...]

  • Página 265

    CHAPTER 11 INSTRUCTION SET 265 User ’ s Manual U10676EJ3V0UM 11.4.3 Bit transfer instructions MO V1 CY , fmem.bit MO V1 CY , pmem.@L MO V1 CY , @H+mem.bit Function: CY ← (bit specified by operand) Transfers the contents of the data memory addressed in the bit manipulating addressing mode (fmem.bit, pmem.@L, or @H+mem.bit) to the carry flag (CY)[...]

  • Página 266

    CHAPTER 11 INSTRUCTION SET 266 User’ s Manual U10676EJ3V0UM 11.4.4 Operation instructions ADDS A, #n4 Function: A ← A+n4; Skip if carry. n4 = l 3-0 : 0 to FH Adds 4-bit immediate data n4 to the contents of the A register. If a carry occurs as a result, the next instruction is skipped. The carry flag is not affected. If this instruction is used [...]

  • Página 267

    CHAPTER 11 INSTRUCTION SET 267 User’ s Manual U10676EJ3V0UM ADDC A, @HL Function: A, CY ← A+ (HL) +CY Adds the contents of the data memory addressed by register pair HL to the contents of the A register, including the carry flag. If a carry occurs as a result, the carry flag is set; if not, the carry flag is reset. If the ADDS A, #n4 instructio[...]

  • Página 268

    CHAPTER 11 INSTRUCTION SET 268 User’ s Manual U10676EJ3V0UM SUBS XA, rp’ Function: XA ← XA – rp’; Skip if borrow. Subtracts the contents of register pair rp’ (XA, HL, DE, BC, XA’, HL’, DE’, or BC’) from the contents of register pair XA, and sets the result to register pair XA. If a borrow occurs as a result, the next instruction[...]

  • Página 269

    CHAPTER 11 INSTRUCTION SET 269 User’ s Manual U10676EJ3V0UM SUBC rp’1, XA Function: rp’1, CY ← rp’1 – XA – CY Subtracts the contents of register pair XA from the contents of register pair rp’1 (HL, DE, BC, XA’, HL’, DE’, or BC’), including the carry flag, and sets the result to specified register pair rp’1. If a borrow occ[...]

  • Página 270

    CHAPTER 11 INSTRUCTION SET 270 User’ s Manual U10676EJ3V0UM OR A, #n4 Function: A ← A n4 n4 = l 3-0 : 0-FH ORs 4-bit immediate data n4 with the contents of the A register, and sets the result to the A register. Application example To set the lower 3 bits of the accumulator to 1 OR A, #0111B OR A, @HL Function: A ← A (HL) ORs the contents of t[...]

  • Página 271

    CHAPTER 11 INSTRUCTION SET 271 User’ s Manual U10676EJ3V0UM XOR A, @HL Function: A ← A (HL) Exclusive-ORs the contents of the data memory addressed by register pair HL with the contents of the A register, and sets the result to the A register. XOR XA, rp’ Function: XA ← XA rp’ Exclusive-ORs the contents of register pair rp’ (XA, HL, DE,[...]

  • Página 272

    CHAPTER 11 INSTRUCTION SET 272 User’ s Manual U10676EJ3V0UM 11.4.5 Accumulator manipulation instructions R ORC A Function: CY ← A 0 , A n-1 ← A n , A 3 ← CY (n = 1-3) Rotates the contents of the A register (4-bit accumulator) 1 bit to the left with the carry flag. 0 CY 0 3 1 2 0 1 1 0 A Before execution 1 0010 After execution RORC A . . . .[...]

  • Página 273

    CHAPTER 11 INSTRUCTION SET 273 User ’ s Manual U10676EJ3V0UM 11.4.6 Increment/decrement instructions INCS reg Function: reg ← reg+1; Skip if reg = 0 Increments the contents of register reg (X, A, H, L, D, E, B, or C). If reg = 0 as a result, the next instruction is skipped. INCS rp1 Function: rp1 ← rp1+1; Skip if rp1 = 00H Increments the cont[...]

  • Página 274

    CHAPTER 11 INSTRUCTION SET 274 User ’ s Manual U10676EJ3V0UM 11.4.7 Compare instructions SKE reg, #n4 Function: Skip if reg = n4 n4 = I 3-0 : 0-FH Skips the next instruction if the contents of register reg (X, A, H, L, D, E, B, or C) are equal to 4-bit immediate data n4. SKE @HL, #n4 Function: Skip if (HL) = n4 n4 = I 3-0 : 0-FH Skips the next in[...]

  • Página 275

    CHAPTER 11 INSTRUCTION SET 275 User ’ s Manual U10676EJ3V0UM 11.4.8 Carry flag manipulation instructions SET1 CY Function: CY ← 1 Sets the carry flag. CLR1 CY Function: CY ← 0 Clears the carry flag. SKT CY Function: Skip if CY = 1 Skips the next instruction if the carry flag is 1. NO T1 CY Function: CY ← CY Inverts the carry flag. Therefore[...]

  • Página 276

    CHAPTER 11 INSTRUCTION SET 276 User ’ s Manual U10676EJ3V0UM 11.4.9 Memory bit manipulation instructions SET1 mem.bit Function: (mem.bit) ← 1 mem = D 7-0 : 00H to FFH, bit = B 1-0 : 0-3 Sets the bit specified by 2-bit immediate data bit at the address specified by 8-bit immediate data mem. SET1 fmem.bit SET1 pmem.@L SET1 @H+mem.bit Function: (b[...]

  • Página 277

    CHAPTER 11 INSTRUCTION SET 277 User ’ s Manual U10676EJ3V0UM SKT fmem.bit SKT pmem.@L SKT @H+mem.bit Function: Skip if (bit specified by operand) = 1 Skips the next instruction if the bit of the data memory addressed in the bit manipulation addressing mode (fmem.bit, pmem.@L, or @H+mem.bit) is 1. SKF mem.bit Function: Skip if (mem.bit) = 0 mem = [...]

  • Página 278

    CHAPTER 11 INSTRUCTION SET 278 User ’ s Manual U10676EJ3V0UM AND1 CY , fmem.bit AND1 CY , pmem.@L AND1 CY , @H+mem.bit Function: CY ← CY (bit specified by operand) ANDs the content of the carry flag with the contents of the data memory addressed in the bit manipulation addressing mode (fmem.bit, pmem.@L, or @H+mem.bit), and sets the result to t[...]

  • Página 279

    CHAPTER 11 INSTRUCTION SET 279 User ’ s Manual U10676EJ3V0UM 11.4.10 Branch instructions BR addr Function: P C 11-0 ← addr addr = 0000H to 0FFFH Branches to an address specified by immediate data addr. This instruction is an assembler directive and is replaced by the assembler at assembly time with the optimum instruction from the BR !addr, BRC[...]

  • Página 280

    CHAPTER 11 INSTRUCTION SET 280 User’ s Manual U10676EJ3V0UM BR $addr1 Function: P C 11-0 ← addr1 addr1 = (PC–15) to (PC–1), (PC+2) to (PC+16) This is a relative branch instruction that has a branch range of (–15 to –1) and (+2 to +16) from the current address. It is not affected by a page boundary or block boundary. BRCB !caddr Function[...]

  • Página 281

    CHAPTER 11 INSTRUCTION SET 281 User ’ s Manual U10676EJ3V0UM BR PCDE Function: P C 11-0 ← PC 11-8 + DE PC 7-4 ← D, PC 3-0 ← E Branches to an address specified by the lower 8 bits of the program counter (PC 7-0 ) replaced with the contents of register pair DE. The higher bits of the program counter are not affected. Caution The BR PCDE instr[...]

  • Página 282

    CHAPTER 11 INSTRUCTION SET 282 User ’ s Manual U10676EJ3V0UM BR BCDE Function: P C 11-0 ← BCDE Example To branch to an address specified by the contents of the program counter replaced by the contents of registers B, C, D, and E However, the PC of the µ PD754244 is 12 bits. The contents of PC are replaced by the contents of registers C, D and [...]

  • Página 283

    CHAPTER 11 INSTRUCTION SET 283 User ’ s Manual U10676EJ3V0UM 11.4.11 Subroutine/stack control instructions CALLA !addr1 Function: (SP – 2) ← × , × , MBE, RBE, (SP – 3) ← PC 7-4 (SP – 4) ← PC 3-0 , (SP – 5) ← 0, 0, 0, 0 (SP – 6) ← PC 11-8 PC 11-0 ← addr1, SP ← SP – 6 CALL !addr Function: [MkI mode] (SP – 1) ← PC 7-4[...]

  • Página 284

    CHAPTER 11 INSTRUCTION SET 284 User ’ s Manual U10676EJ3V0UM CALLF !faddr Function: [MkI mode] (SP – 1) ← PC 7-4 , (SP – 2) ← PC 3-0 (SP – 3) ← MBE, RBE, 0, 0 (SP – 4) ← PC 11-8 , SP ← SP – 4 PC 11-0 ← 0+faddr faddr = 0000H to 07FFH [MkII mode] (SP – 2) ← × , × , MBE, RBE (SP – 3) ← PC 7-4 , (SP – 4) ← PC 3-0 ([...]

  • Página 285

    CHAPTER 11 INSTRUCTION SET 285 User’ s Manual U10676EJ3V0UM RET Function: [MkI mode] PC 11-8 ← (SP), MBE, RBE, 0, 0 ← (SP+1) PC 3-0 ← (SP+2) PC 7-4 ← (SP+3), SP ← SP+4 [MkII mode] PC 11-8 ← (SP), 0, 0, 0, 0 ← (SP+1) PC 3-0 ← (SP+2), PC 7-4 ← (SP+3) × , × , MBE, RBE ← (SP+4), SP ← SP+6 Restores the contents of the data memo[...]

  • Página 286

    CHAPTER 11 INSTRUCTION SET 286 User ’ s Manual U10676EJ3V0UM PUSH rp Function: (SP – 1) ← rp H , (SP – 2) ← rp L , SP ← SP – 2 Saves the contents of register pair rp (XA, HL, DE, or BC) to the data memory (stack) addressed by the stack pointer (SP), and then decrements the contents of the SP. The higher 4 bits of the register pair (rp[...]

  • Página 287

    CHAPTER 11 INSTRUCTION SET 287 User ’ s Manual U10676EJ3V0UM 11.4.12 Interrupt control instructions EI Function: IME (IPS.3) ← 1 Sets the interrupt mask enable flag (bit 3 of the interrupt priority select register) to “ 1 ” to enable interrupts. Acknowledging an interrupt is controlled by an interrupt enable flag corresponding to the interr[...]

  • Página 288

    CHAPTER 11 INSTRUCTION SET 288 User’ s Manual U10676EJ3V0UM 11.4.13 Input/output instructions IN A, PORTn Function: A ← PORTn n = N 3-0 : 3, 6, 7, 8 Transfers the contents of a port specified by PORTn (n = 3, 6, 7, 8) to the A register. Caution When this instruction is executed, it is necessary that MBE = 0 or (MBE = 1, MBS = 15). n can be 3, 6[...]

  • Página 289

    CHAPTER 11 INSTRUCTION SET 289 User’ s Manual U10676EJ3V0UM 11.4.14 CPU control instruction HAL T Function: PCC.2 ← 1 Sets the HALT mode (this instruction sets the bit 2 of the processor clock control register). Caution Make sure that a NOP instruction follows the HALT instruction. ST OP Function: PCC.3 ← 1 Sets the STOP mode (this instructio[...]

  • Página 290

    CHAPTER 11 INSTRUCTION SET 290 User ’ s Manual U10676EJ3V0UM 11.4.15 Special instructions SEL RBn Function: RBS ← n n = N 1-0 : 0-3 Sets 2-bit immediate data n to the register bank select register (RBS). SEL MBn Function: MBS ← n n = N 3-0 : 0, 4, 15 Transfers 4-bit immediate data n to the memory bank select register (MBS). GETI taddr Functio[...]

  • Página 291

    CHAPTER 11 INSTRUCTION SET 291 User’ s Manual U10676EJ3V0UM References the 2-byte data at the program memory address specified by (taddr), (taddr+1) and executes it as an instruction. The area of the reference table consists of addresses 0020H to 007FH. Data must be written to this area in advance. Write the mnemonic of a 1-byte or 2-byte instruc[...]

  • Página 292

    CHAPTER 11 INSTRUCTION SET 292 User ’ s Manual U10676EJ3V0UM Replaced by GETI ......... ......... ......... ......... Application example MOV HL, #00H MOV XA, #FFH CALL SUB1 BR SUB2 ORG 20H HL00: MOV HL, #00H XAFF: MOV XA, #FFH CSUB1: TCALL S UB1 BSUB2: TBR SUB2 GETI HL00 ; MOV HL, #00H GETI BSUB2 ; BR SUB2 GETI CSUB1 ; CALL SUB1 GETI XAFF ; MOV [...]

  • Página 293

    293 User’ s Manual U10676EJ3V0UM APPENDIX A DEVELOPMENT TOOLS The following development tools are available to support development of systems using the µ PD754244. With the 75XL Series, a relocatable assembler that can be used in common with any model in the series is used in combination with a device file dedicated to the model being used. Lang[...]

  • Página 294

    APPENDIX A DEVELOPMENT TOOLS 294 User’ s Manual U10676EJ3V0UM EV-9500GS-20 EV-9501GS-20 Debugging Tools In-circuit emulators (IE-75000-R and IE-75001-R) are available as the debugging tools for the µ PD754244. The following table shows the system configuration of the in-circuit emulators. Hardware Order code IBM PC/AT or compat- ible machine Ref[...]

  • Página 295

    APPENDIX A DEVELOPMENT TOOLS 295 User’ s Manual U10676EJ3V0UM OS of IBM PC The following OSs are supported as the OS for IBM PCs. OS Version PC DOS TM Ver.5.02 to Ver.6.3 J6.1/V Note to J6.3/V Note MS-DOS Ver.5.0 to Ver.6.22 5.0/V Note to 6.2/V Note IBM DOS TM J5.02/V Note Note Only the English mode is supported. Caution Although Ver.5.00 or abov[...]

  • Página 296

    APPENDIX A DEVELOPMENT TOOLS 296 User’ s Manual U10676EJ3V0UM Development Tool Configuration In-circuit emulator IE-75000-R or IE-75001-R Emulation board IE-75300-R-EM Note 1 IE control program Host machine PC-9800 series lBM PC/AT [Symbolic debugging possible] Relocatable assembler + Device file RS-232-C Emulation probe EP-754144GS Target system[...]

  • Página 297

    297 User’ s Manual U10676EJ3V0UM APPENDIX B ORDERING MASK ROM After your program has been developed, you can place an order for mask ROM using the following procedure. <1> Reservation for mask ROM ordering Inform NEC Electronics of when you intend to place an order for the mask ROM. (NEC’s response may be delayed if we are not informed in[...]

  • Página 298

    298 User’ s Manual U10676EJ3V0UM APPENDIX C INSTRUCTION INDEX C.1 Instruction Index (By Function) [Table reference instruction] MOVT XA, @PCDE ... 243, 261 MOVT XA, @PCXA ... 243, 263 MOVT XA, @BCDE ... 243, 263 MOVT XA, @BCXA ... 243, 264 [Bit transfer instruction] MOV1 CY, fmem.bit ... 243, 265 MOV1 CY, pmem.@L ... 243, 265 MOV1 CY, @H+mem.bit [...]

  • Página 299

    APPENDIX C INSTRUCTION INDEX 299 User’ s Manual U10676EJ3V0UM AND A, @HL ... 243, 269 AND XA, rp' ... 243, 269 AND rp'1, XA ... 243, 269 OR A, #n4 ... 243, 270 OR A, @HL ... 243, 270 OR XA, rp' ... 243, 270 OR rp'1, XA ... 243, 270 XOR A, #n4 ... 243, 270 XOR A, @HL ... 243, 271 XOR XA, rp' ... 243, 271 XOR rp'1, XA [...]

  • Página 300

    APPENDIX C INSTRUCTION INDEX 300 User’ s Manual U10676EJ3V0UM BR PCXA ... 245, 281 BR BCDE ... 245, 282 BR BCXA ... 245, 282 BRA !addr1 ... 245, 279 BRCB !caddr ... 245, 280 TBR addr ... 247, 282 [Subroutine/stack control instruction] CALLA !addr1 ... 246, 283 CALL !addr ... 246, 283 CALLF !faddr ... 246, 284 TCALL !addr ... 247, 284 RET ... 246,[...]

  • Página 301

    APPENDIX C INSTRUCTION INDEX 301 User’ s Manual U10676EJ3V0UM C.2 Instruction Index (Alphabetical Order) [A] ADDC A, @HL ... 243, 267 ADDC rp'1, XA ... 243, 267 ADDC XA, rp' ... 243, 267 ADDS A, #n4 ... 243, 266 ADDS A, @HL ... 243, 266 ADDS rp'1, XA ... 243, 266 ADDS XA, rp' ... 243, 266 ADDS XA, #n8 ... 243, 266 AND A, #n4 .[...]

  • Página 302

    APPENDIX C INSTRUCTION INDEX 302 User’ s Manual U10676EJ3V0UM MOV A, @rpa1 ... 242, 256 MOV HL, #n8 ... 242, 255 MOV mem, A ... 242, 258 MOV mem, XA ... 242, 258 MOV reg1, A ... 242, 258 MOV reg1, #n4 ... 242, 255 MOV rp'1, XA ... 242, 258 MOV rp2, #n8 ... 242, 255 MOV XA, mem ... 242, 257 MOV XA, rp' ... 242, 258 MOV XA, #n8 ... 242, 2[...]

  • Página 303

    APPENDIX C INSTRUCTION INDEX 303 User’ s Manual U10676EJ3V0UM SKT @H+mem.bit ... 244, 277 SKTCLR fmem.bit ... 244, 277 SKTCLR pmem.@L ... 244, 277 SKTCLR @H+mem.bit ... 244, 277 STOP ... 247, 289 SUBC A, @HL ... 243, 268 SUBC rp'1, XA ... 243, 268 SUBC XA, rp' ... 243, 268 SUBS A, @HL ... 243, 267 SUBS rp'1, XA ... 243, 268 SUBS XA[...]

  • Página 304

    304 User’ s Manual U10676EJ3V0UM APPENDIX D HARDWARE INDEX [B] BS ... 78 BSB0 to BSB3 ... 184 BT ... 114 BTM ... 115 [C] CY ... 74 [E] ERE ... 81 EWC ... 81 EWE ... 81 EWST ... 81 EWTC4 to EWTC6 ... 81 [I] IE0 ... 190 IE2 ... 212 IEBT ... 190 IEEE ... 82, 190 IET0 ... 190 IET1 ... 190 IET2 ... 190 IM0 ... 195 IM2 ... 214 IME ... 192 INTA ... 55 I[...]

  • Página 305

    APPENDIX D HARDWARE INDEX 305 User’ s Manual U10676EJ3V0UM [S] SBS ... 61, 70 SK0 to SK2 ... 75 SP ... 70 [T] T0, T1 ... 54 T2 ... 53 TC2 ... 133, 138 TM0 ... 127 TM1 ... 128 TM2 ... 130 TMOD0, TMOD1 ... 54 TMOD2 ... 53 TMOD2H ... 52 TOE0, TOE1 ... 132 TOE2 ... 133 [W] WDF ... 231 WDTM ... 117[...]

  • Página 306

    306 User’ s Manual U10676EJ3V0UM APPENDIX E REVISION HISTORY The revision history is shown below. “Location” indicates the corresponding chapters in the preceding edition. Edition Description Location 2nd edition Change of representative model from µ PD754144 to µ PD754244 Throughout Change of EEPROM write time and number of write operation[...]