Samsung 8-Bit CMOS Microcontroller manuel d'utilisation

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

Aller à la page of

Un bon manuel d’utilisation

Les règles imposent au revendeur l'obligation de fournir à l'acheteur, avec des marchandises, le manuel d’utilisation Samsung 8-Bit CMOS Microcontroller. Le manque du manuel d’utilisation ou les informations incorrectes fournies au consommateur sont à la base d'une plainte pour non-conformité du dispositif avec le contrat. Conformément à la loi, l’inclusion du manuel d’utilisation sous une forme autre que le papier est autorisée, ce qui est souvent utilisé récemment, en incluant la forme graphique ou électronique du manuel Samsung 8-Bit CMOS Microcontroller ou les vidéos d'instruction pour les utilisateurs. La condition est son caractère lisible et compréhensible.

Qu'est ce que le manuel d’utilisation?

Le mot vient du latin "Instructio", à savoir organiser. Ainsi, le manuel d’utilisation Samsung 8-Bit CMOS Microcontroller décrit les étapes de la procédure. Le but du manuel d’utilisation est d’instruire, de faciliter le démarrage, l'utilisation de l'équipement ou l'exécution des actions spécifiques. Le manuel d’utilisation est une collection d'informations sur l'objet/service, une indice.

Malheureusement, peu d'utilisateurs prennent le temps de lire le manuel d’utilisation, et un bon manuel permet non seulement d’apprendre à connaître un certain nombre de fonctionnalités supplémentaires du dispositif acheté, mais aussi éviter la majorité des défaillances.

Donc, ce qui devrait contenir le manuel parfait?

Tout d'abord, le manuel d’utilisation Samsung 8-Bit CMOS Microcontroller devrait contenir:
- informations sur les caractéristiques techniques du dispositif Samsung 8-Bit CMOS Microcontroller
- nom du fabricant et année de fabrication Samsung 8-Bit CMOS Microcontroller
- instructions d'utilisation, de réglage et d’entretien de l'équipement Samsung 8-Bit CMOS Microcontroller
- signes de sécurité et attestations confirmant la conformité avec les normes pertinentes

Pourquoi nous ne lisons pas les manuels d’utilisation?

Habituellement, cela est dû au manque de temps et de certitude quant à la fonctionnalité spécifique de l'équipement acheté. Malheureusement, la connexion et le démarrage Samsung 8-Bit CMOS Microcontroller ne suffisent pas. Le manuel d’utilisation contient un certain nombre de lignes directrices concernant les fonctionnalités spécifiques, la sécurité, les méthodes d'entretien (même les moyens qui doivent être utilisés), les défauts possibles Samsung 8-Bit CMOS Microcontroller et les moyens de résoudre des problèmes communs lors de l'utilisation. Enfin, le manuel contient les coordonnées du service Samsung en l'absence de l'efficacité des solutions proposées. Actuellement, les manuels d’utilisation sous la forme d'animations intéressantes et de vidéos pédagogiques qui sont meilleurs que la brochure, sont très populaires. Ce type de manuel permet à l'utilisateur de voir toute la vidéo d'instruction sans sauter les spécifications et les descriptions techniques compliquées Samsung 8-Bit CMOS Microcontroller, comme c’est le cas pour la version papier.

Pourquoi lire le manuel d’utilisation?

Tout d'abord, il contient la réponse sur la structure, les possibilités du dispositif Samsung 8-Bit CMOS Microcontroller, l'utilisation de divers accessoires et une gamme d'informations pour profiter pleinement de toutes les fonctionnalités et commodités.

Après un achat réussi de l’équipement/dispositif, prenez un moment pour vous familiariser avec toutes les parties du manuel d'utilisation Samsung 8-Bit CMOS Microcontroller. À l'heure actuelle, ils sont soigneusement préparés et traduits pour qu'ils soient non seulement compréhensibles pour les utilisateurs, mais pour qu’ils remplissent leur fonction de base de l'information et d’aide.

Table des matières du manuel d’utilisation

  • Page 1

    21 - S3 - C9228/P9228-112002 USER'S M ANUAL S3C9228/P9228 8 -Bit CMOS Microcontroller Revision 1[...]

  • Page 2

    S3C9228/P9228 8-BIT CMOS MICROCONTROLLER S USER'S MANUAL Revision 1[...]

  • Page 3

    Important Notice The information in this publication has been carefully checked and is believed to be entirely accurate at the time of publication. Samsung assumes no responsibility, however, for possible errors or omissions, or for any consequences resulting from the use of the information contained herein. Samsung reserves the right to make chang[...]

  • Page 4

    S3C9228/P9228 MICROCONTROLLER S iii Preface The S3C9228/P9228 Microcontroller s User's Manual is designed for application designers and programmers who are using the S3C9228/P9228 microcontroller s for application development. It is organized in two main parts: Part I Programming Model Part II Hardware Descriptions Part I contains software-rel[...]

  • Page 5

    [...]

  • Page 6

    S3C9228/P9228 MICROCONTROLLER S v Table of Contents Part I — Programming Model Chapter 1 Product Overview SAM88RCRI Product Family ................................................................................................................... 1-1 S3C9228/P9228 Microcontroller ...................................................................[...]

  • Page 7

    vi S3C9228/P9228 MICROCONTROLLER S Table of Contents (Cont inued ) Chapter 4 Control Registers Overview ................................................................................................................................................. 4-1 Chapter 5 Interrupt Structure Overview .........................................................[...]

  • Page 8

    S3C9228/P9228 MICROCONTROLLER S vii Table of Contents (Cont inued ) Part II — Hardware Descriptions Chapter 7 Clock Circui t Overview ................................................................................................................................................. 7-1 System Clock Circuit ...........................................[...]

  • Page 9

    viii S3C9228/P9228 MICROCONTROLLER S Table of Contents (Con tinued ) Chapter 11 Timer 1 One 16-Bit Timer Mode (Timer 1) ............................................................................................................ 11-1 Overview ...........................................................................................................[...]

  • Page 10

    S3C9228/P9228 MICROCONTROLLER S ix Table of Contents (Con cluded ) Chapter 1 6 Electrical Data Overview ................................................................................................................................................. 16-1 Chapter 1 7 Mechanical Data Overview ..........................................................[...]

  • Page 11

    [...]

  • Page 12

    S3C9228/P9228 MICROCONTROLLER S xi List of Figures Figure Title Page Number Number 1-1 Block Diagram .................................................................................................................... 1-3 1-2 S3C9228 44-QFP Pin Assignments .................................................................................... 1-4 1-3 [...]

  • Page 13

    xii S3C9228/P9228 MICROCONTROLLER S List of Figures (Cont inued ) Figure Title Page Number Number 5-1 S3C9-Series Interrupt Type ................................................................................................ 5-1 5-2 Interrupt Function Diagram .........................................................................................[...]

  • Page 14

    S3C9228/P9228 MICROCONTROLLER S xiii List of Figures (Con tinued ) Figure Title Page Number Number 10-1 Basic Timer Control Register (BTCON) .............................................................................. 10-2 10-2 Basic Timer Block Diagram ..............................................................................................[...]

  • Page 15

    xiv S3C9228/P9228 MICROCONTROLLER S List of Figures (Con cluded ) Figure Title Page Number Number 16-1 Stop Mode Release Timing When Initiated by an External Interrupt .................................... 16-5 16-2 Stop Mode Release Timing When Initiated by a RESET ..................................................... 16-6 16-3 Input Timing for Ext[...]

  • Page 16

    S3C9228/P9228 MICROCONTROLLER S xv List of Tables Table Title Page Number Number 1-1 Pin Descriptions ................................................................................................................. 1-6 6-1 Instruction Group Summary ................................................................................................ 6-2[...]

  • Page 17

    [...]

  • Page 18

    S3C9228/P9228 MICROCONTROLLER S xvii List of Programming Tips Description Page Number Chapter 2: Address Spaces Addressing the Common Working Register Area ..................................................................................... 2-4 Standard Stack Operations Using PUSH and POP ...........................................................[...]

  • Page 19

    [...]

  • Page 20

    S3C9228/P9228 MICROCONTROLLER S xix List of Register Descriptions Register Full Register Name Page Identifier Number ADCON A/D Converter Co ntrol Register .............................................................................. 4-5 BTCON Basic Timer Control Register .............................................................................[...]

  • Page 21

    [...]

  • Page 22

    S3C9228/P9228 MICROCONTROLLER S xxi List of Instruction Descriptions Instruction Full Instruction Name Page Mnemonic Number ADC Add With Carry ...................................................................................................... 6 - 11 ADD Add .........................................................................................[...]

  • Page 23

    S3C9228/P9228 PRODUCT OVERVIEW 1- 1 1 PRODUCT OVERVIEW SAM8 8RC RI PRODUCT FAMILY Samsung's SAM88RCRI family of 8-bit single-chi p CMOS microcontrollers offer fast and efficient CPU, a wide range of integrated peripherals, and supports OTP device . A dual address/data bus architecture and bit- or nibble-configurable I/O ports provide a flexibl[...]

  • Page 24

    PRODUCT OVERVIEW S3C9228/P9228 1- 2 FEATURES CPU • SAM88RCRI CPU core Memory • 8192 × 8 bits program memory (ROM) • 264 × 8 bits data memory (RAM) (Including LCD data memory) Instruction Set • 41 instructions • Idle and Stop instructions added for power-down modes 36 I/O Pins • I/O: 34 pins (44-pin QFP, 42-pin SDIP) • Output only: 2[...]

  • Page 25

    S3C9228/P9228 PRODUCT OVERVIEW 1- 3 BLOCK DIAGRAM 8-Bit Timer/ CounterA Port I/O and Interrupt Control SAM88RCRI CPU RESET X IN XT IN I/O Port 0 8-Kbyte ROM 264-Byte Register File X OUT XT OUT 16-Bit Timer/ Counter1 8-Bit Timer/ CounterB TAOUT/ P0.0 T1CLK/ P0.1 P0.0/TAOUT/INT P0.1/T1CLK/INT P0.2/INT P0.3/BUZ/INT P0.4 P0.5 I/O Port 1 P1.0/AD0/INT P1[...]

  • Page 26

    PRODUCT OVERVIEW S3C9228/P9228 1- 4 PIN ASSIGNMENTS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 S3C9228 (44-QFP) P1.0/AD0/INT P1.1/AD1/INT P1.2/AD2/INT P1.3/AD3/INT V DD V SS X OUT X IN TEST XT IN XT OUT RESET P2.3 P2.2/SI SEG0/P2.1/SO SEG1/P2.0/SCK SEG2/P3.1/INTP SEG3/P3.0/INTP SEG4/P4.0 SEG5/P4.1 SEG6/P4.2 SEG7/P4.3 33 32 31 30 29 28[...]

  • Page 27

    S3C9228/P9228 PRODUCT OVERVIEW 1- 5 COM1/P6.2 COM0/P6.3 P0.0/TAOUT/INT P0.1/T1CLK/INT P0.2/INT P0.3/BUZ/INT P1.0/AD0/INT P1.1/AD1/INT P1.2/AD2/INT P1.3/AD3/INT V DD V SS X OUT X IN TEST XT IN XT OUT RESET P2.3 P2.2/SI SEG0/P2.1/SO S3C9228 (42-SDIP) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 COM2/P6.1 COM3/P6.0 COM4/SEG19/P5.7 COM5/SEG18/[...]

  • Page 28

    PRODUCT OVERVIEW S3C9228/P9228 1- 6 PIN DESCRIPTIONS Table 1- 1 . Pin Descriptions Pin Names Pin Type Pin Description Circuit Number Pin Numbers Share Pins P0.0 P0.1 P0.2 P0.3 I/O 1-bit programmable I/O port. Schmitt trigger input or push-pull, open-drain output and software assignable pull-ups. E-4 39(3) 40(4) 41(5) 42(6) TAOUT/INT T1CLK/INT INT B[...]

  • Page 29

    S3C9228/P9228 PRODUCT OVERVIEW 1- 7 Table 1- 1 . Pin Descriptions (Continued) Pin Names Pin Type Pin Description Circuit Number Pin Numbers Share Pins V DD , V SS – Power input pins for internal power block – 5,6(11,12) – X OUT , X IN – Main oscillator pins for main clock – 7,8(13,14) XT OUT , XT IN – Sub oscillator pins for sub clock ?[...]

  • Page 30

    PRODUCT OVERVIEW S3C9228/P9228 1- 8 PIN CIRCUIT DIAGRAMS RESET V DD Pull-Up Resistor Noise Filter Figure 1-4. Pin Circuit Type B V DD Output Output Disable Data V SS Figure 1-5. Pin Circuit Type C[...]

  • Page 31

    S3C9228/P9228 PRODUCT OVERVIEW 1- 9 V DD Pull-up Enable V DD I/O Pull-up Resistor Output Disable Data External Interrupt Input Open-Drain Figure 1-7. Pin Circuit Type E-4 V DD I/O Pull-up Resistor Circuit Type E To ADC Data ADEN ADSELECT Open-Drain EN Data Output Disable Pull-up Enable Figure 1-8. Pin Circuit Type F-16A[...]

  • Page 32

    PRODUCT OVERVIEW S3C9228/P9228 1- 10 Out SEG/COM V LC3 Output Disable V LC2 V LC1 V SS V LC4 V LC5 Figure 1-9. Pin Circuit Type H-23[...]

  • Page 33

    S3C9228/P9228 PRODUCT OVERVIEW 1- 11 V DD Pull-up Enable V DD I/O Pull-up Resistor Data Open-Drain EN Circuit Type H-23 LCD Out EN COM/SEG Output Disable Figure 1-10. Pin Circuit Type H-32 V DD Pull-up Enable V DD I/O Pull-up Resistor Data Open-Drain EN Circuit Type H-23 LCD Out EN COM/SEG Output Disable Figure 1-11. Pin Circuit Type H-32A[...]

  • Page 34

    PRODUCT OVERVIEW S3C9228/P9228 1- 12 V DD Pull-up Enable V DD I/O Pull-up Resistor Data Open-Drain EN Circuit Type H-23 LCD Out EN COM/SEG Output Disable Port Enable (LMOD.5) Figure 1-12. Pin Circuit Type H-32B[...]

  • Page 35

    S3C9228/P9228 ADDRESS SPACES 2- 1 2 ADDRESS SPACES OVERVIEW The S3C9228/P9228 microcontroller has three kinds of address space: — Program memory (ROM) — Internal register file — LCD display register file A 16 -bit address bus supports program memory operations. Special instructions and related internal logic determine when the 1 6 -bit bus ca[...]

  • Page 36

    ADDRESS SPACES S3C9228/P9228 2- 2 PROGRAM MEMORY (ROM) Program memory (ROM) stores program code or table data. The S3C9228 has 8K bytes of mask- programable program memory. The program memory address range is therefore 0H-1FFFH. The first 2 bytes of the ROM (0000H– 0001H) are an interrupt vector address. The program reset address in the ROM is 01[...]

  • Page 37

    S3C9228/P9228 ADDRESS SPACES 2- 3 REGISTER ARCHITECTURE The upper 72 bytes of the S3C9228/P9228 's internal register file are addressed as working registers, system cont r ol registe r s and periphe r al control registers. The lower 184 bytes of internal register file (00H– B7 H) is called the general purpose register space . For many SAM88R[...]

  • Page 38

    ADDRESS SPACES S3C9228/P9228 2- 4 COMMON WORKING REGISTER AREA (C0H–CFH) The SAM88RCR I register architecture provides an efficient method of working register addressing that takes full advantage of shorter instruction formats to reduce execution time. This16-byte address range is called common area. That is, locations in this area can be used as[...]

  • Page 39

    S3C9228/P9228 ADDRESS SPACES 2- 5 SYSTEM STACK S 3C9 -series microcontrollers use the system stack for subroutine calls and returns and to store data. The PUSH and POP instructions are used to control system stack operations. The S3C9228/P9228 architecture supports stack operations in the internal register file. STACK OPERATIONS Return addresses fo[...]

  • Page 40

    ADDRESS SPACES S3C9228/P9228 2- 6 + + PROGRAMMING TIP — Standard Stack Operations Using PUSH and POP The following example shows you how to perform stack operations in the internal register file using PUSH and POP instructions: LD SP,#0 B8 H ; SP ← B8 H (Normally, the SP is set to 0 B8 H by the ; initialization routine) • • • PUSH SYM ; S[...]

  • Page 41

    S3C9228/P9228 ADDRESSING MODES 3- 1 3 ADDRESSING MODES OVERVIEW Instructions that are stored in program memory are fetched for execution using the program counter. Instructions indicate the operation to be performed and the data to be operated on. Addressing mode is the method used to determine the location of the data operand. The operands specifi[...]

  • Page 42

    ADDRESSING MODES S3C9228/P9228 3- 2 REGISTER ADDRESSING MODE (R) In Register addressing mode, the operand is the content of a specified register (see Figure 3- 1). Working register addressing differs from Register a ddressing because it uses a 16- byte working register s pace in the register file and a 4-bit register within that space (see Figure 3[...]

  • Page 43

    S3C9228/P9228 ADDRESSING MODES 3- 3 INDIRECT REGISTER ADDRESSING MODE (IR) In Indirect Register (IR) addressing mode, the content of the specified register or register pair is the address of the operand. Depending on the instruction used, the actual address may point to a register in the register file, to program memory (ROM), or to an external mem[...]

  • Page 44

    ADDRESSING MODES S3C9228/P9228 3- 4 INDIRECT REGISTER ADDRESSING MODE ( C ontinued ) dst OPCODE PAIR Points to Rigister Pair Example Instruction References Program Memory Sample Instructions: CALL @RR2 JP @RR2 Program Memory Register File Value used in Instruction OPERAND REGISTER Program Memory 16-Bit Address Points to Program Memory Figure 3- 4 .[...]

  • Page 45

    S3C9228/P9228 ADDRESSING MODES 3- 5 INDIRECT REGISTER ADDRESSING MODE (C ontinued ) dst OPCODE OPERAND 4-Bit Working Register Address Point to the Woking Register (1 of 16) Sample Instruction: OR R6, @R2 Program Memory Register File src 4 LSBs Value used in Instruction OPERAND CFH C0H . . . . Figure 3- 5 . Indirect Working Register Addressing to Re[...]

  • Page 46

    ADDRESSING MODES S3C9228/P9228 3- 6 INDIRECT REGISTER ADDRESSING MODE (C oncluded ) dst OPCODE 4-Bit Working Register Address Sample Instructions: LCD R5,@RR6 ; Program memory access LDE R3,@RR14 ; External data memory access LDE @RR4, R8 ; External data memory access Program Memory Register File src Value used in Instruction OPERAND Example Instru[...]

  • Page 47

    S3C9228/P9228 ADDRESSING MODES 3- 7 INDEXED ADDRESSING MODE (X) Indexed (X) addressing mode adds an offset value to a base address during instruction execution in order to calculate the effective operand address (see Figure 3- 7). You can use Indexed addressing mode to access locations in the internal register file or in external memory. In short o[...]

  • Page 48

    ADDRESSING MODES S3C9228/P9228 3- 8 INDEXED ADDRESSING MODE (C ontinued ) Point to Working Register Pair (1 of 8) LSB Selects 16-Bit address added to offset dst OPCODE Program Memory XS (OFFSET) 4-Bit Working Register Address Sample Instructions: LDC R4, #04H[RR2] ; The values in the program address (RR2 + #04H) are loaded into register R4. LDE R4,[...]

  • Page 49

    S3C9228/P9228 ADDRESSING MODES 3- 9 INDEXED ADDRESSING MODE (C oncluded ) Point to Working Register Pair (1 of 8) LSB Selects 16-Bit address added to offset Program Memory 4-Bit Working Register Address Sample Instructions: LDC R4, #1000H[RR2] ; The values in the program address (RR2 + #1000H) are loaded into register R4. LDE R4, #1000H[RR2] ; Iden[...]

  • Page 50

    ADDRESSING MODES S3C9228/P9228 3- 10 DIRECT ADDRESS MODE (DA) In Direct Address (DA) mode, the instruction provides the operand's 16-bit memory address. Jump (JP) and Call (CALL) instructions use this addressing mode to specify the 16-bit destination address that is loaded into the PC whenever a JP or CALL instruction is executed. The LDC and [...]

  • Page 51

    S3C9228/P9228 ADDRESSING MODES 3- 11 DIRECT ADDRESS MODE (C ontinued ) OPCODE Program Memory Upper Address Byte Program Memory Address Used Lower Address Byte Sample Instructions: JP C,JOB1 ; Where JOB1 is a 16-bit immediate address CALL DISPLAY ; Where DISPLAY is a 16-bit immediate address Next OPCODE Figure 3- 11 . Direct Addressing for Call and [...]

  • Page 52

    ADDRESSING MODES S3C9228/P9228 3- 12 RELATIVE ADDRESS MODE (RA) In Relative Address (RA) mode, a two's-complement signed displacement between – 128 and + 127 is specified in the instruction. The displacement value is then added to the current PC value. The result is the address of the next instruction to be executed. Before this addition occ[...]

  • Page 53

    S3C9228/P9228 CONTROL REGISTERS 4- 1 4 CONTROL REGISTERS OVERVIEW In this section, detailed descriptions of the S3C9228/P9228 control registers are presented in an easy-to-read format. These descriptions will help familiarize you with the mapped locations in the register file. You can also use them as a quick-reference source when writing applicati[...]

  • Page 54

    CONTROL REGISTERS S3C9228/P9228 4- 2 Table 4-1. Sys tem and Peripheral C ontrol Registers (Page 0) Register Name Mnemonic Address (Page 0) R/W Decimal Hex Port 0 Control Register P0CON 235 EBH R/W Port 0 Pull-up Resistor Enable Register P0PUR 236 ECH R/W Port 0 Interrupt Control Register P0INT 237 EDH R/W Port 0 Interrupt Edge Selection Register P0[...]

  • Page 55

    S3C9228/P9228 CONTROL REGISTERS 4- 3 Table 4- 1. Sys tem and Peripheral C ontrol Registers (Page 0) Register Name Mnemonic Address (Page 0) R/W Decimal Hex Locations D8H-B9H are not mapped. Timer B Control Register TBCON 202 BAH R/W Timer 1/A Control Register TACON 203 BBH R/W Timer B Data Register TBDATA 204 BCH R/W Timer A Data Register TADATA 20[...]

  • Page 56

    CONTROL REGISTERS S3C9228/P9228 4- 4 FLAGS - System Flags Register .7 .6 .5 Bit Identifier RESET RESET Value Read/Write R = Read-only W = Write-only R/W = Read/write ' - ' = Not used Bit number: MSB = Bit 7 LSB = Bit 0 Addressing mode or modes you can use to modify register values Description of the effect of specific bit settings RESET v[...]

  • Page 57

    S3C9228/P9228 CONTROL REGISTERS 4- 5 AD C ON — A/D Converter Co ntrol Register D 0 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––000000 Read/Write – – R/W R/W R R/W R/W R/W .7-.6 Not used for the S3C9228/P9228 .5- . 4 A/D Input Pin Selection Bits 0 0 AD0 (P1.0) 0 1 AD1 (P1.1) 1 0 AD2 (P1.2) 1 1 AD3 (P1.3) .3 End of Conversi[...]

  • Page 58

    CONTROL REGISTERS S3C9228/P9228 4- 6 BTC ON — Basic Timer Co ntrol Register DCH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7- .4 Watchdog Timer En able Bits 1010 Disable watchdog function Any other value Enable watchdog function .3- .2 Basic Timer Input Clock Selection Bits 0 0 f [...]

  • Page 59

    S3C9228/P9228 CONTROL REGISTERS 4- 7 CLKCON — System Clock Control Register D4H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 Oscillator IRQ Wake-up Function Bit 0 Enable IRQ for main or sub oscillator wake-up in power down mode 1 Disable IRQ for main or sub oscillator wake-up in p[...]

  • Page 60

    CONTROL REGISTERS S3C9228/P9228 4- 8 FLAGS — System Flags Register D5H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value xxxx –––– Read/Write R/W R/W R/W R/W –––– .7 Carry Flag (C) 0 Operation does not generate a carry or borrow condition .6 Zero Flag (Z) 0 Operation result is a non-zero value 1 Operation result is zero .5 [...]

  • Page 61

    S3C9228/P9228 CONTROL REGISTERS 4- 9 INTPND1 — Interrupt Pending Register 1 D6 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 P1.3's Interrupt Pending Bit 0 No interrupt pending (when read), clear pending bit (when write) 1 Interrupt is pending (when read) .6 P1.2's Inte[...]

  • Page 62

    CONTROL REGISTERS S3C9228/P9228 4- 10 INTPND2 — Interrupt Pending Register 2 D7 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––000000 Read/Write – – R/W R/W R/W R/W R/W R/W .7 -.6 Not used for S3C9228/P9228 . 5 P3.1 (INTP) Interrupt Pending Bit 0 No interrupt pending (when read), clear pending bit (when write) 1 Interrupt is[...]

  • Page 63

    S3C9228/P9228 CONTROL REGISTERS 4- 11 LMOD — LCD Mode Control Register FE H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value –0000000 Read/Write – R/W R/W R/W R/W R/W R/W R/W .7 Not used for S3C9228/P9228 .6 COM Pins High Impedance Control Bit 0 Normal COMs signal output 1 COM pins are at high impedance .5 Port3 High Impedance Control[...]

  • Page 64

    CONTROL REGISTERS S3C9228/P9228 4- 12 LPOT — LCD Port Control Register D8 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value –0000000 Read/Write – R/W R/W R/W R/W R/W R/W R/W .7 Not used for S3C9228/P9228 .6-.4 SEG4-SEG19 and COM0-COM3 Selection Bit SEG4-7 SEG8-11 SEG12-15 SEG16-19/ COM7-COM4 COM0-3 P4.0-P4.3 P4.4-P4.7 P5.0-P5.3 P5.4-[...]

  • Page 65

    S3C9228/P9228 CONTROL REGISTERS 4- 13 OSCCON — Oscillator Control Register D3 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––00–0 Read/Write –––– R/W R/W – R/W .7 -.4 Not used for S3C9228/P9228 .3 Main Oscillator Control Bit 0 Main oscillator RUN 1 Main oscillator STOP .2 Sub Oscillator Control Bit 0 Sub oscill[...]

  • Page 66

    CONTROL REGISTERS S3C9228/P9228 4- 14 P0CON – Port 0 Control Register EBH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P0.3/BUZ/INT Configuration Bits 0 0 Schmitt trigger input 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Alternative function (BUZ output) .5-.4 P0.2[...]

  • Page 67

    S3C9228/P9228 CONTROL REGISTERS 4- 15 P0INT –Port 0 Interrupt Enable Register EDH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P0.3's Interrupt Enable Bit 0 Disable interrupt 1 Enable interrupt .2 P0.2's Interrupt Enable Bit 0 Disabl[...]

  • Page 68

    CONTROL REGISTERS S3C9228/P9228 4- 16 P0PUR –Port 0 Pull-up Resistors Enable Register ECH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P0.3's Pull-up Resistor Enable Bit 0 Disable pull-up resistor 1 Enable pull-up resistor .2 P0.2's [...]

  • Page 69

    S3C9228/P9228 CONTROL REGISTERS 4- 17 P0EDGE –Port 0 Interrupt Edge Selection Register EEH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P0.3's Interrupt Edge Setting Bit 0 Falling edge interrupt 1 Rising edge interrupt .2 P0.2's Inte[...]

  • Page 70

    CONTROL REGISTERS S3C9228/P9228 4- 18 P1CON – Port 1 Control Register EFH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P1.3/AD3/INT Configuration Bits 0 0 Schmitt trigger input 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Alternative function (ADC mode) .5-.4 P1.2/A[...]

  • Page 71

    S3C9228/P9228 CONTROL REGISTERS 4- 19 P1INT –Port 1 Interrupt Enable Register F1H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P1.3's Interrupt Enable Bit 0 Disable interrupt 1 Enable interrupt .2 P1.2's Interrupt Enable Bit 0 Disabl[...]

  • Page 72

    CONTROL REGISTERS S3C9228/P9228 4- 20 P1PUR –Port 1 Pull-up Resistors Enable Register F0H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P1.3's Pull-up Resistor Enable Bit 0 Disable pull-up resistor 1 Enable pull-up resistor .2 P1.2's [...]

  • Page 73

    S3C9228/P9228 CONTROL REGISTERS 4- 21 P1EDGE –Port 1 Interrupt Edge Selection Register F2H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P1.3's Interrupt Edge Setting Bit 0 Falling edge interrupt 1 Rising edge interrupt .2 P1.2's Inte[...]

  • Page 74

    CONTROL REGISTERS S3C9228/P9228 4- 22 P2CON – Port 2 Control Register F3H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P2.3 Configuration Bits 0 0 Schmitt trigger input 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Not available .5-.4 P2.2/SI Configuration Bits 0 0 S[...]

  • Page 75

    S3C9228/P9228 CONTROL REGISTERS 4- 23 P2PUR –Port 2 Pull-up Resistors Enable Register F4H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P2.3's Pull-up Resistor Enable Bit 0 Disable pull-up resistor 1 Enable pull-up resistor .2 P2.2's [...]

  • Page 76

    CONTROL REGISTERS S3C9228/P9228 4- 24 P3CON – Port 3 Control Register F5H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3-.2 P3.1/SEG2/INTP Configuration Bits 0 0 Schmitt trigger input 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Not [...]

  • Page 77

    S3C9228/P9228 CONTROL REGISTERS 4- 25 P3INT –Port 3 Interrupt Enable Register F7H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––––00 Read/Write –––––– R/W R/W .7-.2 Not used for S3C9228/P9228 .1 P3.1's Interrupt Enable Bit 0 Disable interrupt 1 Enable interrupt .0 P3.0's Interrupt Enable Bit 0 Disa[...]

  • Page 78

    CONTROL REGISTERS S3C9228/P9228 4- 26 P3PUR –Port 3 Pull-up Resistors Enable Register F6H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––––00 Read/Write –––––– R/W R/W .7-.2 Not used for S3C9228/P9228 .1 P3.1's Pull-up Resistor Enable Bit 0 Disable pull-up resistor 1 Enable pull-up resistor .0 P3.0'[...]

  • Page 79

    S3C9228/P9228 CONTROL REGISTERS 4- 27 P3EDGE –Port 3 Interrupt Edge Selection Register F8H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––––00 Read/Write –––––– R/W R/W .7-.4 Not used for S3C9228/P9228 .1 P3.1's Interrupt State Setting Bit 0 Falling edge interrupt 1 Rising edge interrupt .0 P3.0's I[...]

  • Page 80

    CONTROL REGISTERS S3C9228/P9228 4- 28 P4CONH – Port 4 Control Register High Byte F9H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P4.7/SEG11 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P4.6/SEG10 Configura[...]

  • Page 81

    S3C9228/P9228 CONTROL REGISTERS 4- 29 P4CONL –Port 4 Control Register Low Byte FAH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P4.3/SEG7 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P4.2/SEG6 Configuration[...]

  • Page 82

    CONTROL REGISTERS S3C9228/P9228 4- 30 P5CONH – Port 5 Control Register High Byte FBH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 -.6 P5.7/SEG19/COM4 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P5.6/SEG18/COM[...]

  • Page 83

    S3C9228/P9228 CONTROL REGISTERS 4- 31 P5CONL – Port 5 Control Register Low Byte FCH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 -.6 P5.3/SEG15 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P5.2/SEG14 Configura[...]

  • Page 84

    CONTROL REGISTERS S3C9228/P9228 4- 32 P6CON – Port 6 Control Register High Byte FDH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 -.6 P6.3/COM0 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P6.2/COM1 Configurati[...]

  • Page 85

    S3C9228/P9228 CONTROL REGISTERS 4- 33 SIOCON — SIO Control Register E1 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 0000000– Read/Write R/W R/W R/W R/W R/W R/W R/W – .7 SIO Shift Clock Selection Bit 0 Internal clock ( P.S clock) 1 External clock (SCK) .6 Data Direction Control Bit 0 MSB-first mode 1 LSB-first mode . 5 SIO Mode S[...]

  • Page 86

    CONTROL REGISTERS S3C9228/P9228 4- 34 STPCON – Stop Control Register E0H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 Stop Control Bits 1 0100101 Enable Stop instruction Other values Disable Stop instruction NOTE: Before executing the STOP instruction, the STPCON register must be [...]

  • Page 87

    S3C9228/P9228 CONTROL REGISTERS 4- 35 SYM — System Mode Register DFH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 Global Interrupt Enable Bit 0 G lobal interrupt processing disable (DI instruction) 1 G lobal interrupt processing enable (EI ins[...]

  • Page 88

    CONTROL REGISTERS S3C9228/P9228 4- 36 T A CON — Timer 1/A Control Register BBH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 0 000000– Read/Write R/W R/W R/W R/W R/W R/W R/W – .7 Timer 1 Mode Selection Bit 0 Two 8-bit timers mode (Timer A/B) 1 One 16-bit timer mode (Timer 1) .6-.4 Timer 1/A Clock Selection Bits 000 fxx/512 001 fxx/[...]

  • Page 89

    S3C9228/P9228 CONTROL REGISTERS 4- 37 T B CON — Timer B Control Register BA H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value –000000– Read/Write – R/W R/W R/W R/W R/W R/W – .7 Not used for S3C9228/P9228 .6-.4 Timer B Clock Selection Bits 000 fxx/512 001 fxx/256 010 fxx/64 011 fxx/8 100 fxx (system clock) 101 fxt (sub clock) .3 T[...]

  • Page 90

    CONTROL REGISTERS S3C9228/P9228 4- 38 WTCON — Watch Timer Control Register DA H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 0000000– Read/Write R/W R/W R/W R/W R/W R/W R/W – .7 Watch Timer Clock Selection Bit 0 Select main clock divided by 2 7 (fx/128) 1 Select sub clock ( fxt) .6 Watch Timer Interrupt Enable Bit 0 Disable watch [...]

  • Page 91

    S3C9228/P9228 INTERRUPT STRUCTURE 5- 1 5 INTERRUPT STRUCTURE OVERVIEW The SAM88RCRI interrupt structure has two basic components: a vector, and sources. The number of interrupt sources can be serviced through a interrupt vector which is assigned in ROM address 0000H–0001H. SOURCES VECTOR S1 S2 S3 Sn 0000H 0001H NOTES: 1. The SAM88RCRI interrupt h[...]

  • Page 92

    INTERRUPT STRUCTURE S3C9228/P9228 5- 2 INTERRUPT PENDING FUNCTION TYPES When the interrupt service routine has executed, the application program's service routine must clear the appropriate pending bit before the return from interrupt subroutine (IRET) occurs. INTERRUPT PRIORITY Because there is not a interrupt priority register in SAM87 RCR I[...]

  • Page 93

    S3C9228/P9228 INTERRUPT STRUCTURE 5- 3 INTERRUPT SOURCE SERVICE SEQUENCE The interrupt request polling and servicing sequence is as follows: 1. A source generates an interrupt request by setting the interrupt request pending bit to "1". 2. The CPU generates an interrupt acknowledge signal. 3. The service routine starts and the source&apos[...]

  • Page 94

    INTERRUPT STRUCTURE S3C9228/P9228 5- 4 S3C9228/P9228 INTERRUPT STRUCTURE The S3C9228/P9228 microcontroller has fourteen peripheral interrupt sources: — Timer 1/A interr upt — Timer B interrupt — SIO interrupt — Watch Timer interrupt — Four external interrupts for port 0 — Four external interrupts for port 1 — Two external interrupts f[...]

  • Page 95

    S3C9228/P9228 INTERRUPT STRUCTURE 5- 5 SYM.3 (EI, DI) P0INT.0 P0.0 External Interript P0INT.1 P0.1 External Interript P0.3 External Interript P0.2 External Interript P0INT.2 P0INT.3 INTPND1.0 INTPND1.1 INTPND1.2 INTPND1.3 P1.0 External Interript P1INT.0 P1.2 External Interript P1.3 External Interrupt P1.1 External Interript P1INT.1 P1INT.2 P1INT.3 [...]

  • Page 96

    INTERRUPT STRUCTURE S3C9228/P9228 5- 6 Programming Tip — How to clear an interrupt pending bit As the following examples are shown, a load instruction should be used to clear an interrupt pending bit. Examples: 1. LD INTPND1, #11111011B ; Clear P0.2's interrupt pending bit • • • IRET 2. L D INTPND2, #11110111B ; Clear watch timer inter[...]

  • Page 97

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 1 6 SAM8 8RC R I INSTRUCTION SET OVERVIEW The SAM88RCRI instruction set is designed to support the large register file. It includes a full complement of 8- bit arithmetic and logic operations. There are 41 instructions. No special I/O instructions are necessary because I/O control and data registers ar[...]

  • Page 98

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 2 Table 6- 1. Instruction Group Summary Mnemonic Operands Instruction Load Instructions CLR dst Clear LD dst,src Load LDC dst,src Load program memory LDE dst,src Load external data memory LDCD dst,src Load program memory and decrement LDED dst,src Load external data memory and decrement LDCI dst,src Load [...]

  • Page 99

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 3 Table 6- 1 . Instruction Group Summary (Continued) Mnemonic Operands Instruction Program Control Instructions CALL dst Call procedure IRET Interrupt return JP cc,dst Jump on condition code JP dst Jump unconditional JR cc,dst Jump relative on condition code RET Return Bit Manipulation Instructions TCM[...]

  • Page 100

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 4 FLAGS REGISTER (FLAGS) The FLAGS register contains eight bits that describe the current status of CPU operations. Four of these bits, FLAGS.4 – FLAGS.7, can be tested and used with conditional jump instructions; FLAGS register can be set or reset by instructions as long as its outcome does not affect [...]

  • Page 101

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 5 INSTRUCTION SET NOTATION Table 6- 2 . Flag Notation Conventions Flag Description C Carry flag Z Zero flag S Sign flag V Overflow flag 0 Cleared to logic zero 1 Set to logic one * Set or cleared according to operation – Value is unaffected x Value is undefined Table 6- 3 . Instruction Set Symbols Sy[...]

  • Page 102

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 6 Table 6- 4 . Instruction Notation Conventions Notation Description Actual Operand Range cc Condition code See list of condition codes in Table 6- 6. r Working register only Rn (n = 0–15) rr Working register pair RRp (p = 0, 2, 4, ..., 14) R Register or working register reg or Rn ( reg = 0–255, n = 0[...]

  • Page 103

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 7 Table 6- 5 . Opcode Quick Reference OPCODE MAP LOWER NIBBLE (HEX) – 0123456 7 U 0 DEC R1 DEC IR1 ADD r1,r2 ADD r1,Ir2 ADD R2,R1 ADD IR2,R1 ADD R1,IM P 1 RLC R1 RLC IR1 ADC r1,r2 ADC r1,Ir2 ADC R2,R1 ADC IR2,R1 ADC R1,IM P 2 INC R1 INC IR1 SUB r1,r2 SUB r1,Ir2 SUB R2,R1 SUB IR2,R1 SUB R1,IM E 3 JP I[...]

  • Page 104

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 8 Table 6- 5 . Opcode Quick Reference (Continued) OPCODE MAP LOWER NIBBLE (HEX) – 8 9 A B C D E F U 0 LD r1,R2 LD r2,R1 JR cc,RA LD r1,IM JP cc,DA INC r1 P 1 ↓↓ ↓↓↓↓ P 2 E 3 R 4 5 N 6 IDLE I 7 ↓↓ ↓↓↓↓ STOP B 8 DI B 9 EI L A RE T E B IRET C RCF H D ↓↓ ↓↓↓↓ SCF E E CCF [...]

  • Page 105

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 9 CONDITION CODES The opcode of a conditional jump always contains a 4-bit field called the condition code (cc). This specifies under which conditions it is to execute the jump. For example, a conditional jump with the condition code for "equal" after a compare operation only jumps if the two[...]

  • Page 106

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 10 INSTRUCTION DESCRIPTIONS This section contains detailed information and programming examples for each instruction in the SAM88RCRI instruction set. Information is arranged in a consistent format for improved readability and for fast referencing. The following information is included in each instruction[...]

  • Page 107

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 11 ADC — Add With Carry ADC dst,src Operation: dst ¨ dst + src + c The source operand, along with the setting of the carry flag, is added to the destination operand and the sum is stored in the destination. The contents of the source are unaffected. Two's- complement addition is performed. In m[...]

  • Page 108

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 12 ADD — Add ADD dst,src Operation: dst ¨ dst + src The source operand is added to the destination operand and the sum is stored in the destination. The contents of the source are unaffected. Two's-complement addition is performed. Flags: C: Set if there is a carry from the most significant bit of[...]

  • Page 109

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 13 AND — Logical AND AND dst,src Operation: dst ¨ dst AND src The source operand is logically ANDed with the destination operand. The result is stored in the destination. The AND operation results in a "1" bit being stored whenever the corresponding bits in the two operands are both logic [...]

  • Page 110

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 14 CALL — Call Procedure CALL dst Operation: SP ¨ SP – 1 @SP ¨ PCL SP ¨ SP –1 @SP ¨ PCH PC ¨ dst The current contents of the program counter are pushed onto the top of the stack. The program counter value used is the address of the first instruction following the CALL instruction. The specified[...]

  • Page 111

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 15 CCF — Complement Carry Flag CCF Operation: C ¨ NOT C The carry flag (C) is complemented. If C = "1", the value of the carry flag is changed to logic zero; if C = "0", the value of the carry flag is changed to logic one. Flags: C: Complemented. No other flags are affected. Form[...]

  • Page 112

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 16 CLR — Clear CLR dst Operation: dst ¨ "0" The destination location is cleared to "0". Flags: No flags are affected. Format: Bytes Cycles Opcode (Hex) Addr Mode dst opc dst 2 4 B0 R 4 B1 IR Examples: Given: Register 00H = 4FH, register 01H = 02H, and register 02H = 5EH: CLR 00H →[...]

  • Page 113

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 17 COM — Complement COM dst Operation: dst ¨ NOT dst The contents of the destination location are complemented (one's complement); all "1s" are changed to "0s", and vice-versa. Flags: C: Unaffected. Z: Set if the result is "0"; cleared otherwise. S: Set if the resu[...]

  • Page 114

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 18 CP — Compare CP dst,src Operation: dst – src The source operand is compared to (subtracted from) the destination operand, and the appropriate flags are set accordingly. The contents of both operands are unaffected by the comparison. Flags: C: Set if a "borrow" occurred ( src > dst); cl[...]

  • Page 115

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 19 DEC — Decrement DEC dst Operation: dst ¨ dst – 1 The contents of the destination operand are decremented by one. Flags: C: Unaffected. Z: Set if the result is "0"; cleared otherwise. S: Set if result is negative; cleared otherwise. V: Set if arithmetic overflow occurred, that is, dst [...]

  • Page 116

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 20 DI — Disable Interrupts DI Operation: SYM (2) ¨ 0 Bit zero of the system mode register, SYM.2, is cleared to "0", globally disabling all interrupt processing. Interrupt requests will continue to set their respective interrupt pending bits, but the CPU will not service them while interrupt [...]

  • Page 117

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 21 EI — Enable Interrupts EI Operation: SYM (2) ¨ 1 An EI instruction sets bit 2 of the system mode register, SYM.2 to "1". This allows interrupts to be serviced as they occur. If an interrupt's pending bit was set while interrupt processing was disabled (by executing a DI instruction[...]

  • Page 118

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 22 IDLE — Idle Operation IDLE Operation: The IDLE instruction stops the CPU clock while allowing system clock oscillation to continue. Idle mode can be released by an interrupt request (IRQ) or an external reset operation. Flags: No flags are affected. Format: Bytes Cycles Opcode (Hex) Addr Mode dst src[...]

  • Page 119

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 23 INC — Increment INC dst Operation: dst ¨ dst + 1 The contents of the destination operand are incremented by one. Flags: C: Unaffected. Z: Set if the result is "0"; cleared otherwise. S: Set if the result is negative; cleared otherwise. V: Set if arithmetic overflow occurred, that is dst[...]

  • Page 120

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 24 IRET — Interrupt Return IRET IRET Operation: FLAGS ¨ @SP SP ¨ SP + 1 PC ¨ @SP SP ¨ SP + 2 SYM(2) ¨ 1 This instruction is used at the end of an interrupt service routine. It restores the flag register and the program counter. It also re-enables global interrupts. Flags: All flags are restored to [...]

  • Page 121

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 25 JP — Jump JP cc,dst (Conditional) JP dst (Unconditional) Operation: If cc is true, PC ¨ dst The conditional JUMP instruction transfers program control to the destination address if the condition specified by the condition code (cc) is true; otherwise, the instruction following the JP instruction [...]

  • Page 122

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 26 JR — Jump Relative JR cc,dst Operation: If cc is true, PC ¨ PC + dst If the condition specified by the condition code (cc) is true, the relative address is added to the program counter and control passes to the statement whose address is now in the program counter; otherwise, the instruction followi[...]

  • Page 123

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 27 LD — Load LD dst,src Operation: dst ¨ src The contents of the source are loaded into the destination. The source's contents are unaffected. Flags: No flags are affected. Format: Bytes Cycles Opcode (Hex) Addr Mode dst src dst | opc src 2 4 rC r IM 4 r8 r R src | opc dst 2 4 r9 R r r = 0 to F[...]

  • Page 124

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 28 LD — Load LD (Continued) Examples: Given: R0 = 01H, R1 = 0AH, register 00H = 01H, register 01H = 20H, register 02H = 02H, LOOP = 30H, and register 3AH = 0FFH: LD R0,#10H → R0 = 10H LD R0,01H → R0 = 20H, register 01H = 20H LD 01H,R0 → Register 01H = 01H, R0 = 01H LD R1,@R0 → R1 = 20H, R0 = 01H[...]

  • Page 125

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 29 LDC/LDE — Load Memory LDC/LDE dst,src Operation: dst ¨ src This instruction loads a byte from program or data memory into a working register or vice-versa. The source values are unaffected. LDC refers to program memory and LDE to data memory. The assembler makes ' Irr' or ' rr&apos[...]

  • Page 126

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 30 LDC/LDE — Load Memory LDC/LDE (Continued) Examples: Given: R0 = 11H, R1 = 34H, R2 = 01H, R3 = 04H, R4 = 00H, R5 = 60H; Program memory locations 0061 = AAH, 0103H = 4FH, 0104H = 1A, 0105H = 6DH, and 1104H = 88H. External data memory locations 0061H = BBH, 0103H = 5FH, 0104H = 2AH, 0105H = 7DH, and 110[...]

  • Page 127

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 31 LDCD/LDED — Load Memory and Decrement LDCD/LDED dst,src Operation: dst ¨ src rr ¨ rr – 1 These instructions are used for user stacks or block transfers of data from program or data memory to the register file. The address of the memory location is specified by a working register pair. The cont[...]

  • Page 128

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 32 LDCI/LDEI — Load Memory and Increment LDCI/LDEI dst,src Operation: dst ¨ src rr ¨ rr + 1 These instructions are used for user stacks or block transfers of data from program or data memory to the register file. The address of the memory location is specified by a working register pair. The contents [...]

  • Page 129

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 33 NOP — No Operation NOP Operation: No action is performed when the CPU executes this instruction. Typic ally, one or more NOPs are executed in sequence in order to effect a timing delay of variable duration. Flags: No flags are affected. Format: Bytes Cycles Opcode (Hex) opc 1 4 FF Example: When th[...]

  • Page 130

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 34 OR — Logical OR OR dst,src Operation: dst ¨ dst OR src The source operand is logically ORed with the destination operand and the result is stored in the destination. The contents of the source are unaffected. The OR operation results in a "1" being stored whenever either of the correspondi[...]

  • Page 131

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 35 POP — Pop From Stack POP dst Operation: dst ¨ @SP SP ¨ SP + 1 The contents of the location addressed by the stack pointer are loaded into the destination. The stack pointer is then incremented by one. Flags: No flags affected. Format: Bytes Cycles Opcode (Hex) Addr Mode dst opc dst 2 8 50 R 8 51[...]

  • Page 132

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 36 PUSH — Push To Stack PUSH src Operation: SP ¨ SP – 1 @SP ¨ src A PUSH instruction decrements the stack pointer value and loads the contents of the source ( src) into the location addressed by the decremented stack pointer. The operation then adds the new value to the top of the stack. Flags: No f[...]

  • Page 133

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 37 RCF — Reset Carry Flag RCF RCF Operation: C ¨ 0 The carry flag is cleared to logic zero, regardless of its previous value. Flags: C: Cleared to "0". No other flags are affected. Format: Bytes Cycles Opcode (Hex) opc 1 4 CF Example: Given: C = "1" or "0": The instruct[...]

  • Page 134

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 38 RET — Return RET Operation: PC ¨ @SP SP ¨ SP + 2 The RET instruction is normally used to return to the previously executing procedure at the end of a procedure entered by a CALL instruction. The contents of the location addressed by the stack pointer are popped into the program counter. The next st[...]

  • Page 135

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 39 RL — Rotate Left RL dst Operation: C ¨ dst (7) dst (0) ¨ dst (7) dst (n + 1) ¨ dst (n), n = 0–6 The contents of the destination operand are rotated left one bit position. The initial value o f bit 7 is moved to the bit zero (LSB) position and also replaces the carry flag. C 7 0 Flags: C: Set [...]

  • Page 136

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 40 RLC — Rotate Left Through Carry RLC dst Operation: dst (0) ¨ C C ¨ dst (7) dst (n + 1) ¨ dst (n), n = 0–6 The contents of the destination operand with the carry flag are rotated left one bit position. The initial value of bit 7 replaces the carry flag (C); the initial value of the carry flag rep[...]

  • Page 137

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 41 RR — Rotate Right RR dst Operation: C ¨ dst (0) dst (7) ¨ dst (0) dst (n) ¨ dst (n + 1), n = 0–6 The content s of the destination operand are rotated right one bit position. The initial value of bit zero (LSB) is moved to bit 7 (MSB) and also replaces the carry flag (C). C 7 0 Flags: C: Set i[...]

  • Page 138

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 42 RRC — Rotate Right Through Carry RRC dst Operation: dst (7) ¨ C C ¨ dst (0) dst (n) ¨ dst (n + 1), n = 0–6 The contents of the destination operand and the carry flag are rotated right one bit position. The initial value of bit zero (LSB) replaces the carry flag; the initial value of the carry fl[...]

  • Page 139

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 43 SBC — Subtract With Carry SBC dst,src Operation: dst ¨ dst – src – c The source operand, along with the current value of the carry flag, is subtracted from the destination operand and the result is stored in the destination. The contents of the source are unaffected. Subtraction is performed [...]

  • Page 140

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 44 SCF — Set Carry Flag SCF Operation: C ¨ 1 The carry flag (C) is set to logic one, regardless of its previous value. Flags: C: Set to "1". No other flags are affected. Format: Bytes Cycles Opcode (Hex) opc 1 4 DF Example: The statement SCF sets the carry flag to logic one.[...]

  • Page 141

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 45 SRA — Shift Right Arithmetic SRA dst Operation: dst (7) ¨ dst (7) C ¨ dst (0) dst (n) ¨ dst (n + 1), n = 0–6 An arithmetic shift-right of one bit position is perform ed on the destination operand. Bit zero (the LSB) replaces the carry flag. The value of bit 7 (the sign bit) is unchanged and i[...]

  • Page 142

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 46 STOP — Stop Operation STOP Operation: The STOP instruction stops both the CPU clock and system clock and causes the microcontroller to enter Stop mode. During Stop mode, the contents of on-chip CPU registers, peripheral registers, and I/O port control and data registers are retained. Stop mode can be[...]

  • Page 143

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 47 SUB — Subtract SUB dst,src Operation: dst ¨ dst – src The source operand is subtracted from the destination operand and the result is stored in the destination. The contents of the source are unaffected. Subtraction is performed by adding the two's complement of the source operand to the d[...]

  • Page 144

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 48 TCM — Test Complement Under Mask TCM dst,src Operation: (NOT dst) AND src Thi s instruction tests selected bits in the destination operand for a logic one value. The bits to be tested are specified by setting a "1" bit in the corresponding position of the source operand (mask). The TCM stat[...]

  • Page 145

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 49 TM — Test Under Mask TM dst,src Operation: dst AND src This instruction tests selected bits in the destination operand for a logic zero value. The bits to be tested are specified by setting a "1" bit in the corresponding position of the source operand (mask), which is ANDed with the dest[...]

  • Page 146

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 50 XOR — Logical Exclusive OR XOR dst,src Operation: dst ¨ dst XOR src The source operand is logically exclusive- ORed with the destination operand and the result is stored in the destination. The exclusive-OR operation results in a "1" bit being stored whenever the corresponding bits in the [...]

  • Page 147

    S3C9228/P9228 CLOCK CIRCUITS 7- 1 7 CLOCK CIRCUITS OVERVIEW The S3C9228 microcontroller has two oscillator circuits: a main clock, and a sub clock circuit. The CPU and peripheral hardware operate on the system clock frequency supplied through these circuits. The maximum CPU clock frequency, is determined by CLKCON register settings . SYSTEM CLOCK C[...]

  • Page 148

    CLOCK CIRCUITS S3C9 228/P9228 7- 2 MAIN OSCILLATOR CIRCUITS X IN X OUT Figure 7-1. Crystal/Ceramic Oscillator X IN X OUT Figure 7-2. External Oscillator X IN X OUT R Figure 7-3. RC Oscillator SUB OSCILLATOR CIRCUITS XT IN XT OUT 32.768 kHz Figure 7-4. Crystal/Ceramic Oscillator XT IN XT OUT Figure 7-5. External Oscillator[...]

  • Page 149

    S3C9228/P9228 CLOCK CIRCUITS 7- 3 CLOCK STATUS DURING POWER-DOWN MODES The two power-down modes, Stop mode and Idle mode, affect the system clock as follows: — In Stop mode, the main oscillator is halted. Stop mode is released, and the oscillator started, by a reset operation, by an external interrupt, or by an internal interrupt if sub clock is [...]

  • Page 150

    CLOCK CIRCUITS S3C9 228/P9228 7- 4 SYSTEM CLOCK CONTROL REGISTER (CLKCON) The system clock control register, CLKCON, is located in address D4H. It is read/write addressable and has the following functions: — Oscillator IRQ wake-up function enable/disable — Oscillator frequency divide-by value CLKCON register settings control whether or not an e[...]

  • Page 151

    S3C9228/P9228 CLOCK CIRCUITS 7- 5 OSCILLATOR CONTROL REGISTER (OSCCON) The oscillator control register, OSCCON, is located in address D3H. It is read/write addressable and has the following functions: — System clock selection — Main oscillator control — Sub oscillator control OSCCON.0 register settings select Main clock or Sub clock as system[...]

  • Page 152

    CLOCK CIRCUITS S3C9 228/P9228 7- 6 SWITCHING THE CPU CLOCK Data loadings in the oscillator control register, OSCCON, determine whether a main or a sub clock is selected as the CPU clock, and also how this frequency is to be divided by setting CLKCON. This makes it possible to switch dynamically between main and sub clocks and to modify operating fr[...]

  • Page 153

    S3C9228/P9228 CLOCK CIRCUITS 7- 7 STOP CONTROL REGISTER (STPCON) The STOP control register, STPCON, is located in address E0H. It is read/write addressable and has the following functions: — Enable/Disable STOP instruction After a reset, the STOP instruction is disabled, because the value of STPCON is "other values". If necessary, you c[...]

  • Page 154

    CLOCK CIRCUITS S3C9 228/P9228 7- 8 NOTES[...]

  • Page 155

    S3C9228/P9228 RESET RESET and POWER-DOWN 8- 1 8 RESET RESET and POWER-DOWN SYSTEM RESET OVERVIEW During a power-on reset, the voltage at V DD goes to High level and the RESET pin is forced to Low level. The RESET signal is input through a schmitt trigger circuit where it is then synchronized with the CPU clock. This procedure brings S3C9228/P9228 i[...]

  • Page 156

    RESET RESET and POWER-DOWN S3C9228 /P9228 8- 2 POWER-DOWN MODES STOP MODE Stop mode is invoked by the instruction STOP. In Stop mode, the operation of the CPU and main oscillator is halted. All peripherals which the main oscillator is selected as a clock source stop also because main oscillator stops. But the watch timer and LCD controller will not[...]

  • Page 157

    S3C9228/P9228 RESET RESET and POWER-DOWN 8- 3 Using an Internal Interrupt to Release Stop Mode An internal interrupt, watch timer, can be used to release stop mode because the watch timer operates in stop mode if the clock source of watch timer is sub clock. If system clock is sub clock, you can't use any interrupts to release stop mode. That [...]

  • Page 158

    RESET RESET and POWER-DOWN S3C9228 /P9228 8- 4 HARDWARE RESET RESET VALUES Table 8-1 list the values for CPU and system registers, peripheral control registers, and peripheral data registers following a RESET operation in normal operating mode. The following notation is used in these table to represent specific RESET values: — A "1" or [...]

  • Page 159

    S3C9228/P9228 RESET RESET and POWER-DOWN 8- 5 Table 8-1. Register Values after RESET RESET (Continued) Register Name Mnemonic Address Bit Values after RESET RESET Dec Hex 76543210 System Mode Register SYM 223 DFH ––––0000 STOP Control Register STPCON 224 E0H 00000000 SIO Control Register SIOCON 225 E1H 0000000– SIO Data Register SIODATA 2[...]

  • Page 160

    RESET RESET and POWER-DOWN S3C9228 /P9228 8- 6 NOTES[...]

  • Page 161

    S3C9228/P9228 I/O P ORTS 9- 1 9 I/O PORTS OVERVIEW The S3C9228/P9228 microcontroller has seven bit-programmable I/O ports, P0-P6. Port 0 is 6-bit port, port 1, port 2, and port 6 are 4-bit ports, port 3 is 2-bit port, and port 4 and port 5 are 8-bit ports. This gives a total of 36 I/O pins. Each port can be flexibly configured to meet application d[...]

  • Page 162

    I/O PORTS S3C9228/P 9228 9- 2 PORT DATA REGISTERS Table 9-2 gives you an overview of the register locations of all seven S3C9228 I/O port data registers. Data registers for ports 1, 2, 3, 4, 5, and 6 have the general format shown in Figure 9-1. Table 9-2. Port Data Register Summary Register Name Mnemonic Decimal Hex R/W Port 0 data register P0 228 [...]

  • Page 163

    S3C9228/P9228 I/O P ORTS 9- 3 PORT 0 Port 0 is an 6-bit I/O port with individually configurable pins. Port 0 pins are accessed directly by writing or reading the port 0 data register, P0 at location E4H in page 0. P0.0-P0.3 can serve as inputs (with or without pull- up), as outputs (push-pull or open-drain) or you can be configured the following fu[...]

  • Page 164

    I/O PORTS S3C9228/P 9228 9- 4 Port 0 Control Register (P0CON) EBH, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB P0.3/BUZ (INT) P0CON bit-pair pin configuration settings: 00 01 10 11 N-channel open-drain output mode Alternative function (TAOUT, BUZ) P0.2 (INT) P0.1/T1CLK (INT) P0.0/TAOUT (INT) Push-pull output mode Schmitt trigger input mode (T1CLK) [...]

  • Page 165

    S3C9228/P9228 I/O P ORTS 9- 5 Port 0 Interrupt Pending Bits (INTPND1.3-.0) D6H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB INTPND1 bit configuration settings: 0 1 P0.3 (INT) Interrupt is pending (when read) No interrupt pending (when read), clear pending bit (when write) P0.2 (INT) P0.1 (INT) P0.0 (INT) P1.3 (INT) P1.2 (INT) P1.1 (INT) P1.0 (INT) [...]

  • Page 166

    I/O PORTS S3C9228/P 9228 9- 6 PORT 1 Port 1 is an 4-bit I/O port with individually configurable pins. Port 1 pins are accessed directly by writing or reading the port 1 data register, P1 at location E5H in page 0. P1.0-P1.3 can serve as inputs (with or without pull- up), as outputs (push-pull or open-drain) or you can be configured the following fu[...]

  • Page 167

    S3C9228/P9228 I/O P ORTS 9- 7 Port 1 Interrupt Control Register (P1INT) F1H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB Not used P1INT bit configuration settings: 0 1 P1.3 (INT) Enable interrupt Disable interrupt P1.2 (INT) P1.1 (INT) P1.0 (INT) Figure 9-8. Port 1 Interrupt Control Register (P1INT) Port 1 Interrupt Pending Bits (INTPND1.7-.4) D6H,[...]

  • Page 168

    I/O PORTS S3C9228/P 9228 9- 8 Port 1 Interrupt Edge Selection Register (P1EDGE) F2H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB P1EDGE bit configuration settings: 0 1 P1.3 (INT) Rising edge detection Falling edge detection P1.2 (INT) P1.1 (INT) P1.0 (INT) Not used Figure 9-10. Port 1 Interrupt Edge Selection Register (P1EDGE) Port 1 Pull-up Contro[...]

  • Page 169

    S3C9228/P9228 I/O P ORTS 9- 9 PORT 2 Port 2 is an 4-bit I/O port with individually configurable pins. Port 2 pins are accessed directly by writing or reading the port 2 data register, P2 at location E6H in page 0. P2.0-P2.3 can serve as inputs (with or without pull- up), as outputs (push-pull or open-drain) or you can be configured the following fu[...]

  • Page 170

    I/O PORTS S3C9228/P 9228 9- 10 Port 2 Pull-up Control Register (P2PUR) F4H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB P2PUR bit configuration settings: 0 1 Enable pull-up resistor Disable pull-up resistor Not used P2.3 P2.2 P2.1 P2.0 Figure 9-13. Port 2 Pull-up Control Register (P2PUR)[...]

  • Page 171

    S3C9228/P9228 I/O P ORTS 9- 11 PORT 3 Port 3 is an 2-bit I/O port with individually configurable pins. Port 3 pins are accessed directly by writing or reading the port 3 data register, P3 at location E7H in page 0. P3.0-P3.1 can serve as inputs (with or without pull- up, and high impedance input), as outputs (push-pull or open-drain) or you can be [...]

  • Page 172

    I/O PORTS S3C9228/P 9228 9- 12 Port 3 Interrupt Control Register (P3INT) F7H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB Not used P3INT bit configuration settings: 0 1 Enable interrupt Disable interrupt P3.1 (INTP) P3.0 (INTP) Figure 9-15. Port 3 Interrupt Control Register (P3INT) Port 3 Interrupt Pending Bits (INTPND2.5-.4) D7H, Page 0, R/W .7 .6[...]

  • Page 173

    S3C9228/P9228 I/O P ORTS 9- 13 Port 3 Interrupt Edge Selection Register (P3EDGE) F8H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB P3EDGE bit configuration settings: 0 1 Rising edge detection Falling edge detection P3.1 (INTP) P3.0 (INTP) Not used Figure 9-17. Port 3 Interrupt Edge Selection Register (P3EDGE) Port 3 Pull-up Control Register (P3PUR) [...]

  • Page 174

    I/O PORTS S3C9228/P 9228 9- 14 PORT 4 Port 4 is an 8-bit I/O port with individually configurable pins. Port 4 pins are accessed directly by writing or reading the port 4 data register, P4 at location E8H in page 0. P4.0-P4.7 can serve as inputs or as push-pull, open-drain outputs. You can configure the following alternative functions with LCD port [...]

  • Page 175

    S3C9228/P9228 I/O P ORTS 9- 15 PORT 5 Port 5 is an 8-bit I/O port with individually configurable pins. Port 5 pins are accessed directly by writing or reading the port 5 data register, P5 at location E9H in page 0. P5.0-P5.7 can serve as inputs or as push-pull, open-drain outputs. You can configure the following alternative functions with LCD port [...]

  • Page 176

    I/O PORTS S3C9228/P 9228 9- 16 PORT 6 Port 6 is an 4-bit I/O port with individually configurable pins. Port 6 pins are accessed directly by writing or reading the port 6 data register, P6 at location EAH in page 0. P6.0-P6.3 can serve as inputs or as push-pull, open-drain outputs. You can configure the following alternative functions with LCD port [...]

  • Page 177

    S3C9228/P9228 ( Preliminary Spec ) BASIC TIMER 10- 1 10 BASIC TIMER OVERVIEW Basic timer (BT) can be used in two different ways: — As a watchdog timer to provide an automatic reset mechanism in the event of a system malfunction. — To signal the end of the required oscillation stabilization interval after a reset or a stop mode release. The func[...]

  • Page 178

    BASIC TIMER S3C9228 /P9228 ( Preliminary Spec ) 10- 2 BASIC TIMER CONTROL REGISTER (BTCON) The basic timer control register, BTCON, is used to select the input clock frequency, to clear the basic timer counter and frequency dividers, and to enable or disable the watchdog timer function. It is located in page 0, address DCH, and is read/write addres[...]

  • Page 179

    S3C9228/P9228 ( Preliminary Spec ) BASIC TIMER 10- 3 BASIC TIMER FUNCTION DESCRIPTION Watchdog Timer Function You can program the basic timer overflow signal (BTOVF) to generate a reset by setting BTCON.7–BTCON.4 to any value other than “1010B”. (The “1010B” value disables the watchdog function.) A reset clears BTCON to “00H”, automat[...]

  • Page 180

    BASIC TIMER S3C9228 /P9228 ( Preliminary Spec ) 10- 4 NOTE: During a power-on reset operation, the CPU is idle during the required oscillation stabilization interval (until bit 4 of the basic timer counter overflows). MUX f XX /4096 DIV f XX /1024 f XX /128 f XX /16 f XX Bits 3, 2 Bit 0 Basic Timer Control Register (Write '1010xxxxB' to D[...]

  • Page 181

    S3C9228/P9228 TIMER 1 11- 1 11 TIMER 1 ONE 16-BIT TIMER MODE (TIMER 1) The 16-bit timer 1 is used in one 16-bit timer or two 8-bit timers mode. If TACON.7 is set to "1", timer 1 is used as a 16-bit timer. If TACON.7 is set to "0", timer 1 is used as two 8-bit timers. — One 16-bit tim er mode (Timer 1) — Two 8-bit timers mode[...]

  • Page 182

    TIMER 1 S3C9228/P922 8 11- 2 Timer 1 Control Register (TACON) You use the timer 1 control register, TACON, to — Enable the timer 1 operating (interval timer) — Select the timer 1 input clock frequency — Clear the timer 1 counter, TACNT and TBCNT — Enable the timer 1 interrupt TACON is located in page 0, at address BBH, and is read/write add[...]

  • Page 183

    S3C9228/P9228 TIMER 1 11- 3 NOTE: When one 16-bit timer mode (TACON.7 <- "1": Timer 1) TACON.6-.4 M U X 1/8 1 /64 1 /256 1 /512 INTPND2.0 TAOUT T1INT 1/1 DIV R fxt T1CLK (X IN or XT IN ) fxx BTCON.0 TACON.2 TBCNT TACNT 16-Bit Comparator TBDATA Buffer TADATA Buffer TBDATA TADATA LSB MSB LSB MSB Match Signal Counter clear signal TACON.1 [...]

  • Page 184

    TIMER 1 S3C9228/P922 8 11- 4 TWO 8-BIT TIMERS MODE (TIMER A and B) OVERVIEW The 8-bit timer A and B are the 8-bit general-purpose timers. Timer A and B have the interval timer mode by using the appropriate TACON and TBCON setting, respectively. Timer A and B have the following functional components: — Clock frequency divider with multiplexer – [...]

  • Page 185

    S3C9228/P9228 TIMER 1 11- 5 TACON and TBCON are located in page 0, at address BBH and BAH, and is read/write addressable using register addressing mode. A reset clears TACON to "00H". This sets timer A to disable interval timer mode, selects an input clock frequency of fxx/512, and disables timer A interrupt. You can clear the timer A cou[...]

  • Page 186

    TIMER 1 S3C9228/P922 8 11- 6 Timer B Control Register (TBCON) BAH, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB Timer B match interrupt enable bit: 0 = Disable match interrupt 1 = Enable match interrupt Not used Timer B count enable bit: 0 = Disable counting operating 1 = Enable counting operating Timer B counter clear bit: 0 = No effect 1 = Clear the timer[...]

  • Page 187

    S3C9228/P9228 TIMER 1 11- 7 FUNCTION DESCRIPTION Interval Timer Function (Timer A and Timer B) The timer A and B module can generate an interrupt: the timer A match interrupt (TAINT) and the timer B match interrupt (TBINT). The timer A match interrupt pending condition (INTPND2.0) and the timer B match interrupt pending condition (INTPND2.1) must b[...]

  • Page 188

    TIMER 1 S3C9228/P922 8 11- 8 NOTE: When two 8-bit timers mode (TACON.7 <- "0": Timer A) TACON.6-.4 M U X 1/8 1 /64 1 /256 1 /512 INTPND2.0 TAOUT TAINT DIV R fxt T1CLK/ P0.1 (X IN or XT IN ) fxx BTCON.0 TACON.2 8-Bit Comparator TADATA Buffer TADATA Register LSB MSB LSB MSB Match Signal Counter Clear Signal TACON.1 Match R TACON.3 Data B[...]

  • Page 189

    S3C9228/P9228 TIMER 1 11- 9 1/1 1/8 1 /64 1 /256 1 /512 NOTE: When two 8-bit timers mode (TACON.7 <- "0": Timer B) TBCON.6-.4 M U X INTPND2.1 TBINT DIV R fxt (X IN or XT IN ) fxx BTCON.0 TBCON.2 8-Bit Comparator TBDATA Buffer TBDATA Register LSB MSB LSB MSB Match Signal Counter Clear Signal TBCON.1 Match R TBCON.3 Data Bus Data Bus TBC[...]

  • Page 190

    TIMER 1 S3C9228/P922 8 11- 10 NOTES[...]

  • Page 191

    S3C9228/P9228 WATCH TIMER 12- 1 12 WATCH TIMER OVERVIEW Watch timer functions include real-time and watch-time measurement and interval timing for the system clock. To start watch timer operation, set bit 1 of the watch timer control register, WTCON.1 to "1". And if you want to service watch timer overflow interrupt, then set the WTCON.6 [...]

  • Page 192

    WATCH TIMER S3C922 8/P9228 12- 2 WATCH TIMER CONTROL REGISTER (WTCON) The watch timer control register, WTCON is used to select the input clock source, the watch timer interrupt time and Buzzer signal, to enable or disable the watch timer function. It is located in page 0 at address DAH, and is read/write addressable using register addressing mode.[...]

  • Page 193

    S3C9228/P9228 WATCH TIMER 12- 3 WATCH TIMER CIRCUIT DIAGRAM WT INT Enable WTCON.1 WTCON.2 WTCON.3 WTCON.4 WTCON.5 WTCON.6 Enable/Disable Selector Circuit MUX INTPND2.3 WTINT WTCON.6 f W /2 15 f W /2 14 f W /2 13 f W /2 7 f W /64 (0.5 kHz) f W /32 (1 kHz) f W /16 (2 kHz) f W /8 (4 kHz) (1 Hz) f X = Main clock (where fx = 4.19 MHz) fxt = Sub clock (3[...]

  • Page 194

    WATCH TIMER S3C922 8/P9228 12- 4 NOTES[...]

  • Page 195

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 1 13 LCD CONTROLLER/DRIV ER OVERVIEW The S3C9228/P9228 microcontroller can directly drive an up-to- 128 -dot ( 16 segments x 8 commons) LCD panel. Its LCD block has the following components: — LCD control ler/driver — Display RAM for storing display data — 16 segment output pins (SEG0 – SEG 15 ) — [...]

  • Page 196

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 2 LCD CIRCUIT DIAGRAM SEG15/P5.3 COM4/SEG19/P5.7 COM7/SEG16/P5.4 160 16 Data BUS Port Latch LPOT Display RAM (Page1) Port Latch Port Latch Timing Controller MUX SEG Control or Selector COM Control or selector f LCD SEG0/P2.1 COM3/P6.0 COM0/P6.3 COM Control LCD Voltage Control Port 3 Control P3.1/INTP/SEG2 P3.[...]

  • Page 197

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 3 LCD RAM ADDRESS AREA RAM addresses of page 1 are used as LCD data memory. When the bit value of a display segment is "1", the LCD display is turned on; when the bit value is "0", the display is turned off. Display RAM data are sent out through segment pins SEG0–SEG 19 using a direct m[...]

  • Page 198

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 4 LCD MODE CONTROL REGISTER (LMOD) A LMOD is located in page 0, at address FEH, and is read/write addressable using register addressing mode. It has the following control functions. — LCD duty and bias selection — LCD clock selection — LCD display control — COMs signal output control — P3 high imped[...]

  • Page 199

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 5 LCD PORT CONTROL REGISTER The LCD port control register LPOT is used to control LCD signal pins or normal I/O pins. Following a RESET , a LPOT values are cleared to "0". LCD Port Control Register D8H, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB Not used SEG0/P2.1 selection bit: 0 = SEG port 1 = Normal I/[...]

  • Page 200

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 6 LCD VOLTAGE DIVIDING RESISTORS 1/5 Bias S3C9228/P9228 V DD R R R R R LMOD.4 V LC1 V LC2 V LC3 V LC4 V LC5 V SS 1/4 Bias S3C9228/P9228 V DD R R R R R LMOD.4 V LC1 V LC2 V LC3 V LC4 V LC5 V SS 1/3 Bias S3C9228/P9228 V DD R R R R R LMOD.4 V LC1 V LC2 V LC3 V LC4 V LC5 V SS Figure 13-6. Internal Voltage Dividin[...]

  • Page 201

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 7 1 Frame FR V DD V SS COM0 COM1 COM2 COM3 COM4 COM5 COM6 COM7 COM1 V LC2 (V LC3 ) V LC4 V SS V DD V LC1 SEG0 V LC2 (V LC3 ) V LC4 V SS V DD V LC1 COM2 V LC2 (V LC3 ) V LC4 V SS V DD V LC1 COM0 V LC2 ( V LC3 ) V LC4 V SS V DD V LC1 SEG0-COM0 + V DD 0V + 1/4V LCD -V LCD - 1/4V LCD 0 1 2 3 7 4 6 5 0 1 2 3 7 4 [...]

  • Page 202

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 8 1 Frame V DD V SS 0 1 2 3 0 1 2 3 COM1 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM2 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM3 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) SEG0 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) SEG1 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM0-SEG0 + V LCD COM0 V SS V DD V LC1 [...]

  • Page 203

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 9 1 Frame V DD V SS 0 1 2 COM1 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM2 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) SEG0 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) SEG1 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM0-SEG0 + V LCD COM0 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) + 1/3 V LCD 0V - 1/3 V LCD - V[...]

  • Page 204

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 10 NOTES[...]

  • Page 205

    S3C9228/P9228 A/D C ONVERTER 14- 1 14 10-BIT ANALOG-TO-DIGITAL CONVERTER OVERVIEW The 10-bit A/D converter (ADC) module uses successive approximation logic to convert analog levels entering at one of the four input channels to equivalent 10 -bit digital values. The an alog input level must lie between the AV REF and AV SS values. The A/D converter [...]

  • Page 206

    A/D CONVERTER S3C9 228/P9228 14- 2 CONVERSION TIMING The A/D conversion process requires 4 steps (4 clock edges) to convert each bit and 10 clocks to set-up A/D conversion. Therefore, total of 50 clocks are required to complete an 10-bit conversion: When fxx/8 is selected for conversion clock with an 4.5 MHz fxx clock frequency, one clock cycle is [...]

  • Page 207

    S3C9228/P9228 A/D C ONVERTER 14- 3 Conversion Data Register ADDATAH/ADDATAL D1H/D2H, Page 0, Read Only .9 .8 .7 .6 .5 .4 .3 .2 MSB LSB (ADDATAH) ------ .1 .0 MSB LSB (ADDATAL) Figure 14-2. A/D Converter Data Register (ADDATAH/ADDATAL) INTERNAL REFERENCE VOLTAGE LEVELS In the ADC function block, the analog input voltage level is compared to the refe[...]

  • Page 208

    A/D CONVERTER S3C9 228/P9228 14- 4 S3C9228 AD0-AD3 Analog Input Pin V DD 101 C (V SS ≤ ADC input ≤ V DD ) Figure 14-4. Recommended A/D Converter Circuit for Highest Absolute Accuracy[...]

  • Page 209

    S3C9228/P9228 SERIAL I/O INTERFACE 1 5- 1 15 SERIAL I/O INTERFAC E OVERVIEW Serial I/O modules, SIO can interface with various types of external device that require serial data transfer. The components of SIO function block are: — 8-bit control register (S IOCON ) — Clock selector logic — 8-bit data buffer (SIODATA) — 8-bit prescaler (SIOPS[...]

  • Page 210

    SERIAL I/O INTERFACE S3C9228/P9228 15- 2 SIO CONTROL REGISTERS (SIOCON) The control register for serial I/O interface module, SIOCON, is located at E1H in page 0. It has the control setting for SIO module. — Clock source selection (internal or external) for shift clock — Interrupt enable — Edge selection for shift operation — Clear 3-bit co[...]

  • Page 211

    S3C9228/P9228 SERIAL I/O INTERFACE 1 5- 3 SIO PRE-SCALER REGISTER (SIOPS) The prescaler register for serial I/O interface module, SIOPS, are located at E3H in page 0. The value stored in the SIO pre-scale register, SIOPS, lets you determine the SIO clock rate (baud rate) as follows: Baud rate = Input clock (fxx/4)/( Prescaler value + 1), or SCK inp[...]

  • Page 212

    SERIAL I/O INTERFACE S3C9228/P9228 15- 4 SERIAL I/O TIMING DIAGRAM (SIO) SO Transmit Complete SIO INT Set SIOCON.3 DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0 DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0 SI SCK Figure 15-4 . Serial I/O Timing in Transmit/Receive Mode ( Tx at falling, SIOCON.4 = 0) SIO INT DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0 DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0 SCK [...]

  • Page 213

    S3C9228/P9228 ELECT RICAL DATA 16- 1 16 ELECTRICAL DATA OVERVIEW In this chapter, S3C9228/P9228 electrical characteristics are presented in tables and graphs. The information is arranged in the following order: — Absolute maximum ratings — D.C. electrical characteristics — Data retention supp ly voltage in Stop mode — Stop mode release timi[...]

  • Page 214

    ELECTRICAL DATA S3C 9228/P9228 16- 2 Table 16-1. Absolute Maximum Ratings (T A = 25 ° C) Parameter Symbol Conditions Rating Unit Supply voltage V DD – – 0.3 to + 6.5 V Input voltage V IN Ports 0 –6 – 0.3 to V DD + 0.3 V Output voltage V O – – 0.3 to V DD + 0.3 V Output current High I OH One I/O pin active – 15 mA All I/O pins active [...]

  • Page 215

    S3C9228/P9228 ELECT RICAL DATA 16- 3 Table 16-2. D.C. Electrical Characteristics (Continued) (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Parameter Symbol Conditions Min Typ Max Unit Input Low leakage current I LIL1 V I = 0 V; All input pins except RESET , X OUT , XT IN , XT OUT – – –3 µ A I LIL2 V I = 0 V; X IN , X OUT , XT IN , [...]

  • Page 216

    ELECTRICAL DATA S3C 9228/P9228 16- 4 Table 16-2. D.C. Electrical Characteristics (Concluded) (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Parameter Symbol Conditions Min Typ Max Unit Supply current (1) I DD1 Run mode: V DD = 5 V ± 10% 8.0 MHz – 6.0 12.0 mA Crystal oscillator C1 = C2 = 22pF 4.19 MHz 3.0 6.0 V DD = 3 V ± 10% 8.0 MHz 2.[...]

  • Page 217

    S3C9228/P9228 ELECT RICAL DATA 16- 5 Table 16-3. Data Retention Supply Voltage in Stop Mode (T A = – 25 ° C to + 85 ° C) Parameter Symbol Conditions Min Typ Max Unit Data retention supply voltage V DDDR – 2.0 – 5.5 V Data retention supply current I DDDR Stop mode, T A = 25 ° C V DDDR = 2.0 V ––1 µA Execution of STOP Instruction Idle M[...]

  • Page 218

    ELECTRICAL DATA S3C 9228/P9228 16- 6 Execution of STOP Instrction RESET Occurs ~ ~ V DDDR ~ ~ Stop Mode Oscillation Stabilization TIme Normal Operating Mode Data Retention Mode t WAIT RESET V DD 0.2 V DD 0.8 V DD NOTE: t WAIT is the same as 16 × 1/BT clock. Figure 16-2. Stop Mode Release Timing When Initiated by a RESET RESET Table 16-4. Input/Out[...]

  • Page 219

    S3C9228/P9228 ELECT RICAL DATA 16- 7 Table 16-5. A.C. Electrical Characteristics (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Parameter Symbol Conditions Min Typ Max Unit SCK cycle time t KCY External SCK source 1,000 – – ns Internal SCK source 1,000 SCK high, low width t KH , t KL External SCK source 500 Internal SCK source t KCY /2[...]

  • Page 220

    ELECTRICAL DATA S3C 9228/P9228 16- 8 Table 16-6. A/D Converter Electrical Characteristics (T A = – 25 ° C to + 85 ° C, V DD = 2.7 V to 5.5 V, V SS = 0 V) Parameter Symbol Conditions Min Typ Max Unit Resolution – 10 – bit Total accuracy VDD = 5.12 V – – ± 3 LSB Integral linearity error ILE fxx = 8 MHz – – ± 2 Differential linearity[...]

  • Page 221

    S3C9228/P9228 ELECT RICAL DATA 16- 9 RESET t RSL 0.2 V DD Figure 16-4. Input Timing for RESET RESET t KH t KL 0.2V DD SCK t KCY 0.8V DD 0.8V DD 0.2V DD t SIK t KSI SI SO t KSO Output Data Figure 16-5. Serial Data Transfer Timing[...]

  • Page 222

    ELECTRICAL DATA S3C 9228/P9228 16- 10 Table 16-7. Main Oscillation Characteristics (T A = – 25 ° C to + 85 ° C) Oscillator Clock Configuration Parameter Test Condition Min Typ Max Units Crystal X IN C1 X OUT Main oscillation frequency 2.7 V – 5.5 V 0.4 – 8 MHz 2.0 V – 5.5 V 0.4 – 4 Ceramic Oscillator X IN C1 X OUT Main oscillation frequ[...]

  • Page 223

    S3C9228/P9228 ELECT RICAL DATA 16- 11 Table 16-9. Main Oscillation Stabilization Time (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Oscillator Test Condition Min Typ Max Unit Crystal fx > 1 MHz – – 30 ms Ceramic Oscillation stabilization occurs when VDD is equal to the minimum oscillator voltage ranage. – – 10 ms External clock[...]

  • Page 224

    ELECTRICAL DATA S3C 9228/P9228 16- 12 Table 16-10. Sub Oscillation Stabilization Time (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Oscillator Test Condition Min Typ Max Unit Crystal – – – 10 s External clock XT IN input high and low width (t XH , t XL ) 5 – 15 µ s t XTH t XTL V DD -0.1 V 0.1 V XT IN 1/fxt Figure 16-7. Clock Timi[...]

  • Page 225

    S3C9228/P9228 ELECT RICAL DATA 16- 13 2 MHz 6.25 kHz (main)/8.2 kHz(sub) 1 2 6 Supply Voltage (V) Instruction Clock = 1/4n x oscillator frequency (n = 1, 2, 8, 16) 1.0 MHz Instruction Clock 8 MHz 4 MHz fx (Main/Sub oscillation frequency) 400 kHz 2.7 5.5 400 kHz (main)/32.8 kHz(sub) Figure 16-8. Operating Voltage Range[...]

  • Page 226

    ELECTRICAL DATA S3C 9228/P9228 16- 14 NOTES[...]

  • Page 227

    S3C9228/P9228 MECHANICAL DATA 1 7- 1 17 MECHANICAL DATA OVERVIEW The S3C9228/P9228 microcontroller is currently available in a 42-pin SDIP and 44-pin QFP package. NOTE : Dimensions are in millimeters. 39.50 MAX 39.10 ± 0 .2 0.50 ± 0.1 1.78 (1.77) 0.51 MIN 3.30 ± 0.3 3.50 ± 0.2 5.08 MAX 42-SDIP-600 0-15 1.00 ± 0.1 0.25 + 0.1 - 0.05 15.24 14.00 [...]

  • Page 228

    MECHANICAL DATA S3C9228/P9228 1 7- 2 44-QFP-1010B #44 NOTE : Dimensions are in millimeters. 10.00 ± 0.2 13.20 ± 0.3 10.00 ± 0.2 13.20 ± 0.3 #1 0.35 + 0.10 - 0.05 0.80 (1.00) 0.10 MAX 0.80 ± 0.20 0.05 MIN 2.05 ± 0.10 2.30 MAX 0.15 + 0.10 - 0.05 0-8 Figure 17-2. 44-QFP-1010B Package Dimensions[...]

  • Page 229

    S3C9228/P9228 S3P9228 OTP 18- 1 18 S3P9228 OTP OVERVIEW The S3P9228 single-chip CMOS microcontroller is the OTP (One Time Programmable) version of the S3C9228 microcontroller. It has an on-chip OTP ROM instead of masked ROM. The EPROM is accessed by serial data format. The S3P9228 is fully compatible with the S3C9228, both in function and in pin co[...]

  • Page 230

    S3P9228 OTP S3C9228/P9228 18- 2 COM1/P6.2 COM0/P6.3 P0.0/TAOUT/INT P0.1/T1CLK/INT P0.2/INT P0.3/BUZ/INT P1.0/AD0/INT P1.1/AD1/INT SDAT /P1.2/AD2/INT SCLK /P1.3/AD3/INT V DD /V DD V SS /V SS X OUT X IN V PP /TEST XT IN XT OUT RESET RESET / RESET P2.3 P2.2/SI SEG0/P2.1/SO S3C9228 (42-SDIP) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 COM2/P6[...]

  • Page 231

    S3C9228/P9228 S3P9228 OTP 18- 3 Table 18-1. Descriptions of Pins Used to Read/Write the EPROM Main Chip During Programming Pin Name Pin Name Pin No. I/O Function P1.2 SDAT 3 (9) I/O Serial data pin. Output port when reading and input port when writing. Can be assigned as a Input/push-pull output port. P1.3 SCLK 4 (10) I/O Serial clock pin. Input on[...]

  • Page 232

    S3P9228 OTP S3C9228/P9228 18- 4 Table 18-4. D.C. Electrical Characteristics (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Parameter Symbol Conditions Min Typ Max Unit Supply current (1) I DD1 Run mode: V DD = 5 V ± 10% 8.0 MHz – 6.0 12.0 mA Crystal oscillator C1 = C2 = 22pF 4.19 MHz 3.0 6.0 V DD = 3 V ± 10% 8.0 MHz 2.5 5.0 4.19 MHz 1.[...]

  • Page 233

    S3C9228/P9228 S3P9228 OTP 18- 5 2 MHz 6.25 kHz (main)/8.2 kHz(sub) 1 2 6 Supply Voltage (V) Instruction Clock = 1/4n x oscillator frequency (n = 1, 2, 8, 16) 1.0 MHz Instruction Clock 8 MHz 4 MHz fx (Main/Sub oscillation frequency) 400 kHz 2.7 5.5 400 kHz (main)/32.8 kHz(sub) Figure 18-3. Standard Operating Voltage Range[...]

  • Page 234

    S3P9228 OTP S3C9228/P9228 18- 6 NOTES[...]

  • Page 235

    S3C9228/P9228 DEVEL OPMENT TOOLS 19- 1 19 DEVELOPMENT TOOLS OVERVIEW Samsung provides a powerful and easy-to-use development support system in turn key form. The development support system is configured with a host system, debugging tools, and support software. For the host system, any standard computer that operates with MS-DOS as its operating sy[...]

  • Page 236

    DEVELOPMENT TOOLS S3C9228/P9228 19- 2 BUS SMDS2+ RS-232C POD Probe Adapter PROM/OTP Writer Unit RAM Break/Display Unit Trace/Timer Unit SAM8 Base Unit Power Supply Unit IBM-PC AT or Compatible TB9228 Target Board EVA Chip Target Application System Figure 19-1. SMDS Product Configuration (SMDS2+)[...]

  • Page 237

    S3C9228/P9228 DEVEL OPMENT TOOLS 19- 3 TB9228 TARGET BOARD The TB9228 target board is used for the S3C9228 microcontroller. It is supported by the SMDS2+ development system. TB9228 SM1347A GND V CC To User_V CC OFF ON SMDS2 SMDS2+ J101 42SDIP J102 44QFP 1 5 15 21 10 42 40 25 22 30 35 1 5 15 22 10 44 40 30 23 35 25 20 P2 25 160 30 20 10 1 150 140 13[...]

  • Page 238

    DEVELOPMENT TOOLS S3C9228/P9228 19- 4 Table 19-1. Power Selection Settings for TB9228 "To User_V CC " Settings Operating Mode Comments To User_V CC Off On Target System SMDS2/SMDS2+ TB9228 V CC V SS V CC The SMDS2/SMDS2+ supplies V CC to the target board (evaluation chip) and the target system. To User_V CC Off On Target System SMDS2/SMDS[...]

  • Page 239

    S3C9228/P9228 DEVEL OPMENT TOOLS 19- 5 SMDS2+ Selection (SAM8) In order to write data into program memory that is available in SMDS2+, the target board should be selected to be for SMDS2+ through a switch as follows. Otherwise, the program memory writing function is not available. Table 19-2. The SMDS2+ Tool Selection Setting "SW1" Settin[...]

  • Page 240

    DEVELOPMENT TOOLS S3C9228/P9228 19- 6 J101 42-SDIP J102 44-QFP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 43 44 45 46 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 50 49 48 47 P6.2 P6.3 P0.0 P0.1 P0.2 P0.3 P1.0 P1.1 P1.2 P1.3 USER_VCC VSS NC NC VSS NC NC DEMO_RSTB P2.3 P2.2 P2.1 NC NC NC NC P6.1 P6.0 P5.7 P5.6 P5.5 P5.4 [...]

  • Page 241

    S3C9228/P9228 DEVEL OPMENT TOOLS 19- 7 Target Board Target System Target Cable for Connector Part Name: AP42SD Order Code: SM6538 J101 1 42 21 22 J101 1 42 21 22 50-Pin DIP Connector Figure 19-4. S3C9228 Probe Adapter for 42-SDIP Package Target Board Target System 50-Pin Connector Target Cable for 50-pin Connector Part Name: AP50D-A Order Code: SM6[...]

  • Page 242

    DEVELOPMENT TOOLS S3C9228/P9228 19- 8 NOTES[...]

  • Page 243

    S3C9228/P9228 PRODUCT OVERVIEW 1- 1 1 PRODUCT OVERVIEW SAM8 8RC RI PRODUCT FAMILY Samsung's SAM88RCRI family of 8-bit single-chi p CMOS microcontrollers offer fast and efficient CPU, a wide range of integrated peripherals, and supports OTP device . A dual address/data bus architecture and bit- or nibble-configurable I/O ports provide a flexibl[...]

  • Page 244

    PRODUCT OVERVIEW S3C9228/P9228 1- 2 FEATURES CPU • SAM88RCRI CPU core Memory • 8192 × 8 bits program memory (ROM) • 264 × 8 bits data memory (RAM) (Including LCD data memory) Instruction Set • 41 instructions • Idle and Stop instructions added for power-down modes 36 I/O Pins • I/O: 34 pins (44-pin QFP, 42-pin SDIP) • Output only: 2[...]

  • Page 245

    S3C9228/P9228 PRODUCT OVERVIEW 1- 3 BLOCK DIAGRAM 8-Bit Timer/ CounterA Port I/O and Interrupt Control SAM88RCRI CPU RESET X IN XT IN I/O Port 0 8-Kbyte ROM 264-Byte Register File X OUT XT OUT 16-Bit Timer/ Counter1 8-Bit Timer/ CounterB TAOUT/ P0.0 T1CLK/ P0.1 P0.0/TAOUT/INT P0.1/T1CLK/INT P0.2/INT P0.3/BUZ/INT P0.4 P0.5 I/O Port 1 P1.0/AD0/INT P1[...]

  • Page 246

    PRODUCT OVERVIEW S3C9228/P9228 1- 4 PIN ASSIGNMENTS 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 S3C9228 (44-QFP) P1.0/AD0/INT P1.1/AD1/INT P1.2/AD2/INT P1.3/AD3/INT V DD V SS X OUT X IN TEST XT IN XT OUT RESET P2.3 P2.2/SI SEG0/P2.1/SO SEG1/P2.0/SCK SEG2/P3.1/INTP SEG3/P3.0/INTP SEG4/P4.0 SEG5/P4.1 SEG6/P4.2 SEG7/P4.3 33 32 31 30 29 28[...]

  • Page 247

    S3C9228/P9228 PRODUCT OVERVIEW 1- 5 COM1/P6.2 COM0/P6.3 P0.0/TAOUT/INT P0.1/T1CLK/INT P0.2/INT P0.3/BUZ/INT P1.0/AD0/INT P1.1/AD1/INT P1.2/AD2/INT P1.3/AD3/INT V DD V SS X OUT X IN TEST XT IN XT OUT RESET P2.3 P2.2/SI SEG0/P2.1/SO S3C9228 (42-SDIP) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 COM2/P6.1 COM3/P6.0 COM4/SEG19/P5.7 COM5/SEG18/[...]

  • Page 248

    PRODUCT OVERVIEW S3C9228/P9228 1- 6 PIN DESCRIPTIONS Table 1- 1 . Pin Descriptions Pin Names Pin Type Pin Description Circuit Number Pin Numbers Share Pins P0.0 P0.1 P0.2 P0.3 I/O 1-bit programmable I/O port. Schmitt trigger input or push-pull, open-drain output and software assignable pull-ups. E-4 39(3) 40(4) 41(5) 42(6) TAOUT/INT T1CLK/INT INT B[...]

  • Page 249

    S3C9228/P9228 PRODUCT OVERVIEW 1- 7 Table 1- 1 . Pin Descriptions (Continued) Pin Names Pin Type Pin Description Circuit Number Pin Numbers Share Pins V DD , V SS – Power input pins for internal power block – 5,6(11,12) – X OUT , X IN – Main oscillator pins for main clock – 7,8(13,14) XT OUT , XT IN – Sub oscillator pins for sub clock ?[...]

  • Page 250

    PRODUCT OVERVIEW S3C9228/P9228 1- 8 PIN CIRCUIT DIAGRAMS RESET V DD Pull-Up Resistor Noise Filter Figure 1-4. Pin Circuit Type B V DD Output Output Disable Data V SS Figure 1-5. Pin Circuit Type C[...]

  • Page 251

    S3C9228/P9228 PRODUCT OVERVIEW 1- 9 V DD Pull-up Enable V DD I/O Pull-up Resistor Output Disable Data External Interrupt Input Open-Drain Figure 1-7. Pin Circuit Type E-4 V DD I/O Pull-up Resistor Circuit Type E To ADC Data ADEN ADSELECT Open-Drain EN Data Output Disable Pull-up Enable Figure 1-8. Pin Circuit Type F-16A[...]

  • Page 252

    PRODUCT OVERVIEW S3C9228/P9228 1- 10 Out SEG/COM V LC3 Output Disable V LC2 V LC1 V SS V LC4 V LC5 Figure 1-9. Pin Circuit Type H-23[...]

  • Page 253

    S3C9228/P9228 PRODUCT OVERVIEW 1- 11 V DD Pull-up Enable V DD I/O Pull-up Resistor Data Open-Drain EN Circuit Type H-23 LCD Out EN COM/SEG Output Disable Figure 1-10. Pin Circuit Type H-32 V DD Pull-up Enable V DD I/O Pull-up Resistor Data Open-Drain EN Circuit Type H-23 LCD Out EN COM/SEG Output Disable Figure 1-11. Pin Circuit Type H-32A[...]

  • Page 254

    PRODUCT OVERVIEW S3C9228/P9228 1- 12 V DD Pull-up Enable V DD I/O Pull-up Resistor Data Open-Drain EN Circuit Type H-23 LCD Out EN COM/SEG Output Disable Port Enable (LMOD.5) Figure 1-12. Pin Circuit Type H-32B[...]

  • Page 255

    S3C9228/P9228 ADDRESS SPACES 2- 1 2 ADDRESS SPACES OVERVIEW The S3C9228/P9228 microcontroller has three kinds of address space: — Program memory (ROM) — Internal register file — LCD display register file A 16 -bit address bus supports program memory operations. Special instructions and related internal logic determine when the 1 6 -bit bus ca[...]

  • Page 256

    ADDRESS SPACES S3C9228/P9228 2- 2 PROGRAM MEMORY (ROM) Program memory (ROM) stores program code or table data. The S3C9228 has 8K bytes of mask- programable program memory. The program memory address range is therefore 0H-1FFFH. The first 2 bytes of the ROM (0000H– 0001H) are an interrupt vector address. The program reset address in the ROM is 01[...]

  • Page 257

    S3C9228/P9228 ADDRESS SPACES 2- 3 REGISTER ARCHITECTURE The upper 72 bytes of the S3C9228/P9228 's internal register file are addressed as working registers, system cont r ol registe r s and periphe r al control registers. The lower 184 bytes of internal register file (00H– B7 H) is called the general purpose register space . For many SAM88R[...]

  • Page 258

    ADDRESS SPACES S3C9228/P9228 2- 4 COMMON WORKING REGISTER AREA (C0H–CFH) The SAM88RCR I register architecture provides an efficient method of working register addressing that takes full advantage of shorter instruction formats to reduce execution time. This16-byte address range is called common area. That is, locations in this area can be used as[...]

  • Page 259

    S3C9228/P9228 ADDRESS SPACES 2- 5 SYSTEM STACK S 3C9 -series microcontrollers use the system stack for subroutine calls and returns and to store data. The PUSH and POP instructions are used to control system stack operations. The S3C9228/P9228 architecture supports stack operations in the internal register file. STACK OPERATIONS Return addresses fo[...]

  • Page 260

    ADDRESS SPACES S3C9228/P9228 2- 6 + + PROGRAMMING TIP — Standard Stack Operations Using PUSH and POP The following example shows you how to perform stack operations in the internal register file using PUSH and POP instructions: LD SP,#0 B8 H ; SP ← B8 H (Normally, the SP is set to 0 B8 H by the ; initialization routine) • • • PUSH SYM ; S[...]

  • Page 261

    S3C9228/P9228 ADDRESSING MODES 3- 1 3 ADDRESSING MODES OVERVIEW Instructions that are stored in program memory are fetched for execution using the program counter. Instructions indicate the operation to be performed and the data to be operated on. Addressing mode is the method used to determine the location of the data operand. The operands specifi[...]

  • Page 262

    ADDRESSING MODES S3C9228/P9228 3- 2 REGISTER ADDRESSING MODE (R) In Register addressing mode, the operand is the content of a specified register (see Figure 3- 1). Working register addressing differs from Register a ddressing because it uses a 16- byte working register s pace in the register file and a 4-bit register within that space (see Figure 3[...]

  • Page 263

    S3C9228/P9228 ADDRESSING MODES 3- 3 INDIRECT REGISTER ADDRESSING MODE (IR) In Indirect Register (IR) addressing mode, the content of the specified register or register pair is the address of the operand. Depending on the instruction used, the actual address may point to a register in the register file, to program memory (ROM), or to an external mem[...]

  • Page 264

    ADDRESSING MODES S3C9228/P9228 3- 4 INDIRECT REGISTER ADDRESSING MODE ( C ontinued ) dst OPCODE PAIR Points to Rigister Pair Example Instruction References Program Memory Sample Instructions: CALL @RR2 JP @RR2 Program Memory Register File Value used in Instruction OPERAND REGISTER Program Memory 16-Bit Address Points to Program Memory Figure 3- 4 .[...]

  • Page 265

    S3C9228/P9228 ADDRESSING MODES 3- 5 INDIRECT REGISTER ADDRESSING MODE (C ontinued ) dst OPCODE OPERAND 4-Bit Working Register Address Point to the Woking Register (1 of 16) Sample Instruction: OR R6, @R2 Program Memory Register File src 4 LSBs Value used in Instruction OPERAND CFH C0H . . . . Figure 3- 5 . Indirect Working Register Addressing to Re[...]

  • Page 266

    ADDRESSING MODES S3C9228/P9228 3- 6 INDIRECT REGISTER ADDRESSING MODE (C oncluded ) dst OPCODE 4-Bit Working Register Address Sample Instructions: LCD R5,@RR6 ; Program memory access LDE R3,@RR14 ; External data memory access LDE @RR4, R8 ; External data memory access Program Memory Register File src Value used in Instruction OPERAND Example Instru[...]

  • Page 267

    S3C9228/P9228 ADDRESSING MODES 3- 7 INDEXED ADDRESSING MODE (X) Indexed (X) addressing mode adds an offset value to a base address during instruction execution in order to calculate the effective operand address (see Figure 3- 7). You can use Indexed addressing mode to access locations in the internal register file or in external memory. In short o[...]

  • Page 268

    ADDRESSING MODES S3C9228/P9228 3- 8 INDEXED ADDRESSING MODE (C ontinued ) Point to Working Register Pair (1 of 8) LSB Selects 16-Bit address added to offset dst OPCODE Program Memory XS (OFFSET) 4-Bit Working Register Address Sample Instructions: LDC R4, #04H[RR2] ; The values in the program address (RR2 + #04H) are loaded into register R4. LDE R4,[...]

  • Page 269

    S3C9228/P9228 ADDRESSING MODES 3- 9 INDEXED ADDRESSING MODE (C oncluded ) Point to Working Register Pair (1 of 8) LSB Selects 16-Bit address added to offset Program Memory 4-Bit Working Register Address Sample Instructions: LDC R4, #1000H[RR2] ; The values in the program address (RR2 + #1000H) are loaded into register R4. LDE R4, #1000H[RR2] ; Iden[...]

  • Page 270

    ADDRESSING MODES S3C9228/P9228 3- 10 DIRECT ADDRESS MODE (DA) In Direct Address (DA) mode, the instruction provides the operand's 16-bit memory address. Jump (JP) and Call (CALL) instructions use this addressing mode to specify the 16-bit destination address that is loaded into the PC whenever a JP or CALL instruction is executed. The LDC and [...]

  • Page 271

    S3C9228/P9228 ADDRESSING MODES 3- 11 DIRECT ADDRESS MODE (C ontinued ) OPCODE Program Memory Upper Address Byte Program Memory Address Used Lower Address Byte Sample Instructions: JP C,JOB1 ; Where JOB1 is a 16-bit immediate address CALL DISPLAY ; Where DISPLAY is a 16-bit immediate address Next OPCODE Figure 3- 11 . Direct Addressing for Call and [...]

  • Page 272

    ADDRESSING MODES S3C9228/P9228 3- 12 RELATIVE ADDRESS MODE (RA) In Relative Address (RA) mode, a two's-complement signed displacement between – 128 and + 127 is specified in the instruction. The displacement value is then added to the current PC value. The result is the address of the next instruction to be executed. Before this addition occ[...]

  • Page 273

    S3C9228/P9228 CONTROL REGISTERS 4- 1 4 CONTROL REGISTERS OVERVIEW In this section, detailed descriptions of the S3C9228/P9228 control registers are presented in an easy-to-read format. These descriptions will help familiarize you with the mapped locations in the register file. You can also use them as a quick-reference source when writing applicati[...]

  • Page 274

    CONTROL REGISTERS S3C9228/P9228 4- 2 Table 4-1. Sys tem and Peripheral C ontrol Registers (Page 0) Register Name Mnemonic Address (Page 0) R/W Decimal Hex Port 0 Control Register P0CON 235 EBH R/W Port 0 Pull-up Resistor Enable Register P0PUR 236 ECH R/W Port 0 Interrupt Control Register P0INT 237 EDH R/W Port 0 Interrupt Edge Selection Register P0[...]

  • Page 275

    S3C9228/P9228 CONTROL REGISTERS 4- 3 Table 4- 1. Sys tem and Peripheral C ontrol Registers (Page 0) Register Name Mnemonic Address (Page 0) R/W Decimal Hex Locations D8H-B9H are not mapped. Timer B Control Register TBCON 202 BAH R/W Timer 1/A Control Register TACON 203 BBH R/W Timer B Data Register TBDATA 204 BCH R/W Timer A Data Register TADATA 20[...]

  • Page 276

    CONTROL REGISTERS S3C9228/P9228 4- 4 FLAGS - System Flags Register .7 .6 .5 Bit Identifier RESET RESET Value Read/Write R = Read-only W = Write-only R/W = Read/write ' - ' = Not used Bit number: MSB = Bit 7 LSB = Bit 0 Addressing mode or modes you can use to modify register values Description of the effect of specific bit settings RESET v[...]

  • Page 277

    S3C9228/P9228 CONTROL REGISTERS 4- 5 AD C ON — A/D Converter Co ntrol Register D 0 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––000000 Read/Write – – R/W R/W R R/W R/W R/W .7-.6 Not used for the S3C9228/P9228 .5- . 4 A/D Input Pin Selection Bits 0 0 AD0 (P1.0) 0 1 AD1 (P1.1) 1 0 AD2 (P1.2) 1 1 AD3 (P1.3) .3 End of Conversi[...]

  • Page 278

    CONTROL REGISTERS S3C9228/P9228 4- 6 BTC ON — Basic Timer Co ntrol Register DCH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7- .4 Watchdog Timer En able Bits 1010 Disable watchdog function Any other value Enable watchdog function .3- .2 Basic Timer Input Clock Selection Bits 0 0 f [...]

  • Page 279

    S3C9228/P9228 CONTROL REGISTERS 4- 7 CLKCON — System Clock Control Register D4H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 Oscillator IRQ Wake-up Function Bit 0 Enable IRQ for main or sub oscillator wake-up in power down mode 1 Disable IRQ for main or sub oscillator wake-up in p[...]

  • Page 280

    CONTROL REGISTERS S3C9228/P9228 4- 8 FLAGS — System Flags Register D5H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value xxxx –––– Read/Write R/W R/W R/W R/W –––– .7 Carry Flag (C) 0 Operation does not generate a carry or borrow condition .6 Zero Flag (Z) 0 Operation result is a non-zero value 1 Operation result is zero .5 [...]

  • Page 281

    S3C9228/P9228 CONTROL REGISTERS 4- 9 INTPND1 — Interrupt Pending Register 1 D6 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 P1.3's Interrupt Pending Bit 0 No interrupt pending (when read), clear pending bit (when write) 1 Interrupt is pending (when read) .6 P1.2's Inte[...]

  • Page 282

    CONTROL REGISTERS S3C9228/P9228 4- 10 INTPND2 — Interrupt Pending Register 2 D7 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––000000 Read/Write – – R/W R/W R/W R/W R/W R/W .7 -.6 Not used for S3C9228/P9228 . 5 P3.1 (INTP) Interrupt Pending Bit 0 No interrupt pending (when read), clear pending bit (when write) 1 Interrupt is[...]

  • Page 283

    S3C9228/P9228 CONTROL REGISTERS 4- 11 LMOD — LCD Mode Control Register FE H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value –0000000 Read/Write – R/W R/W R/W R/W R/W R/W R/W .7 Not used for S3C9228/P9228 .6 COM Pins High Impedance Control Bit 0 Normal COMs signal output 1 COM pins are at high impedance .5 Port3 High Impedance Control[...]

  • Page 284

    CONTROL REGISTERS S3C9228/P9228 4- 12 LPOT — LCD Port Control Register D8 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value –0000000 Read/Write – R/W R/W R/W R/W R/W R/W R/W .7 Not used for S3C9228/P9228 .6-.4 SEG4-SEG19 and COM0-COM3 Selection Bit SEG4-7 SEG8-11 SEG12-15 SEG16-19/ COM7-COM4 COM0-3 P4.0-P4.3 P4.4-P4.7 P5.0-P5.3 P5.4-[...]

  • Page 285

    S3C9228/P9228 CONTROL REGISTERS 4- 13 OSCCON — Oscillator Control Register D3 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––00–0 Read/Write –––– R/W R/W – R/W .7 -.4 Not used for S3C9228/P9228 .3 Main Oscillator Control Bit 0 Main oscillator RUN 1 Main oscillator STOP .2 Sub Oscillator Control Bit 0 Sub oscill[...]

  • Page 286

    CONTROL REGISTERS S3C9228/P9228 4- 14 P0CON – Port 0 Control Register EBH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P0.3/BUZ/INT Configuration Bits 0 0 Schmitt trigger input 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Alternative function (BUZ output) .5-.4 P0.2[...]

  • Page 287

    S3C9228/P9228 CONTROL REGISTERS 4- 15 P0INT –Port 0 Interrupt Enable Register EDH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P0.3's Interrupt Enable Bit 0 Disable interrupt 1 Enable interrupt .2 P0.2's Interrupt Enable Bit 0 Disabl[...]

  • Page 288

    CONTROL REGISTERS S3C9228/P9228 4- 16 P0PUR –Port 0 Pull-up Resistors Enable Register ECH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P0.3's Pull-up Resistor Enable Bit 0 Disable pull-up resistor 1 Enable pull-up resistor .2 P0.2's [...]

  • Page 289

    S3C9228/P9228 CONTROL REGISTERS 4- 17 P0EDGE –Port 0 Interrupt Edge Selection Register EEH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P0.3's Interrupt Edge Setting Bit 0 Falling edge interrupt 1 Rising edge interrupt .2 P0.2's Inte[...]

  • Page 290

    CONTROL REGISTERS S3C9228/P9228 4- 18 P1CON – Port 1 Control Register EFH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P1.3/AD3/INT Configuration Bits 0 0 Schmitt trigger input 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Alternative function (ADC mode) .5-.4 P1.2/A[...]

  • Page 291

    S3C9228/P9228 CONTROL REGISTERS 4- 19 P1INT –Port 1 Interrupt Enable Register F1H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P1.3's Interrupt Enable Bit 0 Disable interrupt 1 Enable interrupt .2 P1.2's Interrupt Enable Bit 0 Disabl[...]

  • Page 292

    CONTROL REGISTERS S3C9228/P9228 4- 20 P1PUR –Port 1 Pull-up Resistors Enable Register F0H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P1.3's Pull-up Resistor Enable Bit 0 Disable pull-up resistor 1 Enable pull-up resistor .2 P1.2's [...]

  • Page 293

    S3C9228/P9228 CONTROL REGISTERS 4- 21 P1EDGE –Port 1 Interrupt Edge Selection Register F2H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P1.3's Interrupt Edge Setting Bit 0 Falling edge interrupt 1 Rising edge interrupt .2 P1.2's Inte[...]

  • Page 294

    CONTROL REGISTERS S3C9228/P9228 4- 22 P2CON – Port 2 Control Register F3H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P2.3 Configuration Bits 0 0 Schmitt trigger input 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Not available .5-.4 P2.2/SI Configuration Bits 0 0 S[...]

  • Page 295

    S3C9228/P9228 CONTROL REGISTERS 4- 23 P2PUR –Port 2 Pull-up Resistors Enable Register F4H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 P2.3's Pull-up Resistor Enable Bit 0 Disable pull-up resistor 1 Enable pull-up resistor .2 P2.2's [...]

  • Page 296

    CONTROL REGISTERS S3C9228/P9228 4- 24 P3CON – Port 3 Control Register F5H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3-.2 P3.1/SEG2/INTP Configuration Bits 0 0 Schmitt trigger input 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Not [...]

  • Page 297

    S3C9228/P9228 CONTROL REGISTERS 4- 25 P3INT –Port 3 Interrupt Enable Register F7H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––––00 Read/Write –––––– R/W R/W .7-.2 Not used for S3C9228/P9228 .1 P3.1's Interrupt Enable Bit 0 Disable interrupt 1 Enable interrupt .0 P3.0's Interrupt Enable Bit 0 Disa[...]

  • Page 298

    CONTROL REGISTERS S3C9228/P9228 4- 26 P3PUR –Port 3 Pull-up Resistors Enable Register F6H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––––00 Read/Write –––––– R/W R/W .7-.2 Not used for S3C9228/P9228 .1 P3.1's Pull-up Resistor Enable Bit 0 Disable pull-up resistor 1 Enable pull-up resistor .0 P3.0'[...]

  • Page 299

    S3C9228/P9228 CONTROL REGISTERS 4- 27 P3EDGE –Port 3 Interrupt Edge Selection Register F8H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––––00 Read/Write –––––– R/W R/W .7-.4 Not used for S3C9228/P9228 .1 P3.1's Interrupt State Setting Bit 0 Falling edge interrupt 1 Rising edge interrupt .0 P3.0's I[...]

  • Page 300

    CONTROL REGISTERS S3C9228/P9228 4- 28 P4CONH – Port 4 Control Register High Byte F9H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P4.7/SEG11 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P4.6/SEG10 Configura[...]

  • Page 301

    S3C9228/P9228 CONTROL REGISTERS 4- 29 P4CONL –Port 4 Control Register Low Byte FAH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7-.6 P4.3/SEG7 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P4.2/SEG6 Configuration[...]

  • Page 302

    CONTROL REGISTERS S3C9228/P9228 4- 30 P5CONH – Port 5 Control Register High Byte FBH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 -.6 P5.7/SEG19/COM4 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P5.6/SEG18/COM[...]

  • Page 303

    S3C9228/P9228 CONTROL REGISTERS 4- 31 P5CONL – Port 5 Control Register Low Byte FCH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 -.6 P5.3/SEG15 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P5.2/SEG14 Configura[...]

  • Page 304

    CONTROL REGISTERS S3C9228/P9228 4- 32 P6CON – Port 6 Control Register High Byte FDH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 -.6 P6.3/COM0 Configuration Bits 0 0 Input mode 0 1 Push-pull output 1 0 N-channel open-drain output 1 1 Input, pull-up mode .5-.4 P6.2/COM1 Configurati[...]

  • Page 305

    S3C9228/P9228 CONTROL REGISTERS 4- 33 SIOCON — SIO Control Register E1 H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 0000000– Read/Write R/W R/W R/W R/W R/W R/W R/W – .7 SIO Shift Clock Selection Bit 0 Internal clock ( P.S clock) 1 External clock (SCK) .6 Data Direction Control Bit 0 MSB-first mode 1 LSB-first mode . 5 SIO Mode S[...]

  • Page 306

    CONTROL REGISTERS S3C9228/P9228 4- 34 STPCON – Stop Control Register E0H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 00000000 Read/Write R/W R/W R/W R/W R/W R/W R/W R/W .7 Stop Control Bits 1 0100101 Enable Stop instruction Other values Disable Stop instruction NOTE: Before executing the STOP instruction, the STPCON register must be [...]

  • Page 307

    S3C9228/P9228 CONTROL REGISTERS 4- 35 SYM — System Mode Register DFH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value ––––0000 Read/Write –––– R/W R/W R/W R/W .7-.4 Not used for S3C9228/P9228 .3 Global Interrupt Enable Bit 0 G lobal interrupt processing disable (DI instruction) 1 G lobal interrupt processing enable (EI ins[...]

  • Page 308

    CONTROL REGISTERS S3C9228/P9228 4- 36 T A CON — Timer 1/A Control Register BBH Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 0 000000– Read/Write R/W R/W R/W R/W R/W R/W R/W – .7 Timer 1 Mode Selection Bit 0 Two 8-bit timers mode (Timer A/B) 1 One 16-bit timer mode (Timer 1) .6-.4 Timer 1/A Clock Selection Bits 000 fxx/512 001 fxx/[...]

  • Page 309

    S3C9228/P9228 CONTROL REGISTERS 4- 37 T B CON — Timer B Control Register BA H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value –000000– Read/Write – R/W R/W R/W R/W R/W R/W – .7 Not used for S3C9228/P9228 .6-.4 Timer B Clock Selection Bits 000 fxx/512 001 fxx/256 010 fxx/64 011 fxx/8 100 fxx (system clock) 101 fxt (sub clock) .3 T[...]

  • Page 310

    CONTROL REGISTERS S3C9228/P9228 4- 38 WTCON — Watch Timer Control Register DA H Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0 RESET RESET Value 0000000– Read/Write R/W R/W R/W R/W R/W R/W R/W – .7 Watch Timer Clock Selection Bit 0 Select main clock divided by 2 7 (fx/128) 1 Select sub clock ( fxt) .6 Watch Timer Interrupt Enable Bit 0 Disable watch [...]

  • Page 311

    S3C9228/P9228 INTERRUPT STRUCTURE 5- 1 5 INTERRUPT STRUCTURE OVERVIEW The SAM88RCRI interrupt structure has two basic components: a vector, and sources. The number of interrupt sources can be serviced through a interrupt vector which is assigned in ROM address 0000H–0001H. SOURCES VECTOR S1 S2 S3 Sn 0000H 0001H NOTES: 1. The SAM88RCRI interrupt h[...]

  • Page 312

    INTERRUPT STRUCTURE S3C9228/P9228 5- 2 INTERRUPT PENDING FUNCTION TYPES When the interrupt service routine has executed, the application program's service routine must clear the appropriate pending bit before the return from interrupt subroutine (IRET) occurs. INTERRUPT PRIORITY Because there is not a interrupt priority register in SAM87 RCR I[...]

  • Page 313

    S3C9228/P9228 INTERRUPT STRUCTURE 5- 3 INTERRUPT SOURCE SERVICE SEQUENCE The interrupt request polling and servicing sequence is as follows: 1. A source generates an interrupt request by setting the interrupt request pending bit to "1". 2. The CPU generates an interrupt acknowledge signal. 3. The service routine starts and the source&apos[...]

  • Page 314

    INTERRUPT STRUCTURE S3C9228/P9228 5- 4 S3C9228/P9228 INTERRUPT STRUCTURE The S3C9228/P9228 microcontroller has fourteen peripheral interrupt sources: — Timer 1/A interr upt — Timer B interrupt — SIO interrupt — Watch Timer interrupt — Four external interrupts for port 0 — Four external interrupts for port 1 — Two external interrupts f[...]

  • Page 315

    S3C9228/P9228 INTERRUPT STRUCTURE 5- 5 SYM.3 (EI, DI) P0INT.0 P0.0 External Interript P0INT.1 P0.1 External Interript P0.3 External Interript P0.2 External Interript P0INT.2 P0INT.3 INTPND1.0 INTPND1.1 INTPND1.2 INTPND1.3 P1.0 External Interript P1INT.0 P1.2 External Interript P1.3 External Interrupt P1.1 External Interript P1INT.1 P1INT.2 P1INT.3 [...]

  • Page 316

    INTERRUPT STRUCTURE S3C9228/P9228 5- 6 Programming Tip — How to clear an interrupt pending bit As the following examples are shown, a load instruction should be used to clear an interrupt pending bit. Examples: 1. LD INTPND1, #11111011B ; Clear P0.2's interrupt pending bit • • • IRET 2. L D INTPND2, #11110111B ; Clear watch timer inter[...]

  • Page 317

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 1 6 SAM8 8RC R I INSTRUCTION SET OVERVIEW The SAM88RCRI instruction set is designed to support the large register file. It includes a full complement of 8- bit arithmetic and logic operations. There are 41 instructions. No special I/O instructions are necessary because I/O control and data registers ar[...]

  • Page 318

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 2 Table 6- 1. Instruction Group Summary Mnemonic Operands Instruction Load Instructions CLR dst Clear LD dst,src Load LDC dst,src Load program memory LDE dst,src Load external data memory LDCD dst,src Load program memory and decrement LDED dst,src Load external data memory and decrement LDCI dst,src Load [...]

  • Page 319

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 3 Table 6- 1 . Instruction Group Summary (Continued) Mnemonic Operands Instruction Program Control Instructions CALL dst Call procedure IRET Interrupt return JP cc,dst Jump on condition code JP dst Jump unconditional JR cc,dst Jump relative on condition code RET Return Bit Manipulation Instructions TCM[...]

  • Page 320

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 4 FLAGS REGISTER (FLAGS) The FLAGS register contains eight bits that describe the current status of CPU operations. Four of these bits, FLAGS.4 – FLAGS.7, can be tested and used with conditional jump instructions; FLAGS register can be set or reset by instructions as long as its outcome does not affect [...]

  • Page 321

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 5 INSTRUCTION SET NOTATION Table 6- 2 . Flag Notation Conventions Flag Description C Carry flag Z Zero flag S Sign flag V Overflow flag 0 Cleared to logic zero 1 Set to logic one * Set or cleared according to operation – Value is unaffected x Value is undefined Table 6- 3 . Instruction Set Symbols Sy[...]

  • Page 322

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 6 Table 6- 4 . Instruction Notation Conventions Notation Description Actual Operand Range cc Condition code See list of condition codes in Table 6- 6. r Working register only Rn (n = 0–15) rr Working register pair RRp (p = 0, 2, 4, ..., 14) R Register or working register reg or Rn ( reg = 0–255, n = 0[...]

  • Page 323

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 7 Table 6- 5 . Opcode Quick Reference OPCODE MAP LOWER NIBBLE (HEX) – 0123456 7 U 0 DEC R1 DEC IR1 ADD r1,r2 ADD r1,Ir2 ADD R2,R1 ADD IR2,R1 ADD R1,IM P 1 RLC R1 RLC IR1 ADC r1,r2 ADC r1,Ir2 ADC R2,R1 ADC IR2,R1 ADC R1,IM P 2 INC R1 INC IR1 SUB r1,r2 SUB r1,Ir2 SUB R2,R1 SUB IR2,R1 SUB R1,IM E 3 JP I[...]

  • Page 324

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 8 Table 6- 5 . Opcode Quick Reference (Continued) OPCODE MAP LOWER NIBBLE (HEX) – 8 9 A B C D E F U 0 LD r1,R2 LD r2,R1 JR cc,RA LD r1,IM JP cc,DA INC r1 P 1 ↓↓ ↓↓↓↓ P 2 E 3 R 4 5 N 6 IDLE I 7 ↓↓ ↓↓↓↓ STOP B 8 DI B 9 EI L A RE T E B IRET C RCF H D ↓↓ ↓↓↓↓ SCF E E CCF [...]

  • Page 325

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 9 CONDITION CODES The opcode of a conditional jump always contains a 4-bit field called the condition code (cc). This specifies under which conditions it is to execute the jump. For example, a conditional jump with the condition code for "equal" after a compare operation only jumps if the two[...]

  • Page 326

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 10 INSTRUCTION DESCRIPTIONS This section contains detailed information and programming examples for each instruction in the SAM88RCRI instruction set. Information is arranged in a consistent format for improved readability and for fast referencing. The following information is included in each instruction[...]

  • Page 327

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 11 ADC — Add With Carry ADC dst,src Operation: dst ¨ dst + src + c The source operand, along with the setting of the carry flag, is added to the destination operand and the sum is stored in the destination. The contents of the source are unaffected. Two's- complement addition is performed. In m[...]

  • Page 328

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 12 ADD — Add ADD dst,src Operation: dst ¨ dst + src The source operand is added to the destination operand and the sum is stored in the destination. The contents of the source are unaffected. Two's-complement addition is performed. Flags: C: Set if there is a carry from the most significant bit of[...]

  • Page 329

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 13 AND — Logical AND AND dst,src Operation: dst ¨ dst AND src The source operand is logically ANDed with the destination operand. The result is stored in the destination. The AND operation results in a "1" bit being stored whenever the corresponding bits in the two operands are both logic [...]

  • Page 330

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 14 CALL — Call Procedure CALL dst Operation: SP ¨ SP – 1 @SP ¨ PCL SP ¨ SP –1 @SP ¨ PCH PC ¨ dst The current contents of the program counter are pushed onto the top of the stack. The program counter value used is the address of the first instruction following the CALL instruction. The specified[...]

  • Page 331

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 15 CCF — Complement Carry Flag CCF Operation: C ¨ NOT C The carry flag (C) is complemented. If C = "1", the value of the carry flag is changed to logic zero; if C = "0", the value of the carry flag is changed to logic one. Flags: C: Complemented. No other flags are affected. Form[...]

  • Page 332

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 16 CLR — Clear CLR dst Operation: dst ¨ "0" The destination location is cleared to "0". Flags: No flags are affected. Format: Bytes Cycles Opcode (Hex) Addr Mode dst opc dst 2 4 B0 R 4 B1 IR Examples: Given: Register 00H = 4FH, register 01H = 02H, and register 02H = 5EH: CLR 00H →[...]

  • Page 333

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 17 COM — Complement COM dst Operation: dst ¨ NOT dst The contents of the destination location are complemented (one's complement); all "1s" are changed to "0s", and vice-versa. Flags: C: Unaffected. Z: Set if the result is "0"; cleared otherwise. S: Set if the resu[...]

  • Page 334

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 18 CP — Compare CP dst,src Operation: dst – src The source operand is compared to (subtracted from) the destination operand, and the appropriate flags are set accordingly. The contents of both operands are unaffected by the comparison. Flags: C: Set if a "borrow" occurred ( src > dst); cl[...]

  • Page 335

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 19 DEC — Decrement DEC dst Operation: dst ¨ dst – 1 The contents of the destination operand are decremented by one. Flags: C: Unaffected. Z: Set if the result is "0"; cleared otherwise. S: Set if result is negative; cleared otherwise. V: Set if arithmetic overflow occurred, that is, dst [...]

  • Page 336

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 20 DI — Disable Interrupts DI Operation: SYM (2) ¨ 0 Bit zero of the system mode register, SYM.2, is cleared to "0", globally disabling all interrupt processing. Interrupt requests will continue to set their respective interrupt pending bits, but the CPU will not service them while interrupt [...]

  • Page 337

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 21 EI — Enable Interrupts EI Operation: SYM (2) ¨ 1 An EI instruction sets bit 2 of the system mode register, SYM.2 to "1". This allows interrupts to be serviced as they occur. If an interrupt's pending bit was set while interrupt processing was disabled (by executing a DI instruction[...]

  • Page 338

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 22 IDLE — Idle Operation IDLE Operation: The IDLE instruction stops the CPU clock while allowing system clock oscillation to continue. Idle mode can be released by an interrupt request (IRQ) or an external reset operation. Flags: No flags are affected. Format: Bytes Cycles Opcode (Hex) Addr Mode dst src[...]

  • Page 339

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 23 INC — Increment INC dst Operation: dst ¨ dst + 1 The contents of the destination operand are incremented by one. Flags: C: Unaffected. Z: Set if the result is "0"; cleared otherwise. S: Set if the result is negative; cleared otherwise. V: Set if arithmetic overflow occurred, that is dst[...]

  • Page 340

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 24 IRET — Interrupt Return IRET IRET Operation: FLAGS ¨ @SP SP ¨ SP + 1 PC ¨ @SP SP ¨ SP + 2 SYM(2) ¨ 1 This instruction is used at the end of an interrupt service routine. It restores the flag register and the program counter. It also re-enables global interrupts. Flags: All flags are restored to [...]

  • Page 341

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 25 JP — Jump JP cc,dst (Conditional) JP dst (Unconditional) Operation: If cc is true, PC ¨ dst The conditional JUMP instruction transfers program control to the destination address if the condition specified by the condition code (cc) is true; otherwise, the instruction following the JP instruction [...]

  • Page 342

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 26 JR — Jump Relative JR cc,dst Operation: If cc is true, PC ¨ PC + dst If the condition specified by the condition code (cc) is true, the relative address is added to the program counter and control passes to the statement whose address is now in the program counter; otherwise, the instruction followi[...]

  • Page 343

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 27 LD — Load LD dst,src Operation: dst ¨ src The contents of the source are loaded into the destination. The source's contents are unaffected. Flags: No flags are affected. Format: Bytes Cycles Opcode (Hex) Addr Mode dst src dst | opc src 2 4 rC r IM 4 r8 r R src | opc dst 2 4 r9 R r r = 0 to F[...]

  • Page 344

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 28 LD — Load LD (Continued) Examples: Given: R0 = 01H, R1 = 0AH, register 00H = 01H, register 01H = 20H, register 02H = 02H, LOOP = 30H, and register 3AH = 0FFH: LD R0,#10H → R0 = 10H LD R0,01H → R0 = 20H, register 01H = 20H LD 01H,R0 → Register 01H = 01H, R0 = 01H LD R1,@R0 → R1 = 20H, R0 = 01H[...]

  • Page 345

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 29 LDC/LDE — Load Memory LDC/LDE dst,src Operation: dst ¨ src This instruction loads a byte from program or data memory into a working register or vice-versa. The source values are unaffected. LDC refers to program memory and LDE to data memory. The assembler makes ' Irr' or ' rr&apos[...]

  • Page 346

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 30 LDC/LDE — Load Memory LDC/LDE (Continued) Examples: Given: R0 = 11H, R1 = 34H, R2 = 01H, R3 = 04H, R4 = 00H, R5 = 60H; Program memory locations 0061 = AAH, 0103H = 4FH, 0104H = 1A, 0105H = 6DH, and 1104H = 88H. External data memory locations 0061H = BBH, 0103H = 5FH, 0104H = 2AH, 0105H = 7DH, and 110[...]

  • Page 347

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 31 LDCD/LDED — Load Memory and Decrement LDCD/LDED dst,src Operation: dst ¨ src rr ¨ rr – 1 These instructions are used for user stacks or block transfers of data from program or data memory to the register file. The address of the memory location is specified by a working register pair. The cont[...]

  • Page 348

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 32 LDCI/LDEI — Load Memory and Increment LDCI/LDEI dst,src Operation: dst ¨ src rr ¨ rr + 1 These instructions are used for user stacks or block transfers of data from program or data memory to the register file. The address of the memory location is specified by a working register pair. The contents [...]

  • Page 349

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 33 NOP — No Operation NOP Operation: No action is performed when the CPU executes this instruction. Typic ally, one or more NOPs are executed in sequence in order to effect a timing delay of variable duration. Flags: No flags are affected. Format: Bytes Cycles Opcode (Hex) opc 1 4 FF Example: When th[...]

  • Page 350

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 34 OR — Logical OR OR dst,src Operation: dst ¨ dst OR src The source operand is logically ORed with the destination operand and the result is stored in the destination. The contents of the source are unaffected. The OR operation results in a "1" being stored whenever either of the correspondi[...]

  • Page 351

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 35 POP — Pop From Stack POP dst Operation: dst ¨ @SP SP ¨ SP + 1 The contents of the location addressed by the stack pointer are loaded into the destination. The stack pointer is then incremented by one. Flags: No flags affected. Format: Bytes Cycles Opcode (Hex) Addr Mode dst opc dst 2 8 50 R 8 51[...]

  • Page 352

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 36 PUSH — Push To Stack PUSH src Operation: SP ¨ SP – 1 @SP ¨ src A PUSH instruction decrements the stack pointer value and loads the contents of the source ( src) into the location addressed by the decremented stack pointer. The operation then adds the new value to the top of the stack. Flags: No f[...]

  • Page 353

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 37 RCF — Reset Carry Flag RCF RCF Operation: C ¨ 0 The carry flag is cleared to logic zero, regardless of its previous value. Flags: C: Cleared to "0". No other flags are affected. Format: Bytes Cycles Opcode (Hex) opc 1 4 CF Example: Given: C = "1" or "0": The instruct[...]

  • Page 354

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 38 RET — Return RET Operation: PC ¨ @SP SP ¨ SP + 2 The RET instruction is normally used to return to the previously executing procedure at the end of a procedure entered by a CALL instruction. The contents of the location addressed by the stack pointer are popped into the program counter. The next st[...]

  • Page 355

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 39 RL — Rotate Left RL dst Operation: C ¨ dst (7) dst (0) ¨ dst (7) dst (n + 1) ¨ dst (n), n = 0–6 The contents of the destination operand are rotated left one bit position. The initial value o f bit 7 is moved to the bit zero (LSB) position and also replaces the carry flag. C 7 0 Flags: C: Set [...]

  • Page 356

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 40 RLC — Rotate Left Through Carry RLC dst Operation: dst (0) ¨ C C ¨ dst (7) dst (n + 1) ¨ dst (n), n = 0–6 The contents of the destination operand with the carry flag are rotated left one bit position. The initial value of bit 7 replaces the carry flag (C); the initial value of the carry flag rep[...]

  • Page 357

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 41 RR — Rotate Right RR dst Operation: C ¨ dst (0) dst (7) ¨ dst (0) dst (n) ¨ dst (n + 1), n = 0–6 The content s of the destination operand are rotated right one bit position. The initial value of bit zero (LSB) is moved to bit 7 (MSB) and also replaces the carry flag (C). C 7 0 Flags: C: Set i[...]

  • Page 358

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 42 RRC — Rotate Right Through Carry RRC dst Operation: dst (7) ¨ C C ¨ dst (0) dst (n) ¨ dst (n + 1), n = 0–6 The contents of the destination operand and the carry flag are rotated right one bit position. The initial value of bit zero (LSB) replaces the carry flag; the initial value of the carry fl[...]

  • Page 359

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 43 SBC — Subtract With Carry SBC dst,src Operation: dst ¨ dst – src – c The source operand, along with the current value of the carry flag, is subtracted from the destination operand and the result is stored in the destination. The contents of the source are unaffected. Subtraction is performed [...]

  • Page 360

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 44 SCF — Set Carry Flag SCF Operation: C ¨ 1 The carry flag (C) is set to logic one, regardless of its previous value. Flags: C: Set to "1". No other flags are affected. Format: Bytes Cycles Opcode (Hex) opc 1 4 DF Example: The statement SCF sets the carry flag to logic one.[...]

  • Page 361

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 45 SRA — Shift Right Arithmetic SRA dst Operation: dst (7) ¨ dst (7) C ¨ dst (0) dst (n) ¨ dst (n + 1), n = 0–6 An arithmetic shift-right of one bit position is perform ed on the destination operand. Bit zero (the LSB) replaces the carry flag. The value of bit 7 (the sign bit) is unchanged and i[...]

  • Page 362

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 46 STOP — Stop Operation STOP Operation: The STOP instruction stops both the CPU clock and system clock and causes the microcontroller to enter Stop mode. During Stop mode, the contents of on-chip CPU registers, peripheral registers, and I/O port control and data registers are retained. Stop mode can be[...]

  • Page 363

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 47 SUB — Subtract SUB dst,src Operation: dst ¨ dst – src The source operand is subtracted from the destination operand and the result is stored in the destination. The contents of the source are unaffected. Subtraction is performed by adding the two's complement of the source operand to the d[...]

  • Page 364

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 48 TCM — Test Complement Under Mask TCM dst,src Operation: (NOT dst) AND src Thi s instruction tests selected bits in the destination operand for a logic one value. The bits to be tested are specified by setting a "1" bit in the corresponding position of the source operand (mask). The TCM stat[...]

  • Page 365

    S3C9228/P9228 S AM8 8RC RI INSTRUCTION SET 6 - 49 TM — Test Under Mask TM dst,src Operation: dst AND src This instruction tests selected bits in the destination operand for a logic zero value. The bits to be tested are specified by setting a "1" bit in the corresponding position of the source operand (mask), which is ANDed with the dest[...]

  • Page 366

    SAM8 8 RI INSTRUCTION SET S3C9228/P9228 6 - 50 XOR — Logical Exclusive OR XOR dst,src Operation: dst ¨ dst XOR src The source operand is logically exclusive- ORed with the destination operand and the result is stored in the destination. The exclusive-OR operation results in a "1" bit being stored whenever the corresponding bits in the [...]

  • Page 367

    S3C9228/P9228 CLOCK CIRCUITS 7- 1 7 CLOCK CIRCUITS OVERVIEW The S3C9228 microcontroller has two oscillator circuits: a main clock, and a sub clock circuit. The CPU and peripheral hardware operate on the system clock frequency supplied through these circuits. The maximum CPU clock frequency, is determined by CLKCON register settings . SYSTEM CLOCK C[...]

  • Page 368

    CLOCK CIRCUITS S3C9 228/P9228 7- 2 MAIN OSCILLATOR CIRCUITS X IN X OUT Figure 7-1. Crystal/Ceramic Oscillator X IN X OUT Figure 7-2. External Oscillator X IN X OUT R Figure 7-3. RC Oscillator SUB OSCILLATOR CIRCUITS XT IN XT OUT 32.768 kHz Figure 7-4. Crystal/Ceramic Oscillator XT IN XT OUT Figure 7-5. External Oscillator[...]

  • Page 369

    S3C9228/P9228 CLOCK CIRCUITS 7- 3 CLOCK STATUS DURING POWER-DOWN MODES The two power-down modes, Stop mode and Idle mode, affect the system clock as follows: — In Stop mode, the main oscillator is halted. Stop mode is released, and the oscillator started, by a reset operation, by an external interrupt, or by an internal interrupt if sub clock is [...]

  • Page 370

    CLOCK CIRCUITS S3C9 228/P9228 7- 4 SYSTEM CLOCK CONTROL REGISTER (CLKCON) The system clock control register, CLKCON, is located in address D4H. It is read/write addressable and has the following functions: — Oscillator IRQ wake-up function enable/disable — Oscillator frequency divide-by value CLKCON register settings control whether or not an e[...]

  • Page 371

    S3C9228/P9228 CLOCK CIRCUITS 7- 5 OSCILLATOR CONTROL REGISTER (OSCCON) The oscillator control register, OSCCON, is located in address D3H. It is read/write addressable and has the following functions: — System clock selection — Main oscillator control — Sub oscillator control OSCCON.0 register settings select Main clock or Sub clock as system[...]

  • Page 372

    CLOCK CIRCUITS S3C9 228/P9228 7- 6 SWITCHING THE CPU CLOCK Data loadings in the oscillator control register, OSCCON, determine whether a main or a sub clock is selected as the CPU clock, and also how this frequency is to be divided by setting CLKCON. This makes it possible to switch dynamically between main and sub clocks and to modify operating fr[...]

  • Page 373

    S3C9228/P9228 CLOCK CIRCUITS 7- 7 STOP CONTROL REGISTER (STPCON) The STOP control register, STPCON, is located in address E0H. It is read/write addressable and has the following functions: — Enable/Disable STOP instruction After a reset, the STOP instruction is disabled, because the value of STPCON is "other values". If necessary, you c[...]

  • Page 374

    CLOCK CIRCUITS S3C9 228/P9228 7- 8 NOTES[...]

  • Page 375

    S3C9228/P9228 RESET RESET and POWER-DOWN 8- 1 8 RESET RESET and POWER-DOWN SYSTEM RESET OVERVIEW During a power-on reset, the voltage at V DD goes to High level and the RESET pin is forced to Low level. The RESET signal is input through a schmitt trigger circuit where it is then synchronized with the CPU clock. This procedure brings S3C9228/P9228 i[...]

  • Page 376

    RESET RESET and POWER-DOWN S3C9228 /P9228 8- 2 POWER-DOWN MODES STOP MODE Stop mode is invoked by the instruction STOP. In Stop mode, the operation of the CPU and main oscillator is halted. All peripherals which the main oscillator is selected as a clock source stop also because main oscillator stops. But the watch timer and LCD controller will not[...]

  • Page 377

    S3C9228/P9228 RESET RESET and POWER-DOWN 8- 3 Using an Internal Interrupt to Release Stop Mode An internal interrupt, watch timer, can be used to release stop mode because the watch timer operates in stop mode if the clock source of watch timer is sub clock. If system clock is sub clock, you can't use any interrupts to release stop mode. That [...]

  • Page 378

    RESET RESET and POWER-DOWN S3C9228 /P9228 8- 4 HARDWARE RESET RESET VALUES Table 8-1 list the values for CPU and system registers, peripheral control registers, and peripheral data registers following a RESET operation in normal operating mode. The following notation is used in these table to represent specific RESET values: — A "1" or [...]

  • Page 379

    S3C9228/P9228 RESET RESET and POWER-DOWN 8- 5 Table 8-1. Register Values after RESET RESET (Continued) Register Name Mnemonic Address Bit Values after RESET RESET Dec Hex 76543210 System Mode Register SYM 223 DFH ––––0000 STOP Control Register STPCON 224 E0H 00000000 SIO Control Register SIOCON 225 E1H 0000000– SIO Data Register SIODATA 2[...]

  • Page 380

    RESET RESET and POWER-DOWN S3C9228 /P9228 8- 6 NOTES[...]

  • Page 381

    S3C9228/P9228 I/O P ORTS 9- 1 9 I/O PORTS OVERVIEW The S3C9228/P9228 microcontroller has seven bit-programmable I/O ports, P0-P6. Port 0 is 6-bit port, port 1, port 2, and port 6 are 4-bit ports, port 3 is 2-bit port, and port 4 and port 5 are 8-bit ports. This gives a total of 36 I/O pins. Each port can be flexibly configured to meet application d[...]

  • Page 382

    I/O PORTS S3C9228/P 9228 9- 2 PORT DATA REGISTERS Table 9-2 gives you an overview of the register locations of all seven S3C9228 I/O port data registers. Data registers for ports 1, 2, 3, 4, 5, and 6 have the general format shown in Figure 9-1. Table 9-2. Port Data Register Summary Register Name Mnemonic Decimal Hex R/W Port 0 data register P0 228 [...]

  • Page 383

    S3C9228/P9228 I/O P ORTS 9- 3 PORT 0 Port 0 is an 6-bit I/O port with individually configurable pins. Port 0 pins are accessed directly by writing or reading the port 0 data register, P0 at location E4H in page 0. P0.0-P0.3 can serve as inputs (with or without pull- up), as outputs (push-pull or open-drain) or you can be configured the following fu[...]

  • Page 384

    I/O PORTS S3C9228/P 9228 9- 4 Port 0 Control Register (P0CON) EBH, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB P0.3/BUZ (INT) P0CON bit-pair pin configuration settings: 00 01 10 11 N-channel open-drain output mode Alternative function (TAOUT, BUZ) P0.2 (INT) P0.1/T1CLK (INT) P0.0/TAOUT (INT) Push-pull output mode Schmitt trigger input mode (T1CLK) [...]

  • Page 385

    S3C9228/P9228 I/O P ORTS 9- 5 Port 0 Interrupt Pending Bits (INTPND1.3-.0) D6H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB INTPND1 bit configuration settings: 0 1 P0.3 (INT) Interrupt is pending (when read) No interrupt pending (when read), clear pending bit (when write) P0.2 (INT) P0.1 (INT) P0.0 (INT) P1.3 (INT) P1.2 (INT) P1.1 (INT) P1.0 (INT) [...]

  • Page 386

    I/O PORTS S3C9228/P 9228 9- 6 PORT 1 Port 1 is an 4-bit I/O port with individually configurable pins. Port 1 pins are accessed directly by writing or reading the port 1 data register, P1 at location E5H in page 0. P1.0-P1.3 can serve as inputs (with or without pull- up), as outputs (push-pull or open-drain) or you can be configured the following fu[...]

  • Page 387

    S3C9228/P9228 I/O P ORTS 9- 7 Port 1 Interrupt Control Register (P1INT) F1H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB Not used P1INT bit configuration settings: 0 1 P1.3 (INT) Enable interrupt Disable interrupt P1.2 (INT) P1.1 (INT) P1.0 (INT) Figure 9-8. Port 1 Interrupt Control Register (P1INT) Port 1 Interrupt Pending Bits (INTPND1.7-.4) D6H,[...]

  • Page 388

    I/O PORTS S3C9228/P 9228 9- 8 Port 1 Interrupt Edge Selection Register (P1EDGE) F2H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB P1EDGE bit configuration settings: 0 1 P1.3 (INT) Rising edge detection Falling edge detection P1.2 (INT) P1.1 (INT) P1.0 (INT) Not used Figure 9-10. Port 1 Interrupt Edge Selection Register (P1EDGE) Port 1 Pull-up Contro[...]

  • Page 389

    S3C9228/P9228 I/O P ORTS 9- 9 PORT 2 Port 2 is an 4-bit I/O port with individually configurable pins. Port 2 pins are accessed directly by writing or reading the port 2 data register, P2 at location E6H in page 0. P2.0-P2.3 can serve as inputs (with or without pull- up), as outputs (push-pull or open-drain) or you can be configured the following fu[...]

  • Page 390

    I/O PORTS S3C9228/P 9228 9- 10 Port 2 Pull-up Control Register (P2PUR) F4H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB P2PUR bit configuration settings: 0 1 Enable pull-up resistor Disable pull-up resistor Not used P2.3 P2.2 P2.1 P2.0 Figure 9-13. Port 2 Pull-up Control Register (P2PUR)[...]

  • Page 391

    S3C9228/P9228 I/O P ORTS 9- 11 PORT 3 Port 3 is an 2-bit I/O port with individually configurable pins. Port 3 pins are accessed directly by writing or reading the port 3 data register, P3 at location E7H in page 0. P3.0-P3.1 can serve as inputs (with or without pull- up, and high impedance input), as outputs (push-pull or open-drain) or you can be [...]

  • Page 392

    I/O PORTS S3C9228/P 9228 9- 12 Port 3 Interrupt Control Register (P3INT) F7H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB Not used P3INT bit configuration settings: 0 1 Enable interrupt Disable interrupt P3.1 (INTP) P3.0 (INTP) Figure 9-15. Port 3 Interrupt Control Register (P3INT) Port 3 Interrupt Pending Bits (INTPND2.5-.4) D7H, Page 0, R/W .7 .6[...]

  • Page 393

    S3C9228/P9228 I/O P ORTS 9- 13 Port 3 Interrupt Edge Selection Register (P3EDGE) F8H, Page 0, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB P3EDGE bit configuration settings: 0 1 Rising edge detection Falling edge detection P3.1 (INTP) P3.0 (INTP) Not used Figure 9-17. Port 3 Interrupt Edge Selection Register (P3EDGE) Port 3 Pull-up Control Register (P3PUR) [...]

  • Page 394

    I/O PORTS S3C9228/P 9228 9- 14 PORT 4 Port 4 is an 8-bit I/O port with individually configurable pins. Port 4 pins are accessed directly by writing or reading the port 4 data register, P4 at location E8H in page 0. P4.0-P4.7 can serve as inputs or as push-pull, open-drain outputs. You can configure the following alternative functions with LCD port [...]

  • Page 395

    S3C9228/P9228 I/O P ORTS 9- 15 PORT 5 Port 5 is an 8-bit I/O port with individually configurable pins. Port 5 pins are accessed directly by writing or reading the port 5 data register, P5 at location E9H in page 0. P5.0-P5.7 can serve as inputs or as push-pull, open-drain outputs. You can configure the following alternative functions with LCD port [...]

  • Page 396

    I/O PORTS S3C9228/P 9228 9- 16 PORT 6 Port 6 is an 4-bit I/O port with individually configurable pins. Port 6 pins are accessed directly by writing or reading the port 6 data register, P6 at location EAH in page 0. P6.0-P6.3 can serve as inputs or as push-pull, open-drain outputs. You can configure the following alternative functions with LCD port [...]

  • Page 397

    S3C9228/P9228 ( Preliminary Spec ) BASIC TIMER 10- 1 10 BASIC TIMER OVERVIEW Basic timer (BT) can be used in two different ways: — As a watchdog timer to provide an automatic reset mechanism in the event of a system malfunction. — To signal the end of the required oscillation stabilization interval after a reset or a stop mode release. The func[...]

  • Page 398

    BASIC TIMER S3C9228 /P9228 ( Preliminary Spec ) 10- 2 BASIC TIMER CONTROL REGISTER (BTCON) The basic timer control register, BTCON, is used to select the input clock frequency, to clear the basic timer counter and frequency dividers, and to enable or disable the watchdog timer function. It is located in page 0, address DCH, and is read/write addres[...]

  • Page 399

    S3C9228/P9228 ( Preliminary Spec ) BASIC TIMER 10- 3 BASIC TIMER FUNCTION DESCRIPTION Watchdog Timer Function You can program the basic timer overflow signal (BTOVF) to generate a reset by setting BTCON.7–BTCON.4 to any value other than “1010B”. (The “1010B” value disables the watchdog function.) A reset clears BTCON to “00H”, automat[...]

  • Page 400

    BASIC TIMER S3C9228 /P9228 ( Preliminary Spec ) 10- 4 NOTE: During a power-on reset operation, the CPU is idle during the required oscillation stabilization interval (until bit 4 of the basic timer counter overflows). MUX f XX /4096 DIV f XX /1024 f XX /128 f XX /16 f XX Bits 3, 2 Bit 0 Basic Timer Control Register (Write '1010xxxxB' to D[...]

  • Page 401

    S3C9228/P9228 TIMER 1 11- 1 11 TIMER 1 ONE 16-BIT TIMER MODE (TIMER 1) The 16-bit timer 1 is used in one 16-bit timer or two 8-bit timers mode. If TACON.7 is set to "1", timer 1 is used as a 16-bit timer. If TACON.7 is set to "0", timer 1 is used as two 8-bit timers. — One 16-bit tim er mode (Timer 1) — Two 8-bit timers mode[...]

  • Page 402

    TIMER 1 S3C9228/P922 8 11- 2 Timer 1 Control Register (TACON) You use the timer 1 control register, TACON, to — Enable the timer 1 operating (interval timer) — Select the timer 1 input clock frequency — Clear the timer 1 counter, TACNT and TBCNT — Enable the timer 1 interrupt TACON is located in page 0, at address BBH, and is read/write add[...]

  • Page 403

    S3C9228/P9228 TIMER 1 11- 3 NOTE: When one 16-bit timer mode (TACON.7 <- "1": Timer 1) TACON.6-.4 M U X 1/8 1 /64 1 /256 1 /512 INTPND2.0 TAOUT T1INT 1/1 DIV R fxt T1CLK (X IN or XT IN ) fxx BTCON.0 TACON.2 TBCNT TACNT 16-Bit Comparator TBDATA Buffer TADATA Buffer TBDATA TADATA LSB MSB LSB MSB Match Signal Counter clear signal TACON.1 [...]

  • Page 404

    TIMER 1 S3C9228/P922 8 11- 4 TWO 8-BIT TIMERS MODE (TIMER A and B) OVERVIEW The 8-bit timer A and B are the 8-bit general-purpose timers. Timer A and B have the interval timer mode by using the appropriate TACON and TBCON setting, respectively. Timer A and B have the following functional components: — Clock frequency divider with multiplexer – [...]

  • Page 405

    S3C9228/P9228 TIMER 1 11- 5 TACON and TBCON are located in page 0, at address BBH and BAH, and is read/write addressable using register addressing mode. A reset clears TACON to "00H". This sets timer A to disable interval timer mode, selects an input clock frequency of fxx/512, and disables timer A interrupt. You can clear the timer A cou[...]

  • Page 406

    TIMER 1 S3C9228/P922 8 11- 6 Timer B Control Register (TBCON) BAH, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB Timer B match interrupt enable bit: 0 = Disable match interrupt 1 = Enable match interrupt Not used Timer B count enable bit: 0 = Disable counting operating 1 = Enable counting operating Timer B counter clear bit: 0 = No effect 1 = Clear the timer[...]

  • Page 407

    S3C9228/P9228 TIMER 1 11- 7 FUNCTION DESCRIPTION Interval Timer Function (Timer A and Timer B) The timer A and B module can generate an interrupt: the timer A match interrupt (TAINT) and the timer B match interrupt (TBINT). The timer A match interrupt pending condition (INTPND2.0) and the timer B match interrupt pending condition (INTPND2.1) must b[...]

  • Page 408

    TIMER 1 S3C9228/P922 8 11- 8 NOTE: When two 8-bit timers mode (TACON.7 <- "0": Timer A) TACON.6-.4 M U X 1/8 1 /64 1 /256 1 /512 INTPND2.0 TAOUT TAINT DIV R fxt T1CLK/ P0.1 (X IN or XT IN ) fxx BTCON.0 TACON.2 8-Bit Comparator TADATA Buffer TADATA Register LSB MSB LSB MSB Match Signal Counter Clear Signal TACON.1 Match R TACON.3 Data B[...]

  • Page 409

    S3C9228/P9228 TIMER 1 11- 9 1/1 1/8 1 /64 1 /256 1 /512 NOTE: When two 8-bit timers mode (TACON.7 <- "0": Timer B) TBCON.6-.4 M U X INTPND2.1 TBINT DIV R fxt (X IN or XT IN ) fxx BTCON.0 TBCON.2 8-Bit Comparator TBDATA Buffer TBDATA Register LSB MSB LSB MSB Match Signal Counter Clear Signal TBCON.1 Match R TBCON.3 Data Bus Data Bus TBC[...]

  • Page 410

    TIMER 1 S3C9228/P922 8 11- 10 NOTES[...]

  • Page 411

    S3C9228/P9228 WATCH TIMER 12- 1 12 WATCH TIMER OVERVIEW Watch timer functions include real-time and watch-time measurement and interval timing for the system clock. To start watch timer operation, set bit 1 of the watch timer control register, WTCON.1 to "1". And if you want to service watch timer overflow interrupt, then set the WTCON.6 [...]

  • Page 412

    WATCH TIMER S3C922 8/P9228 12- 2 WATCH TIMER CONTROL REGISTER (WTCON) The watch timer control register, WTCON is used to select the input clock source, the watch timer interrupt time and Buzzer signal, to enable or disable the watch timer function. It is located in page 0 at address DAH, and is read/write addressable using register addressing mode.[...]

  • Page 413

    S3C9228/P9228 WATCH TIMER 12- 3 WATCH TIMER CIRCUIT DIAGRAM WT INT Enable WTCON.1 WTCON.2 WTCON.3 WTCON.4 WTCON.5 WTCON.6 Enable/Disable Selector Circuit MUX INTPND2.3 WTINT WTCON.6 f W /2 15 f W /2 14 f W /2 13 f W /2 7 f W /64 (0.5 kHz) f W /32 (1 kHz) f W /16 (2 kHz) f W /8 (4 kHz) (1 Hz) f X = Main clock (where fx = 4.19 MHz) fxt = Sub clock (3[...]

  • Page 414

    WATCH TIMER S3C922 8/P9228 12- 4 NOTES[...]

  • Page 415

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 1 13 LCD CONTROLLER/DRIV ER OVERVIEW The S3C9228/P9228 microcontroller can directly drive an up-to- 128 -dot ( 16 segments x 8 commons) LCD panel. Its LCD block has the following components: — LCD control ler/driver — Display RAM for storing display data — 16 segment output pins (SEG0 – SEG 15 ) — [...]

  • Page 416

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 2 LCD CIRCUIT DIAGRAM SEG15/P5.3 COM4/SEG19/P5.7 COM7/SEG16/P5.4 160 16 Data BUS Port Latch LPOT Display RAM (Page1) Port Latch Port Latch Timing Controller MUX SEG Control or Selector COM Control or selector f LCD SEG0/P2.1 COM3/P6.0 COM0/P6.3 COM Control LCD Voltage Control Port 3 Control P3.1/INTP/SEG2 P3.[...]

  • Page 417

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 3 LCD RAM ADDRESS AREA RAM addresses of page 1 are used as LCD data memory. When the bit value of a display segment is "1", the LCD display is turned on; when the bit value is "0", the display is turned off. Display RAM data are sent out through segment pins SEG0–SEG 19 using a direct m[...]

  • Page 418

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 4 LCD MODE CONTROL REGISTER (LMOD) A LMOD is located in page 0, at address FEH, and is read/write addressable using register addressing mode. It has the following control functions. — LCD duty and bias selection — LCD clock selection — LCD display control — COMs signal output control — P3 high imped[...]

  • Page 419

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 5 LCD PORT CONTROL REGISTER The LCD port control register LPOT is used to control LCD signal pins or normal I/O pins. Following a RESET , a LPOT values are cleared to "0". LCD Port Control Register D8H, R/W .7 .6 .5 .4 .3 .2 .1 .0 MSB LSB Not used SEG0/P2.1 selection bit: 0 = SEG port 1 = Normal I/[...]

  • Page 420

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 6 LCD VOLTAGE DIVIDING RESISTORS 1/5 Bias S3C9228/P9228 V DD R R R R R LMOD.4 V LC1 V LC2 V LC3 V LC4 V LC5 V SS 1/4 Bias S3C9228/P9228 V DD R R R R R LMOD.4 V LC1 V LC2 V LC3 V LC4 V LC5 V SS 1/3 Bias S3C9228/P9228 V DD R R R R R LMOD.4 V LC1 V LC2 V LC3 V LC4 V LC5 V SS Figure 13-6. Internal Voltage Dividin[...]

  • Page 421

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 7 1 Frame FR V DD V SS COM0 COM1 COM2 COM3 COM4 COM5 COM6 COM7 COM1 V LC2 (V LC3 ) V LC4 V SS V DD V LC1 SEG0 V LC2 (V LC3 ) V LC4 V SS V DD V LC1 COM2 V LC2 (V LC3 ) V LC4 V SS V DD V LC1 COM0 V LC2 ( V LC3 ) V LC4 V SS V DD V LC1 SEG0-COM0 + V DD 0V + 1/4V LCD -V LCD - 1/4V LCD 0 1 2 3 7 4 6 5 0 1 2 3 7 4 [...]

  • Page 422

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 8 1 Frame V DD V SS 0 1 2 3 0 1 2 3 COM1 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM2 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM3 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) SEG0 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) SEG1 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM0-SEG0 + V LCD COM0 V SS V DD V LC1 [...]

  • Page 423

    S3C9228/P9228 LCD CONTROLLER/DRIV ER 13- 9 1 Frame V DD V SS 0 1 2 COM1 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM2 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) SEG0 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) SEG1 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) COM0-SEG0 + V LCD COM0 V SS V DD V LC1 ( V LC2 ) V LC3 ( V LC4 ) + 1/3 V LCD 0V - 1/3 V LCD - V[...]

  • Page 424

    LCD CONTROLLER/DRIVER S3C9228/P9228 13- 10 NOTES[...]

  • Page 425

    S3C9228/P9228 A/D C ONVERTER 14- 1 14 10-BIT ANALOG-TO-DIGITAL CONVERTER OVERVIEW The 10-bit A/D converter (ADC) module uses successive approximation logic to convert analog levels entering at one of the four input channels to equivalent 10 -bit digital values. The an alog input level must lie between the AV REF and AV SS values. The A/D converter [...]

  • Page 426

    A/D CONVERTER S3C9 228/P9228 14- 2 CONVERSION TIMING The A/D conversion process requires 4 steps (4 clock edges) to convert each bit and 10 clocks to set-up A/D conversion. Therefore, total of 50 clocks are required to complete an 10-bit conversion: When fxx/8 is selected for conversion clock with an 4.5 MHz fxx clock frequency, one clock cycle is [...]

  • Page 427

    S3C9228/P9228 A/D C ONVERTER 14- 3 Conversion Data Register ADDATAH/ADDATAL D1H/D2H, Page 0, Read Only .9 .8 .7 .6 .5 .4 .3 .2 MSB LSB (ADDATAH) ------ .1 .0 MSB LSB (ADDATAL) Figure 14-2. A/D Converter Data Register (ADDATAH/ADDATAL) INTERNAL REFERENCE VOLTAGE LEVELS In the ADC function block, the analog input voltage level is compared to the refe[...]

  • Page 428

    A/D CONVERTER S3C9 228/P9228 14- 4 S3C9228 AD0-AD3 Analog Input Pin V DD 101 C (V SS ≤ ADC input ≤ V DD ) Figure 14-4. Recommended A/D Converter Circuit for Highest Absolute Accuracy[...]

  • Page 429

    S3C9228/P9228 SERIAL I/O INTERFACE 1 5- 1 15 SERIAL I/O INTERFAC E OVERVIEW Serial I/O modules, SIO can interface with various types of external device that require serial data transfer. The components of SIO function block are: — 8-bit control register (S IOCON ) — Clock selector logic — 8-bit data buffer (SIODATA) — 8-bit prescaler (SIOPS[...]

  • Page 430

    SERIAL I/O INTERFACE S3C9228/P9228 15- 2 SIO CONTROL REGISTERS (SIOCON) The control register for serial I/O interface module, SIOCON, is located at E1H in page 0. It has the control setting for SIO module. — Clock source selection (internal or external) for shift clock — Interrupt enable — Edge selection for shift operation — Clear 3-bit co[...]

  • Page 431

    S3C9228/P9228 SERIAL I/O INTERFACE 1 5- 3 SIO PRE-SCALER REGISTER (SIOPS) The prescaler register for serial I/O interface module, SIOPS, are located at E3H in page 0. The value stored in the SIO pre-scale register, SIOPS, lets you determine the SIO clock rate (baud rate) as follows: Baud rate = Input clock (fxx/4)/( Prescaler value + 1), or SCK inp[...]

  • Page 432

    SERIAL I/O INTERFACE S3C9228/P9228 15- 4 SERIAL I/O TIMING DIAGRAM (SIO) SO Transmit Complete SIO INT Set SIOCON.3 DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0 DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0 SI SCK Figure 15-4 . Serial I/O Timing in Transmit/Receive Mode ( Tx at falling, SIOCON.4 = 0) SIO INT DO7 DO6 DO5 DO4 DO3 DO2 DO1 DO0 DI7 DI6 DI5 DI4 DI3 DI2 DI1 DI0 SCK [...]

  • Page 433

    S3C9228/P9228 ELECT RICAL DATA 16- 1 16 ELECTRICAL DATA OVERVIEW In this chapter, S3C9228/P9228 electrical characteristics are presented in tables and graphs. The information is arranged in the following order: — Absolute maximum ratings — D.C. electrical characteristics — Data retention supp ly voltage in Stop mode — Stop mode release timi[...]

  • Page 434

    ELECTRICAL DATA S3C 9228/P9228 16- 2 Table 16-1. Absolute Maximum Ratings (T A = 25 ° C) Parameter Symbol Conditions Rating Unit Supply voltage V DD – – 0.3 to + 6.5 V Input voltage V IN Ports 0 –6 – 0.3 to V DD + 0.3 V Output voltage V O – – 0.3 to V DD + 0.3 V Output current High I OH One I/O pin active – 15 mA All I/O pins active [...]

  • Page 435

    S3C9228/P9228 ELECT RICAL DATA 16- 3 Table 16-2. D.C. Electrical Characteristics (Continued) (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Parameter Symbol Conditions Min Typ Max Unit Input Low leakage current I LIL1 V I = 0 V; All input pins except RESET , X OUT , XT IN , XT OUT – – –3 µ A I LIL2 V I = 0 V; X IN , X OUT , XT IN , [...]

  • Page 436

    ELECTRICAL DATA S3C 9228/P9228 16- 4 Table 16-2. D.C. Electrical Characteristics (Concluded) (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Parameter Symbol Conditions Min Typ Max Unit Supply current (1) I DD1 Run mode: V DD = 5 V ± 10% 8.0 MHz – 6.0 12.0 mA Crystal oscillator C1 = C2 = 22pF 4.19 MHz 3.0 6.0 V DD = 3 V ± 10% 8.0 MHz 2.[...]

  • Page 437

    S3C9228/P9228 ELECT RICAL DATA 16- 5 Table 16-3. Data Retention Supply Voltage in Stop Mode (T A = – 25 ° C to + 85 ° C) Parameter Symbol Conditions Min Typ Max Unit Data retention supply voltage V DDDR – 2.0 – 5.5 V Data retention supply current I DDDR Stop mode, T A = 25 ° C V DDDR = 2.0 V ––1 µA Execution of STOP Instruction Idle M[...]

  • Page 438

    ELECTRICAL DATA S3C 9228/P9228 16- 6 Execution of STOP Instrction RESET Occurs ~ ~ V DDDR ~ ~ Stop Mode Oscillation Stabilization TIme Normal Operating Mode Data Retention Mode t WAIT RESET V DD 0.2 V DD 0.8 V DD NOTE: t WAIT is the same as 16 × 1/BT clock. Figure 16-2. Stop Mode Release Timing When Initiated by a RESET RESET Table 16-4. Input/Out[...]

  • Page 439

    S3C9228/P9228 ELECT RICAL DATA 16- 7 Table 16-5. A.C. Electrical Characteristics (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Parameter Symbol Conditions Min Typ Max Unit SCK cycle time t KCY External SCK source 1,000 – – ns Internal SCK source 1,000 SCK high, low width t KH , t KL External SCK source 500 Internal SCK source t KCY /2[...]

  • Page 440

    ELECTRICAL DATA S3C 9228/P9228 16- 8 Table 16-6. A/D Converter Electrical Characteristics (T A = – 25 ° C to + 85 ° C, V DD = 2.7 V to 5.5 V, V SS = 0 V) Parameter Symbol Conditions Min Typ Max Unit Resolution – 10 – bit Total accuracy VDD = 5.12 V – – ± 3 LSB Integral linearity error ILE fxx = 8 MHz – – ± 2 Differential linearity[...]

  • Page 441

    S3C9228/P9228 ELECT RICAL DATA 16- 9 RESET t RSL 0.2 V DD Figure 16-4. Input Timing for RESET RESET t KH t KL 0.2V DD SCK t KCY 0.8V DD 0.8V DD 0.2V DD t SIK t KSI SI SO t KSO Output Data Figure 16-5. Serial Data Transfer Timing[...]

  • Page 442

    ELECTRICAL DATA S3C 9228/P9228 16- 10 Table 16-7. Main Oscillation Characteristics (T A = – 25 ° C to + 85 ° C) Oscillator Clock Configuration Parameter Test Condition Min Typ Max Units Crystal X IN C1 X OUT Main oscillation frequency 2.7 V – 5.5 V 0.4 – 8 MHz 2.0 V – 5.5 V 0.4 – 4 Ceramic Oscillator X IN C1 X OUT Main oscillation frequ[...]

  • Page 443

    S3C9228/P9228 ELECT RICAL DATA 16- 11 Table 16-9. Main Oscillation Stabilization Time (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Oscillator Test Condition Min Typ Max Unit Crystal fx > 1 MHz – – 30 ms Ceramic Oscillation stabilization occurs when VDD is equal to the minimum oscillator voltage ranage. – – 10 ms External clock[...]

  • Page 444

    ELECTRICAL DATA S3C 9228/P9228 16- 12 Table 16-10. Sub Oscillation Stabilization Time (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Oscillator Test Condition Min Typ Max Unit Crystal – – – 10 s External clock XT IN input high and low width (t XH , t XL ) 5 – 15 µ s t XTH t XTL V DD -0.1 V 0.1 V XT IN 1/fxt Figure 16-7. Clock Timi[...]

  • Page 445

    S3C9228/P9228 ELECT RICAL DATA 16- 13 2 MHz 6.25 kHz (main)/8.2 kHz(sub) 1 2 6 Supply Voltage (V) Instruction Clock = 1/4n x oscillator frequency (n = 1, 2, 8, 16) 1.0 MHz Instruction Clock 8 MHz 4 MHz fx (Main/Sub oscillation frequency) 400 kHz 2.7 5.5 400 kHz (main)/32.8 kHz(sub) Figure 16-8. Operating Voltage Range[...]

  • Page 446

    ELECTRICAL DATA S3C 9228/P9228 16- 14 NOTES[...]

  • Page 447

    S3C9228/P9228 MECHANICAL DATA 1 7- 1 17 MECHANICAL DATA OVERVIEW The S3C9228/P9228 microcontroller is currently available in a 42-pin SDIP and 44-pin QFP package. NOTE : Dimensions are in millimeters. 39.50 MAX 39.10 ± 0 .2 0.50 ± 0.1 1.78 (1.77) 0.51 MIN 3.30 ± 0.3 3.50 ± 0.2 5.08 MAX 42-SDIP-600 0-15 1.00 ± 0.1 0.25 + 0.1 - 0.05 15.24 14.00 [...]

  • Page 448

    MECHANICAL DATA S3C9228/P9228 1 7- 2 44-QFP-1010B #44 NOTE : Dimensions are in millimeters. 10.00 ± 0.2 13.20 ± 0.3 10.00 ± 0.2 13.20 ± 0.3 #1 0.35 + 0.10 - 0.05 0.80 (1.00) 0.10 MAX 0.80 ± 0.20 0.05 MIN 2.05 ± 0.10 2.30 MAX 0.15 + 0.10 - 0.05 0-8 Figure 17-2. 44-QFP-1010B Package Dimensions[...]

  • Page 449

    S3C9228/P9228 S3P9228 OTP 18- 1 18 S3P9228 OTP OVERVIEW The S3P9228 single-chip CMOS microcontroller is the OTP (One Time Programmable) version of the S3C9228 microcontroller. It has an on-chip OTP ROM instead of masked ROM. The EPROM is accessed by serial data format. The S3P9228 is fully compatible with the S3C9228, both in function and in pin co[...]

  • Page 450

    S3P9228 OTP S3C9228/P9228 18- 2 COM1/P6.2 COM0/P6.3 P0.0/TAOUT/INT P0.1/T1CLK/INT P0.2/INT P0.3/BUZ/INT P1.0/AD0/INT P1.1/AD1/INT SDAT /P1.2/AD2/INT SCLK /P1.3/AD3/INT V DD /V DD V SS /V SS X OUT X IN V PP /TEST XT IN XT OUT RESET RESET / RESET P2.3 P2.2/SI SEG0/P2.1/SO S3C9228 (42-SDIP) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 COM2/P6[...]

  • Page 451

    S3C9228/P9228 S3P9228 OTP 18- 3 Table 18-1. Descriptions of Pins Used to Read/Write the EPROM Main Chip During Programming Pin Name Pin Name Pin No. I/O Function P1.2 SDAT 3 (9) I/O Serial data pin. Output port when reading and input port when writing. Can be assigned as a Input/push-pull output port. P1.3 SCLK 4 (10) I/O Serial clock pin. Input on[...]

  • Page 452

    S3P9228 OTP S3C9228/P9228 18- 4 Table 18-4. D.C. Electrical Characteristics (T A = – 25 ° C to + 85 ° C, V DD = 2.0 V to 5.5 V) Parameter Symbol Conditions Min Typ Max Unit Supply current (1) I DD1 Run mode: V DD = 5 V ± 10% 8.0 MHz – 6.0 12.0 mA Crystal oscillator C1 = C2 = 22pF 4.19 MHz 3.0 6.0 V DD = 3 V ± 10% 8.0 MHz 2.5 5.0 4.19 MHz 1.[...]

  • Page 453

    S3C9228/P9228 S3P9228 OTP 18- 5 2 MHz 6.25 kHz (main)/8.2 kHz(sub) 1 2 6 Supply Voltage (V) Instruction Clock = 1/4n x oscillator frequency (n = 1, 2, 8, 16) 1.0 MHz Instruction Clock 8 MHz 4 MHz fx (Main/Sub oscillation frequency) 400 kHz 2.7 5.5 400 kHz (main)/32.8 kHz(sub) Figure 18-3. Standard Operating Voltage Range[...]

  • Page 454

    S3P9228 OTP S3C9228/P9228 18- 6 NOTES[...]

  • Page 455

    S3C9228/P9228 DEVEL OPMENT TOOLS 19- 1 19 DEVELOPMENT TOOLS OVERVIEW Samsung provides a powerful and easy-to-use development support system in turn key form. The development support system is configured with a host system, debugging tools, and support software. For the host system, any standard computer that operates with MS-DOS as its operating sy[...]

  • Page 456

    DEVELOPMENT TOOLS S3C9228/P9228 19- 2 BUS SMDS2+ RS-232C POD Probe Adapter PROM/OTP Writer Unit RAM Break/Display Unit Trace/Timer Unit SAM8 Base Unit Power Supply Unit IBM-PC AT or Compatible TB9228 Target Board EVA Chip Target Application System Figure 19-1. SMDS Product Configuration (SMDS2+)[...]

  • Page 457

    S3C9228/P9228 DEVEL OPMENT TOOLS 19- 3 TB9228 TARGET BOARD The TB9228 target board is used for the S3C9228 microcontroller. It is supported by the SMDS2+ development system. TB9228 SM1347A GND V CC To User_V CC OFF ON SMDS2 SMDS2+ J101 42SDIP J102 44QFP 1 5 15 21 10 42 40 25 22 30 35 1 5 15 22 10 44 40 30 23 35 25 20 P2 25 160 30 20 10 1 150 140 13[...]

  • Page 458

    DEVELOPMENT TOOLS S3C9228/P9228 19- 4 Table 19-1. Power Selection Settings for TB9228 "To User_V CC " Settings Operating Mode Comments To User_V CC Off On Target System SMDS2/SMDS2+ TB9228 V CC V SS V CC The SMDS2/SMDS2+ supplies V CC to the target board (evaluation chip) and the target system. To User_V CC Off On Target System SMDS2/SMDS[...]

  • Page 459

    S3C9228/P9228 DEVEL OPMENT TOOLS 19- 5 SMDS2+ Selection (SAM8) In order to write data into program memory that is available in SMDS2+, the target board should be selected to be for SMDS2+ through a switch as follows. Otherwise, the program memory writing function is not available. Table 19-2. The SMDS2+ Tool Selection Setting "SW1" Settin[...]

  • Page 460

    DEVELOPMENT TOOLS S3C9228/P9228 19- 6 J101 42-SDIP J102 44-QFP 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 43 44 45 46 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 50 49 48 47 P6.2 P6.3 P0.0 P0.1 P0.2 P0.3 P1.0 P1.1 P1.2 P1.3 USER_VCC VSS NC NC VSS NC NC DEMO_RSTB P2.3 P2.2 P2.1 NC NC NC NC P6.1 P6.0 P5.7 P5.6 P5.5 P5.4 [...]

  • Page 461

    S3C9228/P9228 DEVEL OPMENT TOOLS 19- 7 Target Board Target System Target Cable for Connector Part Name: AP42SD Order Code: SM6538 J101 1 42 21 22 J101 1 42 21 22 50-Pin DIP Connector Figure 19-4. S3C9228 Probe Adapter for 42-SDIP Package Target Board Target System 50-Pin Connector Target Cable for 50-pin Connector Part Name: AP50D-A Order Code: SM6[...]

  • Page 462

    DEVELOPMENT TOOLS S3C9228/P9228 19- 8 NOTES[...]