21-S3-C9228/P9228-112002
USER'S MANUAL
S3C9228/P9228
8-Bit CMOS
Microcontroller
Revision 1
S3C9228/P9228
8-BIT CMOS
MICROCONTROLLERS
USER'S MANUAL
Revision 1
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 changes in its
products or product specifications with the intent to
improve function or design at any time and without
notice and is not required to update this
documentation to reflect such changes.
This publication does not convey to a purchaser of
semiconductor devices described herein any license
under the patent rights of Samsung or others.
Samsung makes no warranty, representation, or
guarantee regarding the suitability of its products for
any particular purpose, nor does Samsung assume
any liability arising out of the application or use of
any product or circuit and specifically disclaims any
and all liability, including without limitation any
consequential or incidental damages.
"Typical" parameters can and do vary in different
applications. All operating parameters, including
"Typicals" must be validated for each customer
application by the customer's technical experts.
Samsung products are not designed, intended, or
authorized for use as components in systems
intended for surgical implant into the body, for other
applications intended to support or sustain life, or for
any other application in which the failure of the
Samsung product could create a situation where
personal injury or death may occur.
Should the Buyer purchase or use a Samsung
product for any such unintended or unauthorized
application, the Buyer shall indemnify and hold
Samsung and its officers, employees, subsidiaries,
affiliates, and distributors harmless against all
claims, costs, damages, expenses, and reasonable
attorney fees arising out of, either directly or
indirectly, any claim of personal injury or death that
may be associated with such unintended or
unauthorized use, even if such claim alleges that
Samsung was negligent regarding the design or
manufacture of said product.
S3C9228/P9228 8-Bit CMOS Microcontrollers
User's Manual, Revision 1
Publication Number: 21-S3-C9228/P9228-112002
© 2002 Samsung Electronics
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in
any form or by any means, electric or mechanical, by photocopying, recording, or otherwise, without the prior
written consent of Samsung Electronics.
Samsung Electronics' microcontroller business has been awarded full ISO-14001
certification (BVQI Certificate No 9330) All semiconductor products are designed
and manufactured in accordance with the highest quality standards and
objectives.
Samsung Electronics Co., Ltd.
San #24 Nongseo-Ri, Kiheung-Eup
Yongin-City, Kyunggi-Do, Korea
C.P.O. Box #37, Suwon 449-900
TEL: (82)-(331)-209-1907
FAX: (82)-(331)-209-1889
Home-Page URL: Http://www.samsungsemi.com
Printed in the Republic of Korea
Preface
The S3C9228/P9228 Microcontrollers User's Manual is designed for application designers and programmers who
are using the S3C9228/P9228 microcontrollers for application development. It is organized in two main parts:
Part I Programming Model Part II Hardware Descriptions
Part I contains software-related information to familiarize you with the microcontroller's architecture,
programming model, instruction set, and interrupt structure. It has six chapters:
Chapter 1 Product Overview
Chapter 2 Address Spaces
Chapter 3 Addressing Modes
Chapter 1, "Product Overview," is a high-level introduction to the 100% with general product descriptions, as well
as detailed information about individual pin characteristics and pin circuit types.
Chapter 2, "Address Spaces," explains the 100% program and data memory, internal register file, and mapped
control register, and explains how to address them. Chapter 2 also describes working register addressing, as well
as system stack and user-defined stack operations.
Chapter 3, "Addressing Modes," contains detailed descriptions of the addressing modes that are supported by the
CPU.
Chapter 4, "Control Registers," contains overview tables for all mapped system and peripheral control register
values, as well as detailed one-page descriptions in standard format. You can use these easy-to-read,
alphabetically organized, register descriptions as a quick-reference source when writing programs.
Chapter 5, "Interrupt Structure," describes the 100% interrupt structure in detail and further prepares you for
additional information presented in the individual hardware module descriptions in Part II.
Chapter 6, "SAM88RCRI Instruction Set," describes the features and conventions of the instruction set used for
all S3C9-series microcontrollers. Several summary tables are presented for orientation and reference. Detailed
descriptions of each instruction are presented in a standard format. Each instruction description includes one or
more practical examples of how to use the instruction when writing an application program.
A basic familiarity with the information in Part I will help you to understand the hardware module descriptions in
Part II. If you are not yet familiar with the SAM8 product family and are reading this manual for the first time, we
recommend that you first read chapters 1–3 carefully. Then, briefly look over the detailed information in chapters
4, 5, and 6. Later, you can reference the information in Part I as necessary.
Part II "hardware Descriptions," has detailed information about specific hardware components of the
S3C9228/P9228 microcontrollers. Also included in Part II are electrical, mechanical, OTP, and development
tools data. It has 13 chapters:
Chapter 4 Control Registers
Chapter 5 Interrupt Structure
Chapter 6 SAM88RCRI Instruction Set
Chapter 7 Clock Circuits
Chapter 8 RESET and Power-Down
Chapter 9 I/O Ports
Chapter 10 Basic Timer
Chapter 11 Timer 1
Chapter 12 Watch Timer
Chapter 13 LCD Controller/Driver
Two order forms are included at the back of this manual to facilitate customer order for S3C9228/P9228
microcontrollers: the Mask ROM Order Form, and the Mask Option Selection Form. You can photocopy these
forms, fill them out, and then forward them to your local Samsung Sales Representative.
S3C9228/P9228 MICROCONTROLLERS iii
Chapter 14 10-bit ADC
Chapter 15 Serial I/O Interface
Chapter 16 Electrical Data
Chapter 17 Mechanical Data
Chapter 18 S3P9228 OTP
Chapter 19 Development Tools
Table of Contents
Part I — Programming Model
Chapter 1 Product Overview
SAM88RCRI Product Family ...................................................................................................................1-1
S3C9228/P9228 Microcontroller ..............................................................................................................1-1
OTP.........................................................................................................................................................1-1
Features..................................................................................................................................................1-2
Block Diagram.........................................................................................................................................1-3
Pin Assignments......................................................................................................................................1-4
Pin Descriptions.......................................................................................................................................1-6
Pin Circuit Diagrams................................................................................................................................1-8
Chapter 2 Address Spaces
Overview.................................................................................................................................................2-1
Program Memory (ROM) .........................................................................................................................2-2
Register Architecture ...............................................................................................................................2-3
Common Working Register Area (C0H–CFH)..........................................................................................2-4
System Stack ..........................................................................................................................................2-5
Chapter 3 Addressing Modes
Overview.................................................................................................................................................3-1
Register Addressing Mode (R).........................................................................................................3-2
Indirect Register Addressing Mode (IR) ...........................................................................................3-3
Indexed Addressing Mode (X)..........................................................................................................3-7
Direct Address Mode (DA)...............................................................................................................3-10
Relative Address Mode (RA) ...........................................................................................................3-12
Immediate Mode (IM)......................................................................................................................3-12
S3C9228/P9228 MICROCONTROLLERS v
Table of Contents (Continued)
Chapter 4 Control Registers
Overview.................................................................................................................................................4-1
Chapter 5 Interrupt Structure
Overview.................................................................................................................................................5-1
Interrupt Processing Control Points..................................................................................................5-1
Enable/Disable Interrupt Instructions (EI, DI) ................................................................................... 5-1
Interrupt Pending Function Types....................................................................................................5-2
Interrupt Priority...............................................................................................................................5-2
Interrupt Source Service Sequence .................................................................................................5-3
Interrupt Service Routines...............................................................................................................5-3
Generating Interrupt Vector addresses.............................................................................................5-3
S3C9228/P9228 Interrupt Structure.................................................................................................5-4
Chapter 6 SAM88RCRI Instruction Set
Overview.................................................................................................................................................6-1
Register Addressing.........................................................................................................................6-1
Addressing Modes...........................................................................................................................6-1
Flags Register (FLAGS) ..................................................................................................................6-4
Flag Descriptions .............................................................................................................................6-4
Instruction Set Notation ................................................................................................................... 6-5
Condition Codes..............................................................................................................................6-9
Instruction Descriptions....................................................................................................................6-10
vi S3C9228/P9228 MICROCONTROLLERS
Table of Contents (Continued)
Part II — Hardware Descriptions
Chapter 7 Clock Circuit
Overview.................................................................................................................................................7-1
System Clock Circuit.......................................................................................................................7-1
CPU Clock Notation ........................................................................................................................7-1
Main Oscillator Circuits....................................................................................................................7-2
Sub Oscillator Circuits.....................................................................................................................7-2
Clock Status During Power-Down Modes.........................................................................................7-3
System Clock Control Register (CLKCON)......................................................................................7-4
Oscillator Control Register (OSCCON)............................................................................................7-5
Switching The CPU Clock................................................................................................................7-6
Stop Control Register (STPCON) ....................................................................................................7-7
Chapter 8 RESET RESET and Power-Down
System Reset..........................................................................................................................................8-1
Overview.........................................................................................................................................8-1
Power-Down Modes.................................................................................................................................8-2
Stop Mode.......................................................................................................................................8-2
Idle Mode........................................................................................................................................8-3
Hardware Reset Values...................................................................................................................8-4
Chapter 9 I/O Ports
Overview.................................................................................................................................................9-1
Port Data Registers.........................................................................................................................9-2
Port 0..............................................................................................................................................9-3
Port 1..............................................................................................................................................9-6
Port 2..............................................................................................................................................9-9
Port 3..............................................................................................................................................9-11
Port 4..............................................................................................................................................9-14
Port 5..............................................................................................................................................9-15
Port 6..............................................................................................................................................9-16
Chapter 10 Basic Timer
Overview.................................................................................................................................................10-1
Basic Timer Control Register (BTCON)...........................................................................................10-2
Basic Timer Function Description....................................................................................................10-3
S3C9228/P9228 MICROCONTROLLERS vii
Table of Contents (Continued)
Chapter 11 Timer 1
One 16-Bit Timer Mode (Timer 1)............................................................................................................11-1
Overview.........................................................................................................................................11-1
Function Description........................................................................................................................11-1
Two 8-Bit Timers Mode (Timer A and B)..................................................................................................11-4
Overview.........................................................................................................................................11-4
Function Description........................................................................................................................11-7
Chapter 12 Watch Timer
Overview.................................................................................................................................................12-1
Watch Timer Control Register (WTCON).........................................................................................12-2
Watch Timer Circuit Diagram...................................................................................................................12-3
Chapter 13 LCD Controller/Driver
Overview.................................................................................................................................................13-1
LCD Circuit Diagram........................................................................................................................13-2
LCD RAM Address Area..................................................................................................................13-3
LCD Mode Control Register (LMOD)................................................................................................13-4
LCD Port Control Register...............................................................................................................13-5
LCD Voltage Dividing Resistors....................................................................................................... 13-6
Common (COM) Signals..................................................................................................................13-6
Segment (SEG) Signals...................................................................................................................13-6
Chapter 14 10-Bit A/D Converter
Overview.................................................................................................................................................14-1
Function Description................................................................................................................................14-1
Conversion Timing .......................................................................................................................... 14-2
A/D Converter Control Register (ADCON) ....................................................................................... 14-2
Internal Reference Voltage Levels................................................................................................... 14-3
Block Diagram.........................................................................................................................................14-3
Chapter 15 Serial I/O Interface
Overview.................................................................................................................................................15-1
Programming Procedure..................................................................................................................15-1
SIO Control Registers (SIOCON).....................................................................................................15-2
SIO Pre-Scaler Register (SIOPS)....................................................................................................15-3
SIO Block Diagram..................................................................................................................................15-3
Serial I/O Timing Diagram (SIO)......................................................................................................15-4
viii S3C9228/P9228 MICROCONTROLLERS
Table of Contents (Concluded)
Chapter 16 Electrical Data
Overview.................................................................................................................................................16-1
Chapter 17 Mechanical Data
Overview.................................................................................................................................................17-1
Chapter 18 S3P9228 OTP
Overview.................................................................................................................................................18-1
Operating Mode Characteristics.......................................................................................................18-3
Chapter 19 Development Tools
Overview.................................................................................................................................................19-1
SHINE.............................................................................................................................................19-1
SAMA Assembler............................................................................................................................19-1
SASM86..........................................................................................................................................19-1
HEX2ROM ......................................................................................................................................19-1
Target Boards..................................................................................................................................19-1
TB9228 Target Board......................................................................................................................19-3
Idle LED..........................................................................................................................................19-5
Stop LED.........................................................................................................................................19-5
S3C9228/P9228 MICROCONTROLLERS ix
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 S3C9228 42-SDIP Pin Assignments...................................................................................1-5
1-4 Pin Circuit Type B ..............................................................................................................1-8
1-5 Pin Circuit Type C ..............................................................................................................1-8
1-7 Pin Circuit Type E-4 ...........................................................................................................1-9
1-8 Pin Circuit Type F-16A .......................................................................................................1-9
1-9 Pin Circuit Type H-23 .........................................................................................................1-10
1-10 Pin Circuit Type H-32 .........................................................................................................1-11
1-11 Pin Circuit Type H-32A.......................................................................................................1-11
1-12 Pin Circuit Type H-32B.......................................................................................................1-12
2-1 S3C9228/P9228 Program Memory Address Space.............................................................2-2
2-2 Internal Register File Organization .....................................................................................2-3
2-3 16-Bit Register Pairs...........................................................................................................2-4
2-4 Stack Operations................................................................................................................2-5
3-1 Register Addressing ...........................................................................................................3-2
3-2 Working Register Addressing .............................................................................................3-2
3-3 Indirect Register Addressing to Register File ......................................................................3-3
3-4 Indirect Register Addressing to Program Memory...............................................................3-4
3-5 Indirect Working Register Addressing to Register File ........................................................3-5
3-6 Indirect Working Register Addressing to Program or Data Memory.....................................3-6
3-7 Indexed Addressing to Register File ...................................................................................3-7
3-8 Indexed Addressing to Program or Data Memory with Short Offset.....................................3-8
3-9 Indexed Addressing to Program or Data Memory with Long Offset.....................................3-9
3-10 Direct Addressing for Load Instructions...............................................................................3-10
3-11 Direct Addressing for Call and Jump Instructions................................................................3-11
3-12 Relative Addressing............................................................................................................3-12
3-13 Immediate Addressing........................................................................................................3-12
4-1 Register Description Format...............................................................................................4-4
S3C9228/P9228 MICROCONTROLLERS xi
List of Figures (Continued)
Figure Title Page
Number Number
5-1 S3C9-Series Interrupt Type ................................................................................................ 5-1
5-2 Interrupt Function Diagram.................................................................................................5-2
5-3 S3C9228/P9228 Interrupt Structure....................................................................................5-5
6-1 System Flags Register (FLAGS).........................................................................................6-4
7-1 Crystal/Ceramic Oscillator..................................................................................................7-2
7-2 External Oscillator..............................................................................................................7-2
7-3 RC Oscillator......................................................................................................................7-2
7-4 Crystal/Ceramic Oscillator..................................................................................................7-2
7-5 External Oscillator..............................................................................................................7-2
7-6 System Clock Circuit Diagram............................................................................................7-3
7-7 System Clock Control Register (CLKCON) ......................................................................... 7-4
7-8 Oscillator Control Register (OSCCON) ...............................................................................7-5
7-9 STOP Control Register (STPCON).....................................................................................7-7
9-1 S3C9228 I/O Port Data Register Format .............................................................................9-2
9-2 Port 0 Control Register (P0CON)........................................................................................9-4
9-3 Port 0 Interrupt Control Register (P0INT)............................................................................9-4
9-4 Port 0 Interrupt Pending Bits (INTPND1.3-.0)......................................................................9-5
9-5 Port 0 Interrupt Edge Selection Register (P0EDGE)............................................................9-5
9-6 Port 0 Pull-up Control Register (P0PUR) ............................................................................9-5
9-7 Port 1 Control Register (P1CON)........................................................................................9-6
9-8 Port 1 Interrupt Control Register (P1INT)............................................................................9-7
9-9 Port 1 Interrupt Pending Bits (INTPND1.7-.4)......................................................................9-7
9-10 Port 1 Interrupt Edge Selection Register (P1EDGE)............................................................9-8
9-11 Port 1 Pull-up Control Register (P1PUR) ............................................................................9-8
9-12 Port 2 Control Register (P2CON)........................................................................................9-9
9-13 Port 2 Pull-up Control Register (P2PUR) ............................................................................9-10
9-14 Port 3 Control Register (P3CON)........................................................................................9-11
9-15 Port 3 Interrupt Control Register (P3INT)............................................................................9-12
9-16 Port 3 Interrupt Pending Bits (INTPND2.5-.4)......................................................................9-12
9-17 Port 3 Interrupt Edge Selection Register (P3EDGE)............................................................9-13
9-18 Port 3 Pull-up Control Register (P3PUR) ............................................................................9-13
9-19 Port 4 High-Byte Control Register (P4CONH).....................................................................9-14
9-20 Port 4 Low-Byte Control Register (P4CONL).......................................................................9-14
9-21 Port 5 High-Byte Control Register (P5CONH).....................................................................9-15
9-22 Port 5 Low-Byte Control Register (P5CONL).......................................................................9-15
9-23 Port 6 Control Register (P6CON)........................................................................................9-16
xii S3C9228/P9228 MICROCONTROLLERS
List of Figures (Continued)
Figure Title Page
Number Number
10-1 Basic Timer Control Register (BTCON) ..............................................................................10-2
10-2 Basic Timer Block Diagram................................................................................................10-4
11-1 Timer 1 Control Register (TACON).....................................................................................11-2
11-2 Timer 1 Block Diagram (One 16-bit Mode) .........................................................................11-3
11-3 Timer A Control Register (TACON) ....................................................................................11-5
11-4 Timer B Control Register (TBCON) ....................................................................................11-6
11-5 Timer A Block Diagram (Two 8-bit Timers Mode) ...............................................................11-8
11-6 Timer B Block Diagram (Two 8-bit Timers Mode) ...............................................................11-9
12-1 Watch Timer Control Register (WTCON)............................................................................12-2
12-2 Watch Timer Circuit Diagram.............................................................................................12-3
13-1 LCD Function Diagram.......................................................................................................13-1
13-2 LCD Circuit Diagram ..........................................................................................................13-2
13-3 LCD Display Data RAM Organization .................................................................................13-3
13-4 LCD Mode Control Register (LMOD) ..................................................................................13-4
13-5 LCD Port Control Register..................................................................................................13-5
13-6 Internal Voltage Dividing Resistor Connection....................................................................13-6
13-7 LCD Signal Waveforms (1/8 Duty, 1/4 Bias).......................................................................13-7
13-8 LCD Signal Waveforms (1/4 Duty, 1/3 Bias).......................................................................13-8
13-9 LCD Signal Waveforms (1/3 Duty, 1/3 Bias).......................................................................13-9
14-1 A/D Converter Control Register (ADCON) ..........................................................................14-2
14-2 A/D Converter Data Register (ADDATAH/ADDATAL).........................................................14-3
14-3 A/D Converter Functional Block Diagram ...........................................................................14-3
14-4 Recommended A/D Converter Circuit for Highest Absolute Accuracy.................................14-4
15-1 Serial I/O Module Control Register (SIOCON)....................................................................15-2
15-2 SIO Prescaler Register (SIOPS).........................................................................................15-3
15-3 SIO Functional Block Diagram............................................................................................15-3
15-4 Serial I/O Timing in Transmit/Receive Mode (Tx at falling, SIOCON.4 = 0)........................15-4
15-5 Serial I/O Timing in Transmit/Receive Mode (Tx at rising, SIOCON.4 = 1).........................15-4
S3C9228/P9228 MICROCONTROLLERS xiii
List of Figures (Concluded)
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 External Interrupts.....................................................................................16-8
16-4 Input Timing for RESET......................................................................................................16-9
16-5 Serial Data Transfer Timing ................................................................................................16-9
16-6 Clock Timing Measurement at XIN.....................................................................................16-11
16-7 Clock Timing Measurement at XTIN...................................................................................16-12
16-8 Operating Voltage Range ...................................................................................................16-13
17-1 42-SDIP-600 Package Dimensions.....................................................................................17-1
17-2 44-QFP-1010B Package Dimensions..................................................................................17-2
18-1 S3P9228 44-QFP Pin Assignments .................................................................................... 18-1
18-2 S3P9228 42-SDIP Pin Assignments ...................................................................................18-2
18-3 Standard Operating Voltage Range .................................................................................... 18-5
19-1 SMDS Product Configuration (SMDS2+) ............................................................................19-2
19-2 TB9228 Target Board Configuration ...................................................................................19-3
19-3 Connectors (J101, J102) for TB9228 ..................................................................................19-6
19-4 S3C9228 Probe Adapter for 42-SDIP Package...................................................................19-7
19-5 S3C9228 Probe Adapter for 44-QFP Package....................................................................19-7
xiv S3C9228/P9228 MICROCONTROLLERS
List of Tables
Table Title Page
Number Number
1-1 Pin Descriptions .................................................................................................................1-6
6-1 Instruction Group Summary ................................................................................................6-2
6-2 Flag Notation Conventions .................................................................................................6-5
6-3 Instruction Set Symbols......................................................................................................6-5
6-4 Instruction Notation Conventions........................................................................................6-6
6-5 Opcode Quick Reference ...................................................................................................6-7
6-6 Condition Codes.................................................................................................................6-9
8-1 Register Values after RESET .............................................................................................8-4
9-1 S3C9228 Port Configuration Overview...............................................................................9-1
9-2 Port Data Register Summary..............................................................................................9-2
13-1 Common and Segment Pins per Duty Cycle.......................................................................13-3
16-1 Absolute Maximum Ratings................................................................................................16-2
16-2 D.C. Electrical Characteristics ............................................................................................16-2
16-3 Data Retention Supply Voltage in Stop Mode .....................................................................16-5
16-4 Input/Output Capacitance...................................................................................................16-6
16-5 A.C. Electrical Characteristics ............................................................................................16-7
16-6 A/D Converter Electrical Characteristics.............................................................................16-8
16-7 Main Oscillation Characteristics ..........................................................................................16-10
16-8 Sub Oscillation Characteristics...........................................................................................16-10
16-9 Main Oscillation Stabilization Time.....................................................................................16-11
16-10 Sub Oscillation Stabilization Time ......................................................................................16-12
18-1 Descriptions of Pins Used to Read/Write the EPROM.........................................................18-3
18-2 Comparison of S3P9228 and S3C9228 Features ................................................................18-3
18-3 Operating Mode Selection Criteria......................................................................................18-3
18-4 D.C. Electrical Characteristics ............................................................................................18-4
19-1 Power Selection Settings for TB9228..................................................................................19-4
19-2 The SMDS2+ Tool Selection Setting ..................................................................................19-5
19-3 Using Single Header Pins as the Input Path for External Trigger Sources ...........................19-5
S3C9228/P9228 MICROCONTROLLERS xv
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 ..................................................................................2-6
Chapter 5: Interrupt Structure
How to clear an interrupt pending bit ........................................................................................................5-6
Chapter 7: Clock Circuits
Switching the CPU clock ..........................................................................................................................7-6
How to Use Stop Instruction .....................................................................................................................7-7
S3C9228/P9228 MICROCONTROLLERS xvii
List of Register Descriptions
Register Full Register Name Page
Identifier Number
ADCON A/D Converter Control Register..............................................................................4-5
BTCON Basic Timer Control Register .................................................................................4-6
CLKCON System Clock Control Register...............................................................................4-7
FLAGS System Flags Register...........................................................................................4-8
INTPND1 Interrupt Pending Register 1...................................................................................4-9
INTPND2 Interrupt Pending Register 2...................................................................................4-10
LMOD LCD Mode Control Register ...................................................................................4-11
LPOT LCD Port Control Register......................................................................................4-12
OSSCON Oscillator Control Register .....................................................................................4-13
P0CON Port 0 Control Register...........................................................................................4-14
P0INT Port 0 Interrupt Enable Register.............................................................................4-15
P0PUR Port 0 Pull-up Resistors Enable Register................................................................4-16
P0EDGE Port 0 Interrupt Edge Selection Register ................................................................4-17
P1CON Port 1 Control Register...........................................................................................4-18
P1INT Port 1 Interrupt Enable Register.............................................................................4-19
P1PUR Port 1 Pull-up Resistors Enable Register................................................................4-20
P1EDGE Port 1 Interrupt Edge Selection Register ................................................................4-21
P2CON Port 2 Control Register...........................................................................................4-22
P2PUR Port 2 Pull-up Resistors Enable Register................................................................4-23
P3CON Port 3 Control Register...........................................................................................4-24
P3INT Port 2 Interrupt Enable Register.............................................................................4-25
P3PUR Port 3 Pull-up Resistors Enable Register................................................................4-26
P3EDGE Port 3 Interrupt Edge Selection Register ................................................................4-27
P4CONH Port 4 Control Register...........................................................................................4-28
P4CONL Port 4 Control Register Low Byte ...........................................................................4-29
P5CONH Port 5 Control Register High Byte ..........................................................................4-30
P5CONL Port 5 Control Register Low Byte ...........................................................................4-31
P6CON Port 6 Control Register...........................................................................................4-32
SIOCON SIO Control Register..............................................................................................4-33
STPCON Stop Control Register.............................................................................................4-34
SYM System Mode Register...........................................................................................4-35
TACON Timer 1/A Control Register.....................................................................................4-36
TBCON Timer B Control Register........................................................................................4-37
WTCON Watch Timer Control Register................................................................................4-38
S3C9228/P9228 MICROCONTROLLERS xix
List of Instruction Descriptions
Instruction Full Instruction Name Page
Mnemonic Number
ADC Add With Carry......................................................................................................6-11
ADD Add........................................................................................................................6-12
AND Logical AND...........................................................................................................6-13
CALL Call Procedure.......................................................................................................6-14
CCF Complement Carry Flag.........................................................................................6-15
CLR Clear......................................................................................................................6-16
COM Complement..........................................................................................................6-17
CP Compare................................................................................................................6-18
DEC Decrement.............................................................................................................6-19
DI Disable Interrupts...................................................................................................6-20
EI Enable Interrupts ....................................................................................................6-21
IDLE Idle Operation........................................................................................................6-22
INC Increment...............................................................................................................6-23
IRET Interrupt Return......................................................................................................6-24
JP Jump......................................................................................................................6-25
JR Jump Relative........................................................................................................6-26
LD Load ......................................................................................................................6-27
LDC/LDE Load Memory.........................................................................................................6-29
LDCD/LDED Load Memory and Decrement................................................................................6-31
LDCI/LDEI Load Memory and Increment .................................................................................6-32
NOP No Operation .........................................................................................................6-33
OR Logical OR .............................................................................................................6-34
POP Pop From Stack.....................................................................................................6-35
PUSH Push To Stack .......................................................................................................6-36
RCF Reset Carry Flag....................................................................................................6-37
RET Return....................................................................................................................6-38
RL Rotate Left.............................................................................................................6-39
RLC Rotate Left Through Carry......................................................................................6-40
RR Rotate Right...........................................................................................................6-41
RRC Rotate Right Through Carry ...................................................................................6-42
SBC Subtract With Carry ...............................................................................................6-43
SCF Set Carry Flag........................................................................................................6-44
SRA Shift Right Arithmetic.............................................................................................6-45
STOP Stop Operation.......................................................................................................6-46
SUB Subtract .................................................................................................................6-47
TCM Test Complement Under Mask ...............................................................................6-48
TM Test Under Mask....................................................................................................6-49
XOR Logical Exclusive OR.............................................................................................6-50
S3C9228/P9228 MICROCONTROLLERS xxi
S3C9228/P9228 PRODUCT OVERVIEW
1PRODUCT OVERVIEW
SAM88RCRI PRODUCT FAMILY
Samsung's SAM88RCRI family of 8-bit single-chip 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 flexible programming
environment for applications with varied memory and I/O requirements. Timer/counters with selectable operating
modes are included to support real-time operations.
S3C9228/P9228 MICROCONTROLLER
The S3C9228 can be used for dedicated control functions in a variety of applications, and is especially designed
for application with FRS or etc.
The S3C9228/P9228 single-chip 8-bit microcontroller is fabricated using an advanced CMOS process. It is built
around the powerful SAM88RCRI CPU core.
Stop and Idle power-down modes were implemented to reduce power consumption. To increase on-chip register
space, the size of the internal register file was logically expanded. The S3C9228/P9228 has 8K-byte of program
ROM, and 264-byte of RAM (including 16-byte of working register and 20-byte LCD display RAM).
Using the SAM88RCRI design approach, the following peripherals were integrated with the SAM88RCRI core:
— 7 configurable I/O ports including ports shared with segment/common drive outputs
— 10-bit programmable pins for external interrupts
— One 8-bit basic timer for oscillation stabilization and watch-dog functions
— Two 8-bit timer/counters with selectable operating modes
— Watch timer for real time
— 4 channel A/D converter
— 8-bit serial I/O interface
OTP
The S3C9228 microcontroller is also available in OTP (One Time Programmable) version. S3P9228
microcontroller has an on-chip 8K-byte one-time-programmable EPROM instead of masked ROM. The S3P9228
is comparable to S3C9228, both in function and in pin configuration.
1-1
PRODUCT OVERVIEW S3C9228/P9228
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 pins (44-pin QFP)
Interrupts
• 14 interrupt source and 1 vector
• One interrupt level
LCD Controller/Driver
• 16 segments and 8 common terminals
• 3, 4, and 8 common selectable
• Internal resistor circuit for LCD bias
8-bit Serial I/O Interface
• 8-bit transmit/receive mode
• 8-bit receive mode
• LSB-first or MSB-first transmission selectable
• Internal or external clock source
A/D Converter
• 10-bit converter resolution
• 50us conversion speed at 1MHz f
ADC
clock
• 4-channel
Two Power-Down Modes
• Idle: only CPU clock stops
• Stop: system clock and CPU clock stop
8-Bit Basic Timer
• Watchdog timer function
• 3 kinds of clock source
Two 8-Bit Timer/Counters
• The programmable 8-bit timer/counters
• External event counter function
• Configurable as one 16-bit timer/counters
Watch Timer
• Interval time: 3.91mS, 0.25S, 0.5S, and 1S
at 32.768 kHz
• 0.5/1/2/4 kHz Selectable buzzer output
• Clock source generation for LCD
Oscillation Sources
• Crystal, ceramic, or RC for main clock
• Main clock frequency: 0.4 MHz - 8MHz
• 32.768 kHz crystal oscillation circuit for
sub clock
Instruction Execution Times
• 500nS at 8MHz fx(minimum)
Operating Voltage Range
• 2.0 V to 5.5 V at 0.4 - 4.2MHz
• 2.7 V to 5.5 V at 0.4 - 8MHz
Operating Temperature Range
• -25 °C to +85 °C
Package Type
• 44-pin QFP, 42-pin SDIP
1-2
S3C9228/P9228 PRODUCT OVERVIEW
BLOCK DIAGRAM
X
IN
X
TAOUT/
P0.0
T1CLK/
P0.1
8-Bit Timer/
CounterA
8-Bit Timer/
CounterB
P0.0/TAOUT/INT
P0.1/T1CLK/INT
P0.2/INT
P0.3/BUZ/INT
P0.4
P0.5
P1.0/AD0/INT
P1.1/AD1/INT
P1.2/AD2/INT
P1.3/AD3/INT
P2.0/SCK/SEG1
P2.1/SO/SEG0
P2.2/SI
P2.3
P3.0/INTP/SEG3
P3.1/INTP/SEG2
16-Bit
Timer/
Counter1
I/O Port 0
I/O Port 1
I/O Port 2
I/O Port 3
RESET
8-Kbyte
ROM
XT
Port I/O and Interrupt
Control
SAM88RCRI CPU
IN
OUT
XT
OUT
264-Byte
Register
File
Watchdog
Timer
Basic Timer
Watch Timer
LCD
Driver/
Controller
SIO
BUZ/P0.3
COM0-COM3/P6.3-P6.0
COM4-COM7/
SEG19-SEG16/P5.7-P5.4
SEG0-SEG1/P2.1-P2.0
SEG2-SEG3/P3.1-P3.0
SEG4-SEG11/P4.0-P4.7
SEG12-SEG15/P5.0-P5.3
P2.0/SCK/SEG1
P2.1/SO/SEG0
P2.2/SI
P4.0-P4.7/
SEG4-SEG11
P5.0-P5.3/
SEG12-SEG15
P5.4-P5.7/
SEG16-SEG19/
COM7-COM4
I/O Port 4
I/O Port 5
Figure 1-1. Block Diagram
A/D Converter
I/O Port 6 P6.0-P6.3/COM3-COM0
P1.0-P1.3/AD0-AD3
1-3
PRODUCT OVERVIEW S3C9228/P9228
PIN ASSIGNMENTS
P0.5
P0.4
P0.3/BUZ/INT
P0.2/INT
P0.1/T1CLK/INT
P0.0/TAOUT/INT
COM0/P6.3
COM1/P6.2
COM2/P6.1
COM3/P6.0
COM4/SEG19/P5.7
4443424140393837363534
P1.0/AD0/INT
P1.1/AD1/INT
P1.2/AD2/INT
P1.3/AD3/INT
VDD
VSS
XOUT
XIN
TEST
XTIN
XTOUT
1
2
3
4
5
6
7
8
9
10
11
S3C9228
(44-QFP)
33
32
31
30
29
28
27
26
25
24
23
COM5/SEG18/P5.6
COM6/SEG17/P5.5
COM7/SEG16/P5.4
SEG15/P5.3
SEG14/P5.2
SEG13/P5.1
SEG12/P5.0
SEG11/P4.7
SEG10/P4.6
SEG9/P4.5
SEG8/P4.4
1213141516171819202122
P2.3
RESET
P2.2/SI
SEG4/P4.0
SEG5/P4.1
SEG6/P4.2
SEG7/P4.3
SEG0/P2.1/SO
SEG1/P2.0/SCK
SEG2/P3.1/INTP
SEG3/P3.0/INTP
Figure 1-2. S3C9228 44-QFP Pin Assignments
1-4
S3C9228/P9228 PRODUCT OVERVIEW
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
X
OUT
X
TEST
XT
XT
OUT
RESET
P2.3
P2.2/SI
SEG0/P2.1/SO
Figure 1-3. S3C9228 42-SDIP Pin Assignments
SS
1
2
3
4
5
6
7
8
S3C9228
(42-SDIP)
9
10
11
12
13
IN
14
15
IN
16
17
18
19
20
21
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
COM2/P6.1
COM3/P6.0
COM4/SEG19/P5.7
COM5/SEG18/P5.6
COM6/SEG17/P5.5
COM7/SEG16/P5.4
SEG15/P5.3
SEG14/P5.2
SEG13/P5.1
SEG12/P5.0
SEG11/P4.7
SEG10/P4.6
SEG9/P4.5
SEG8/P4.4
SEG7/P4.3
SEG6/P4.2
SEG5/P4.1
SEG4/P4.0
SEG3/P3.0/INTP
SEG2/P3.1/INTP
SEG1/P2.0/SCK
1-5
PRODUCT OVERVIEW S3C9228/P9228
PIN DESCRIPTIONS
Table 1-1. Pin Descriptions
Pin Names Pin
Type
P0.0
I/O
P0.1
P0.2
P0.3
P0.4-P0.5
P1.0
O
I/O
P1.1
P1.2
P1.3
P2.0
I/O
P2.1
P2.2
I/O
P2.3
P3.0
I/O
P3.1
1-bit programmable I/O port. Schmitt
trigger input or push-pull, open-drain
output and software assignable pull-ups.
1-bit programmable output port. C 43-44
1-bit programmable I/O port. Schmitt
trigger input or push-pull, open-drain
output and software assignable pull-ups.
1-bit programmable I/O port. Schmitt
trigger input or push-pull, open-drain
output and software assignable pull-ups. E-4 14(20)
1-bit programmable I/O port. Schmitt
trigger input or push-pull, open-drain
Pin Description Circuit
Number
E-4 39(3)
F-16A 1(7)
H-32A 16(22)
H-32B 18(24)
Pin
Numbers
40(4)
41(5)
42(6)
2(8)
3(9)
4(10)
15(21)
13(19)
17(23)
Share
Pins
TAOUT/INT
T1CLK/INT
INT
BUZ/INT
AD0/INT
AD1/INT
AD2/INT
AD3/INT
SCK/SEG1
SO/SEG0
SI
–
INTP/SEG3
INTP/SEG2
output and software assignable pull-ups.
P4.0–P4.7
I/O
1-bit programmable I/O port. Input or
H-32 19-26(25-32) SEG4-SEG11
push-pull, open-drain output and
software assignable pull-ups.
P5.0–P5.3
I/O
1-bit programmable I/O port. Input or
H-32 27-30(33-36) SEG12-SEG15
push-pull, open-drain output and
P5.4–P5.7 software assignable pull-ups. 31-34(37-40) SEG16-SEG19
/COM7-COM4
P6.0-P6.3
I/O
1-bit programmable I/O port. Input or
push-pull, open-drain output and
H-32 35-38
(41-42,1-2)
COM3-COM0
software assignable pull-ups.
NOTE: Parentheses indicate pin number for 42-SDIP-600 package.
1-6
S3C9228/P9228 PRODUCT OVERVIEW
Table 1-1. Pin Descriptions (Continued)
Pin Names Pin
Type
VDD, V
X
OUT
XT
OUT
, X
SS
IN
, XT
IN
– Power input pins for internal power block – 5,6(11,12) –
– Main oscillator pins for main clock – 7,8(13,14)
– Sub oscillator pins for sub clock – 11,10(17,16) –
TEST – Chip test input pin
Pin Description Circuit
Number
– 9(15) –
Pin
Numbers
Share
Pins
Hold GND when the device is operating
RESET
I RESET signal input pin. Schmitt trigger
B 12(18) –
input with internal pull-up resistor.
INT I/O External interrupts input. E-4
F-16A
39-42(3-6)
1-4(7-10)
P0.0-P0.3
P1.0-P1.3
INTP I/O Key scan interrupts inputs. H-32B 17-18(23-24) P3.1-P3.0
T1CLK I/O Timer 1/A external clock input. E-4 40(4) P0.1
TAOUT I/O Timer 1/A clock output. E-4 39(3) P0.0
AD0-AD3 I/O Analog input pins for A/D converts
F-16A 1-4(7-10) P1.0-P1.3
module.
BUZ I/O Buzzer signal output. E-4 42(6) P0.3
SCK
SO
I/O Serial clock, serial data output, serial data
input
H-32A 16-15(22-21) P2.0-P2.1
SI E-4 14(20) P2.2
SEG0-SEG1 I/O LCD segment signal output H-32A 15-16(21-22) P2.1-P2.0
SEG2-SEG3 H-32B 17-18(23-24) P3.1-P3.0
SEG4-SEG19 H-32 19-34(25-40) P4.0-P4.7
P5.0-P5.7
COM0-COM7 I/O LCD common signal output H-32 38-31
(2-1,42-37)
P6.3-P6.0
P5.7-P5.4
NOTE: Parentheses indicate pin number for 42-SDIP-600 package.
1-7
PRODUCT OVERVIEW S3C9228/P9228
PIN CIRCUIT DIAGRAMS
VDD
Pull-Up
Resistor
RESET
Data
Output
Disable
Noise Filter
Figure 1-4. Pin Circuit Type B
VDD
Output
VSS
Figure 1-5. Pin Circuit Type C
1-8