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.
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 (BSI Certificate No. FM24653). All semiconductor products are designed
and manufactured in accordance with the highest quality standards and objectives.
Samsung Electronics Co., Ltd.
San #24 Nongseo-Dong, Giheung-Gu
Yongin-City, Gyeonggi-Do, Korea
C.P.O. Box #37, 446-711
TEL: (82)-(31)-209-5238
FAX: (82)-(31)-209-6494
Home Page: http://www.samsung.com
Printed in the Republic of Korea
NOTIFICATION OF REVISIONS
ORIGINATOR: Samsung Electronics, LSI Development Group, Gi-Heung, South Korea
SUMMARY: As a result of additional product testing and evaluation, some specifications
published in S3C84I8X/F84I8X/C84I9X/F84I9X User's Manual, Revision 1.00,
have been changed. These changes for in S3C84I8X/F84I8X/C84I9X/F84I9X
microcontroller, which are described in detail in the
Revision Descriptions section below, are related to the followings:
— Chapter 4. Control Registers
DIRECTIONS: Please note the changes in your copy (copies) of the
S3C84I8X/F84I8X/C84I9X/F84I9X User’s Manual,
Revision 1.00. Or, simply attach the Revision Descriptions of the next page to
S3C84I8X/F84I8X/C84I9X/F84I9X User’s Manual, Revision 1.00.
REVISION HISTORY
Revision Description of Change Refer to
1.00 First edition. T.H. Kim Nov, 2006
2.00 Second edition Page 4-17 T.H. Kim June, 2007
Author(s)
Date
REVISION DESCRIPTIONS
1. Chapter 4. Control Registers
LPOT — LCD Port Control Register F7H Set 1, Bank1
Bit Identifier .7 .6 .5 .4 .3 .2 .1 .0
RESET Value
Read/Write
In the S3C84I9X/F84I9X microcontroller, page 0,1,2 are implemented.
In the S3C84I8X/F84I8X microcontroller, page 0,2 are implemented.
A hardware reset operation writes the 4-bit destination and source values shown
above to the register page pointer(00H). These values should be modified to
other pages
P0CON — Port 0 Control Register (High Byte) E6H Set 1, Bank0
.7–.6 P0.3/AD3/COM3 Configration Bits
.5–.4 P0.2/AD2/COM2 Configration Bits
.3–.2 P0.1/ AD1/COM1 Configration Bits
.1–.0 P0.0/ AD0/COM0 Configration Bits
0 0 Input mode
0 1 Input mode with pull-up
1 0 Push-pull output mode
1 1 Alternative function mode; AD3 input
0 0 Input mode
0 1 Input mode with pull-up
1 0 Push-pull output mode
1 1 Alternative function mode; AD2 input
0 0 Input mode
0 1 Input mode with pull-up
1 0 Push-pull output mode
1 1 Alternative function mode; AD1 input
0 0 Input mode
0 1 Input mode with pull-up
1 0 Push-pull output mode
1 1 Alternative function mode; AD0 input
NOTE: If you want to use P0 as a LCD port, you must set LPOT register appropriately.(Refer to Ex .2 below)
If you want to use P0 as a Normal I/O or Alternative function(ADC0~ADC3), you must set LPOT register
appropriately. (Refer to Ex. 1 below)
For example,
(1) LD LPOT,#00000000B ; P0.0~P0.3 is Normal I/O or Alternative function(ADC0~ADC3).
(2) LD LPOT,#01001111B ; P0.0~P0.3 is LCD port.
P2CONH — Port 2 Control Register (High Byte) ECH Set 1, Bank0
.7–.6 P2.7/SEG3/TxD Configration Bits
.5-.4 P2.6/SEG2/RxD Configration Bits
.3–.2 P2.5/ SEG1/SCK Configration Bits
.1–.0 P2.4/SEG0/SO Configration Bits
0 0 Input mode
0 1 Alternative function mode: Not used
1 0 Push-pull output mode
1 1 Alternative function mode: TxD output
0 0 Input mode ; RxD input
0 1 Alternative function mode: Not used
1 0 Push-pull output mode
1 1 Alternative function mode: RxD output
0 0 Input mode ; SCK input
0 1 Alternative function mode: Not used
1 0 Push-pull output mode
1 1 Alternative function mode: SCK output
0 0 Input mode
0 1 Alternative function mode: Not used
1 0 Push-pull output mode
1 1 Alternative function mode: SO output
NOTE: If you want to use a P2 as LCD port, you must set LPOT register appropriately. (Refer to Ex. 2 below)
If you want to use a P2 as Normal I/O or Alternative function(SO/SCK/RxD/TxD), you must set LPOT
register appropriately. (Refer to Ex. 1 below)
For example,
(1) LD LPOT,#00000000B ; P2.4~P2.7 is Normal I/O or Alternative function(SO/SCK/RxD/TxD).
(2) LD LPOT,#01001111B ; P2.4~P2.7 is LCD port.
NOTE: If you want to use P3 as a LCD port, you must set LPOT register appropriately. (Refer to Ex. 2 below)
If you want to use P3 as a Normal I/O, you must set LPOT register appropriately. (Refer to Ex. 1 below)
For example,
(1) LD LPOT,#00000000B ; P3.4~P3.7 is Normal I/O.
(2) LD LPOT,#01001111B ; P3.4~P3.7 is LCD port.
NOTE: If you want to use P3 as a LCD port, you must set LPOT register appropriately. (Refer to Ex. 2 below)
If you want to use P3 as a Normal I/O, you must set LPOT register appropriately. (Refer to Ex. 1 below)
For example,
(1) LD LPOT,#00000000B ; P3.0~P3.3 is Normal I/O.
(2) LD LPOT,#01001111B ; P3.0~P3.3 is LCD port.
NOTE: If you want to use P4 as a LCD port, you must set LPOT register appropriately. (Refer to Ex. 2 below)
If you want to use P4 as a Normal I/O, you must set LPOT register appropriately. (Refer to Ex. 1 below)
For example,
(1) LD LPOT,#00000000B ; P4.4~P4.7 is Normal I/O.
(2) LD LPOT,#01001111B ; P4.4~P4.7 is LCD port.
NOTE: If you want to use P4 as a LCD port, you must set LPOT register appropriately. (Refer to Ex. 2 below)
If you want to use P4 as a Normal I/O, you must set LPOT register appropriately. (Refer to Ex. 1 below)
For example,
(1) LD LPOT,#00000000B ; P4.0~P4.3 is Normal I/O.
(2) LD LPOT,#01001111B ; P4.0~P4.3 is LCD port.
1. In the S3C84I8X/F84I8X microcontroller, the internal register file is configured as two pages (Page 0, Page 2).
The page 0 is used for the general-purpose register file and data register.
2. In the S3C84I9X/F84I9X microcontroller, the internal register file is configured as three pages (Page 0-2)
The page 0 and page 1 are used for the general-purpose register file and data register .
3. The page 2 is used for the LCD display ram and it is a write-only memory.
Port 2 is an 8-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 E2H in set 1, bank 0. P2.0–P2.7 can serve as digital inputs, outputs (push
pull) or you can configure the following alternative functions:
— General-purpose digital I/O
— Alternative function: SEG0-SEG3, ADC4, ADC7, SI, T1CAP0, T1OUT0, T1CK0, TBPWM, PWM
.
16. PORT CONTROL REGISTERS (PAGE 9-10)
Port 2 Control Register, High Byte (P2CONH)
ECH, Set1, Bank0, R/W, Reset value="00"
.7.6.5.4.3.2.1.0MSBLSB
[.7-.6] P2.7/SEG3/TxD Configuration Bits
0 0 = Input mode
0 1 = Alternative function mode; Not used
1 0 = Push-pull output mode
1 1 = Alternative function mode; TxD output
[.5-.4] P2.6/SEG2/RxD Configuration Bits
0 0 = Input mode; RxD iput
0 1 = Alternative function mode; Not used
1 0 = Push-pull output mode
1 1 = Alternative function mode; RxD output
[.3-.2] P2.5/SEG1/SCK Configuration Bits
0 0 = Input mode; SCK input
0 1 = Alternative function mode; Not used
1 0 =
Push-pull output mode
1 1 = Alternative function mode; SCK output
[.1-.0] P2.4/SEG0/SO Configuration Bits
0 0 = Input mode
0 1 = Alternative function mode; Not used
1 0 = Push-pull output mode
1 1 = Alternative function mode; SO output
Figure 9-6. Port 2 High-Byte Control Register (P2CONH)
) PROGRAMMING TIP — To make P2 as Normal I/O or Alternative function
ORG 0100H ; Reset address
START DI
•
•
SB1
LD LPOT,# 00H ; P2 is normal I/O or alternative function
SB0
LD P2CONH,#00H ; P2 is input mode
LD P2CONH,#0AAH ; P2 is Push-pull output mode
•
LD P2CONH,#0FFH ; P2 is TXOUT,RXOUT,SCK OUT,SO OUT
• SB1
LD LPOT,# 04FH ; P2 is LCD port
SB0
LD P2CONH,#0AAH ; If you use P2 as LCD port,P2CONH register value doesn’t care
LD P2PUR,#00H ; P2PUR is disabled when P2 is used as a LCD port.
) PROGRAMMING TIP — To make P3 as Normal I/O or Alternative function
ORG 0100H ; Reset address
START DI
•
•
SB1
LD LPOT,# 00H ; P3 is normal I/O or alternative function
SB0
LD P3CONH,#00H ; P3 is input mode
LD P3CONL,#00H ; P3 is input mode
•
LD P3CONH,#55H ; P3 is input mode with pull-up
LD P3CONL,#55H ; P3 is input mode with pull-up
LD P3CONH,#0AAH ; P3 is Push-pull output mode
LD P3CONL,#0AAH ; P3 is Push-pull output mode
LD P3CONH,#0FFH ; P3 is N-channel open-drain output
LD P3CONL,#0FFH ; P3 is N-channel open-drain output
• SB1
LD LPOT,# 04FH ; P3 is LCD port
SB0
LD P3CONH,#0AAH ; If you use P3 as LCD port,P3CONH register value doesn’t care
LD P3CONL,#0AAH ; If you use P3 as LCD port,P3CONL register value doesn’t care
) PROGRAMMING TIP — To make P4 as Normal I/O or Alternative function
ORG 0100H ; Reset address
START DI
•
•
SB1
LD LPOT,#00H ; P4 is normal I/O or alternative function
SB0
LD P4CONH,#00H ; P4 is input mode
LD P4CONL,#00H ; P4 is input mode
•
LD P4CONH,#55H ; P4 is input mode with pull-up
LD P4CONL,#55H ; P4 is input mode with pull-up
LD P4CONH,#0AAH ; P4 is Push-pull output mode
LD P4CONL,#0AAH ; P4 is Push-pull output mode
LD P4CONH,#0FFH ; P4 is N-channel open-drain output
LD P4CONL,#0FFH ; P4 is N-channel open-drain output
• SB1
LD LPOT,# 4FH ; P4 is LCD port
SB0
LD P4CONH,#0AAH ; If you use P4 as LCD port,P3CONH register value doesn’t care
LD P4CONL,#0AAH ; If you use P4 as LCD port,P3CONL register value doesn’t care
In capture mode, a signal edge that is detected at the TACAP pin opens a gate and loads the current counter
value into the Timer A data register. You can select rising or falling edges to trigger this operation.
Timer A also gives you capture-input source: the signal edge at the TACAP pin. You select the capture input by
setting the value of the Timer A capture input selection bit in the port 1 control register, P1CONL, (set 1, bank 0,
E9H). When P1CONL.5-.4 is ‘00’ or ‘01’, the TACAP input or normal input is selected. When P1CONL.5-.4 is set
to 1X, normal push-pull output is selected.
Both kinds of timer A interrupts can be used in capture mode: the timer A overflow interrupt is generated
whenever a counter overflow occurs; the timer A match/capture interrupt is generated whenever the counter
value is loaded into the Timer A data register.
RAM addresses of page 2 are used as LCD data memory. It is Write-only 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–SEG19 using a direct memory access (DMA)
method that is synchronized with the f
LCD
signal.
28. TOOL PROGRAM MODE (PAGE 20-1, 20-2)
Table 20-1. Descriptions of Pins Used to Read/Write the Flash ROM
Main Chip During Programming
Pin Name Pin Name Pin No. I/O Function
P1.2 SDAT 3 (44-pin)
9 (42-pin)
P1.3 SCLK 4 (44-pin)
10 (42-pin)
TEST VPP 9 (44-pin)
15 (42-pin)
nRESET nRESET 12 (44-pin)
18 (42-pin)
VDD/VSS VDD/VSS
5/6 (44-pin)
11/12 (42-pin)
I/O Serial data pin (output when reading, Input
when writing) Input and push-pull output port
can be assigned
I Serial clock pin (input only pin)
I Power supply pin for flash ROM cell writing
(indicates that MTP enters into the writing
mode). When 12.5 V (S3F84I8) /
Vdd(S3F84I9) is applied, MTP is in writing
mode.
I
I Logic power supply pin.
Table 21-2. Comparison of S3F84I8X/F84I9X and S3C84I8X/C84I9X Features
Characteristic S3F84I8X/84I9X S3C84I8X/84I9X
Program Memory 8 Kbyte Flash ROM for S3F84I8X
32 Kbyte Flash ROM for S3F84I9X
Operating Voltage (VDD)
2.5 V to 5.5 V (LVR off)
LVR to 5.5 V (LVR on)
= 5 V, VPP = 12.5 V (S3F84I8X)
MTP Programming Mode
V
DD
8 Kbyte Mask ROM for S3C84I8X
32 Kbyte Mask ROM for S3C84I9X
2.5 V to 5.5 V (LVR off)
LVR to 5.5 V (LVR on)
5V (S3F84I9X)
Pin Configuration 44QFP / 42SDIP
EPROM Programmability User Program multi time Programmed at the factory
29. FLASH MEMORY CONTROL REGISTERS (PAGE 20-1,20-2)
Flash Memory Control Register
FMCON register is available only in user program mode to program some data to the flash memory.
Flash Memory Control Register(FMCON)
FCH Set1 Bank1 R/W
MSB
Flash Memory Mode Selection Bits
0101: Programming mode
1010: Erase mode
0110: Hard lock mode
others: Not used for S3F84I9
.7.6.5.4.3.2.1.0
Flash Operation Start Bit
0 = Operation stop
1 = Operation start
( This bit will be cleared automatically
just after the corresponding operation
completed. )
Sector Erase Fail Flag
0 = Sector Erase success
1 = Sector Erase fail
INT enable bit during sector erase
0 = INT disable
1 = INT enable
LSB
Figure 20-1. Flash Memory Control Register (FMCON)
You can select whether to use interrupt or not during Flash Sector erase process.
If you set FMCON.3 to “0”, you don’t use interrupt during Flash Sector erase process.
If you set FMCON.3 to “1”, you use interrupt during Flash Sector erase process.
If you intended to use some interrupts during Flash Sector erase, you must check Sector Erase Fail Flag after
Flash Sector erase is done. Please refer to page 20-7.
) PROGRAMMING TIP — Sector Erase (Not to use an interrupt)
•
•
SB1
LD FMUSR,#0A5H ; User Program mode enable
LD FMSECH,#2 ; Set Sector 4 (200H–27FH)
LD FMSECL,#00H ; You can set FMSECL from 00H to 7FH.
LD FMCON,#10100001B ; Start sector erase
LD FMUSR,#0 ; User Program mode disable
SB0
) PROGRAMMING TIP — Sector Erase (To use an interrupt)
•
•
SB1
LD FMUSR,#0A5H ; User Program mode enable
LD FMSECH,#2 ; Set Sector 4 (200H–27FH)
LD FMSECL,#00H ; You can set FMSECL from 00H to 7FH.
REPEAT:
LD FMCON,#10101001B ; Start sector erase and enable INT during erasing
NOP
NOP
TM FMCON,#4 ; Sector erase fail flag check
JP NZ,REPEAT ; if failed, repeat Sector erase
Samsung provides a powerful and easy-to-use development support system on a turnkey basis. The
development support system is composed of a host system, debugging tools, and supporting software. For a host
system, any standard computer that employs Win95/98/2000/XP as its operating system can be used. A
sophisticated debugging tool is provided both in hardware and software: the powerful in-circuit emulator,
OPENice-i500 and SK-1200, for the S3C7-, S3C9-, and S3C8- microcontroller families. Samsung also offers
supporting software that includes, debugger, an assembler, and a program for setting options.
Target Boards
Target boards are available for all the S3C8/S3F8-series microcontrollers. All the required target system cables
and adapters are included on the device-specific target board. TB84I9/8 is a specific target board for the
development of application systems using S3F84I9X/8X.
programming socket adapter
When you program S3F84I9X/I8X’s flash memory by using an emulator or OTP/MTP writer, you need a specific
programming socket adapter for S3F84I9X/I8X.
The TB80KB target board can be used for development of S3F80K9X and S3F80KBX together.
But you should be careful to set the memory size to program internal flash memory.
The TB80KB target board is operated as target CPU with Emulator (SK-1200, OPENIce I-500)
CN1 100-pin connector Connection between emulator and TB84I9/8 target
board.
J101/J102 50-pin connector Connection between target board and user application
system
RESET Push button Generation low active reset signal to S3F84I9X/8X
EVA-chip
VCC, GND POWER connector External power connector for TB84I9/8
IDLE, STOP LED STOP/IDLE Display Indicate the status of STOP or IDLE of S3F84I9X/8X
EVA-chip on TB8I9/8 target board
Table 23-2. Power Selection Settings for TB84I9
To User_Vcc' Settings Operating Mode Comments
To User_V
OffOn
DD
TB84I9
V
DD
V
SS
V
DD
SMDS2+ or SK-1000
To User_V
OffOn
DD
V
DD
SMDS2+ or SK-1000
TB84I9
External
DD
V
V
SS
IDLE LED
This LED is ON when the evaluation chip (S3E84I0) is in idle mode.
Target
System
Target
System
SMDS2+ or SK-1000 supplies
to the target board
V
DD
(evaluation chip) and the
target system.
SMDS2+ or SK-1000 supplies
only to the target board
V
DD
(evaluation chip). The target
system must have a power
supply of its own.
STOP LED
This LED is ON when the evaluation chip (S3E84I0) is in stop mode.
SAMSUNG provides a complete line of development tools for SAMSUNG's microcontroller. With long experience
in developing MCU systems, our third parties are leading companies in the tool's technology. SAMSUNG Incircuit emulator solution covers a wide range of capabilities and prices, from a low cost ICE to a complete system
with an OTP/MTP programmer.
• Convenient USB connection to any IBM compatible
PC or Laptop computers.
• Operated by USB power of PC
• PC-based menu-drive software for simple operation
• Very fast program and verify time
( OTP:2Kbytes per second, MTP:10Kbytes per
second)
• Support Samsung standard Hex or Intel Hex format
• Driver software run under various O/S
(Windows 95/98/2000/XP)
• Full function regarding OTP/MTP programmer
(Read, Program, Verify, Blank, Protection..)
• Support Firmware upgrade
SEMINIX
• TEL: 82-2-539-7891
• FAX: 82-2-539-7819.
• E-mail:
sales@seminix.com
• URL:
http://www.seminix.com
GW-PRO2
Gang Programmer for OTP/MTP/FLASH MCU
• 8 devices programming at one time
• Fast programming speed (1.2Kbyte/sec)
• PC-based control operation mode or Stand-alone
• Full Function regarding OTP/MTP program
(Read, Program, Verify, Protection, Blank..)
• Data back-up even at power break
After setup in Design Lab, it can be moved to the
factory site.
• Key Lock protecting operator's mistake
• Good/Fail quantity displayed and memorized
• Buzzer sounds after programming
• User friendly single-menu operation (PC)
• Operation status displayed in LCD panel
SEMINIX
• TEL: 82-2-539-7891
• FAX: 82-2-539-7819.
• E-mail:
sales@seminix.com
• URL:
http://www.seminix.com
39
Preface
The S3C84I8X/F84I8X/C84I9X/F84I9X Microcontroller User's Manual is designed for application designers and
programmers who are using the S3C84I8X/F84I8X/C84I9X/F84I9X microcontroller 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 1, "Product Overview," is a high-level introduction to S3C84I8X/F84I8X/C84I9X/F84I9X with general
product descriptions, as well as detailed information about individual pin characteristics and pin circuit types.
Chapter 2, "Address Spaces," describes program and data memory spaces, the internal register file, and register
addressing. 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
S3C8-series 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 a standardized 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 S3C84I8X/F84I8X/C84I9X/F84I9X interrupt structure in detail and
further prepares you for additional information presented in the individual hardware module descriptions in Part II.
Chapter 6, "Instruction Set," describes the features and conventions of the instruction set used for all S3C8-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 S3C8-series microcontroller 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.
Chapter 4 Control Registers
Chapter 5 Interrupt Structure
Chapter 6 Instruction Set
Part II "hardware Descriptions," has detailed information about specific hardware components of the
S3C84I8X/F84I8X/C84I9X/F84I9X microcontroller. Also included in Part II are electrical, mechanical, OTP, and
development tools data. It has 17 chapters:
Program Memory (ROM) ...............................................................................................................................2-2
Register Set 1.......................................................................................................................................2-9
Register Set 2.......................................................................................................................................2-9
Prime Register Space...........................................................................................................................2-10
Working Registers ................................................................................................................................2-12
Using The Register Pointers.................................................................................................................2-13
Common Working Register AREA (C0H–CFH) ...................................................................................2-17
4-Bit Working Register Addressing ......................................................................................................2-18
8-Bit Working Register Addressing ......................................................................................................2-20
System and User Stack .................................................................................................................................2-22
Direct Address Mode (DA).............................................................................................................................3-10
Data Types........................................................................................................................................... 6-1
Flag Descriptions ................................................................................................................................. 6-7
Instruction Set Notation........................................................................................................................ 6-8
System Clock Circuit ............................................................................................................................7-1
Clock Status During Power-Down Modes............................................................................................7-2
System Clock Control Register (CLKCON)..........................................................................................7-3
Chapter 8 RESET and Power-Down
System Reset.................................................................................................................................................8-1
Port Data Registers ..............................................................................................................................9-2
Port 0 ....................................................................................................................................................9-3
Port 1 ....................................................................................................................................................9-6
Port 2 ....................................................................................................................................................9-9
Port 3 ....................................................................................................................................................9-14
Port 4 ....................................................................................................................................................9-17
Function Description...................................................................................................................................... 13-1
Function Description ......................................................................................................................................16-1
A/D Converter Control Register (ADCON)...........................................................................................16-2
Internal Reference Voltage Levels .......................................................................................................16-4
Hard Lock Protection..................................................................................................................................... 20-12
STOP LED ........................................................................................................................................... 23-4
21-4 A.C. Electrical Characteristics ...................................................................................21-6
21-5 Main Oscillator Frequency (f
21-6 Main Oscillator Clock Stabilization Time (t
21-7 Sub Oscillator Frequency (f
21-8 Subsystem Oscillator (crystal) Stabilization Time (t
xvi S3C84I8X/F84I8X/C84I9X/F84I9X_USER’S MANUAL_REV 2.00 MICROCONTROLLER
List of Programming Tips
Description Page
Number
Chapter 2: Address Spaces
Using the Page Pointer for RAM Clear (Page 0, Page 1).............................................................................2-8
Addressing the Common Working Register Area.........................................................................................2-18
Standard Stack Operations Using PUSH and POP......................................................................................2-23
Chapter 11: 8-bit Timer A/B
To Generate 38 kHz, 1/3duty Signal Through P2.0......................................................................................11-9
To Generate a One Pulse Signal Through P2.0...........................................................................................11-10
Using the Timer A..........................................................................................................................................11-11
Using the Timer B..........................................................................................................................................11-12
Chapter 12: 16-bit Timer 1(0,1)
Using the Timer 1(0)......................................................................................................................................12-7
Chapter 13: 10-Bit PWM (Pulse Width Modulation)
Programming the PWM Module to Sample Specifications ...........................................................................13-7
Using the Watch Timer..................................................................................................................................17-4
Chapter 20: Embedded Flash Memory Interface
Sector Erase (Not to use an interrupt) ..........................................................................................................20-7
Sector Erase (To use an interrupt)................................................................................................................20-7
Hard Lock Protection.....................................................................................................................................20-12
S3C84I8X/F84I8X/C84I9X/F84I9X_USER’S MANUAL_REV 2.00 MICROCONTROLLER 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
FMCON Flash Memory Control Register.................................................................................4-8
Samsung's S3C8-series of 8-bit single-chip CMOS microcontrollers offers a fast and efficient CPU, a wide range
of integrated peripherals, and various mask-programmable ROM sizes. The major CPU features are:
— Efficient register-oriented architecture
— Selectable CPU clock sources
— Idle and Stop power-down mode released by interrupt or reset
— Built-in basic timer with watchdog function
A sophisticated interrupt structure recognizes up to eight-interrupt levels. Each level can have one or more
interrupt sources and vectors. Fast interrupt processing (within a minimum of four CPU clocks) can be assigned to
specific interrupt levels.
S3C84I8X/F84I8X/C84I9X/F84I9X MICROCONTROLLER
The S3C84I8X/F84I8X/C84I9X/F84I9X single-chip CMOS microcontrollers are fabricated using the highly
advanced CMOS process technology based on Samsung’s latest CPU architecture.
The S3C84I9X is a microcontroller with a 32K-byte mask-programmable ROM embedded.
The S3F84I9X is a microcontroller with a 32K-byte Full Flash ROM embedded.
The S3C84I8X is a microcontroller with a 8K-byte mask-programmable ROM embedded.
The S3F84I8X is a microcontroller with a 8K-byte Half Flash ROM embedded.
Using a proven modular design approach, Samsung engineers have successfully developed the
S3C84I8X/F84I8X/C84I9X/F84I9X by integrating the following peripheral modules with the powerful SAM8 core:
— Five programmable I/O ports (42SDIP: 32pins, 44QFP: 34pins) including ports shared with segment/common
drive outputs.
— Four bit-programmable pins for external interrupts.
— One 8-bit basic timer for oscillation stabilization and watchdog function (system reset).
— Two 8-bit timer/counter and Two 16-bit timer/counter with selectable operating modes.
— One asynchronous UART and One synchronous SIO
— One 10-bit PWM output
— 10-bit 8-channel A/D converter
— Watch timer for real time
The S3C84I8X/F84I8X/C84I9X/F84I9X is versatile microcontroller for home appliances and ADC applications, etc.
They are currently available in 44-pin QFP and 42-pin SDIP(Only for S3C84I9X/F84I9X) package.
P0.0–P0.3 I/O Bit programmable port; input or output mode selected
P1.0–P1.5 I/O Bit programmable port; input or output mode selected
P2.0–P2.3
P2,4–P2.7
P3.0–P3.7 I/O Bit programmable port; input or output mode selected
P4.0–P4.3
P4.4–P4.7
Pin
Type
by software; input or push-pull output. Software
assignable pull-up resistor.
Alternately, can be used as COM0~COM3
AD0~AD3
by software; input or push-pull output. Software
assignable pull-up resistor. Alternatively can be used
as INT0~INT3, TAOUT, TACK,
TACAP, T1CAP1,T1CK1,T1OUT1,AD5,AD6.
I/O Bit programmable port; input or output mode selected
by software; input or push-pull output. Software
assignable pull-up.
Alternately, can be used as ADC4,ADC7,SI,
TBPWM,PWM,T1CAP0,T1CK0
SEG0~SEG3,SO,SCK,RxD,TxD
by software; input or push-pull,N-channel open-drain
output. Software assignable pull-up.Alternately, can be
used as SEG4~SEG11
I/O Bit programmable port; input or output mode selected
by software; input or push-pull,
N-channel open-drain output. Software assignable pullup. Alternatively can be used as
SEG12~SEG15
SEG16~SEG19/COM4~COM7
Pin
Description
Circuit
Type
H-16 29-32
D-5
E
E
D-5
H-18
H-17 33-40
H-17
H-14
Pin
Number
(25-28)
7-10
(1-4)
19-20
(13-14)
24-31
(21,22)
23-26
(19-22)
(29-36)
1,2,41,42
(37-40)
3-6
(41-44)
Share
Pins
COM0/ADC0
COM1/ADC1
COM2/ADC2
COM3/ADC3
INT0~INT3
TAOUT,TACK
TACAP,T1CK1
T1CAP1,AD5
T1OUT1,AD6
ADC4,ADC7
TBWPM,PWM
T1CAP0
T1CK0,SI
SEG0~SEG3
SO,SCK
RxD,TxD
SEG4~SEG11
SEG12~SEG15
SEG16~SEG19
COM4~COM7
NOTE: Pin numbers shown in parentheses "( )" are for the 44-pin QFP package.
ADC0–ADC7 I Analog input pins for A/D converter module.
Alternatively used as general-purpose digital
input/output port 0, port1 and port 2.
E
H-16
29-32,
21,22
(25-28,
15-18)
AV
REF
, AVSS
– A/D converter reference voltage and ground – 27,28
(23,24)
RxD I Serial data RxD pin for receive input and
transmit output (mode 0)
TxD O Serial data TxD pin for transmit output and
shift clock output (mode 0)
H-18 25
(21)
H-18 26
(22)
TACK I External clock input pins for timer A D-5 8(2) P1.1
TACAP I Capture input pins for timer A D-5 9(3) P1.2
TAOUT O Pulse width modulation output pins for timer AD-5 7(1) P1.0
TBPWM O Carrier frequency output pins for timer B D-5 19(13) P2.0
T1CK0 I External clock input pins for timer 1(0) D-5 19(13) P2.0
T1CAP0 I Capture input pins for timer 1(0) D-5 20(14) P2.1
T1OUT0 O Timer 1(0) 16-bit PWM mode output or
D-5 21(15) P2.2
counter match toggle output pins
T1CK1 I External clock input pins for timer 1(1) E (16) P1.4
T1CAP1 I Capture input pins for timer 1(1) E (17) P1.5
T1OUT1 O Timer 1(1) 16-bit PWM mode output or
E 10(4) P1.3
counter match toggle output pins
SEG0–SEG3
SEG4–SEG15
SEG16–SEG19
COM0–COM3
COM4–COM7
O LCD segment display signal output pins H-18
H-17
H-14
O LCD common signal output pins H-16 29-32
23-26
(19-22)
1,2
33-42
(29-40)
3-6,
(41-44)
(25-28)
3-6
(41-44)
Share
Pins
P1.0–P1.3
P0.0–P0.3
P2.2–P2.3
P1.4–P1.5
–
P2.6
P2.7
P2.4–P2.7
P3.0–P3.7
P4.0–P4.7
P0.0–P0.3
P4.4–P4.7
NOTES:
1. Pin numbers shown in parentheses "( )" are for the 44-pin QFP package.
The S3C84I8X/F84I8X/C84I9X/F84I9X microcontroller has two types of address space:
— Internal program memory (ROM)
— Internal register file (RAM)
A 16-bit address bus supports program memory operations. A separate 8-bit register bus carries addresses and
data between the CPU and the register file.
The S3C84I9X/F84I9X has an internal 32-Kbyte mask-programmable ROM / 32-Kbyte Flash ROM and 528-byte
RAM.
The S3C84I8X/F84I8X has an internal 8-Kbyte mask-programmable ROM / 8-Kbyte Flash ROM and 272-byte
RAM.
Program memory (ROM) stores program codes or table data. The S3C84I9X/F84I9X has 32Kbytes of internal
mask programmable program memory and the S3C84I8X/F84I8X has 8Kbytes of internal mask programmable
program memory. The program memory address range is therefore 0H-7FFFH and 0H-1FFFH (see Figure 2-1).
The first 256 bytes of the ROM (0H-0FFH) are reserved for interrupt vector addresses. Unused locations in this
address range can be used as normal program memory. If you use the vector address area to store a program
code, be careful not to overwrite the vector addresses stored in these locations.
The ROM address at which a program execution starts after a reset is 0100H.
Smart option is the ROM option for starting condition of the chip. The ROM addresses used by smart option are
from 003CH to 003FH. The default value of ROM is FFH.
ROM Address: 003CH
.7.6.5.4.3.2.1.0MSBLSB
Not used
ROM Address: 003DH
.7.6.5.4.3.2.1.0MSBLSB
Not used
ROM Address: 003EH
.7.6.5.4.3.2.1.0MSBLSB
Not used
ROM Address: 003FH
.7.6.5.4.3.2.1.0MSBLSB
LVR on-off control bit
0 = Disable
1 = Enable
NOTE:
The value of unused bits of 03CH,03DH,03EH and 03FH must be logic "1"
In the S3C84I8X/F84I8X/C84I9X/F84I9X implementation, the upper 64-byte area of register files is expanded two
64-byte areas, called set 1 and set 2. The upper 32-byte area of set 1 is further expanded two 32-byte register
banks (bank 0 and bank 1), and the lower 32-byte area is a single 32-byte common area. set 2 is logically
expanded 2 separately addressable register pages, page 0–page 1.
In case of S3C84I9X/F84I9X the total number of addressable 8-bit registers is 594. Of these 594 registers, 16
bytes are for CPU and system control registers, 50 bytes are for peripheral control and data registers, 16 bytes
are used as a shared working registers, 20bytes are LCD data registers and 492 registers are for general-purpose
use.
In case of S3C84I8X/F84I8X the total number of addressable 8-bit registers is 358. Of these 358 registers, 16
bytes are for CPU and system control registers, 50 bytes are for peripheral control and data registers, 16 bytes
are used as a shared working registers, 20bytes are LCD data registers and 256 registers are for general-purpose
use.
You can always address set 1 register location, regardless of which of the 2 register pages is currently selected.
The set 1 locations, however, can only be addressed using direct addressing modes.
The extension of register space into separately addressable areas (sets, banks, and pages) is supported by
various addressing mode restrictions, the select bank instructions, SB0 and SB1, and the register page pointer
(PP).
Specific register types and the area (in bytes) that they occupy in the register file are summarized in Table 2-1
and Table 2-2.
Table 2-1. S3C84I9X/F84I9X Register Type Summary
Register Type Number of Bytes
General-purpose registers (including 16-byte common
working register area, two 192-byte prime register area,
and two 64-byte set 2 area)
LCD data registers (Page2 ’s 00H~13H)
CPU and system control registers
Mapped clock, peripheral, I/O control, and data registers
Total Addressable Bytes
528
20
16
50
614
Table 2-2. S3C84I8X/F84I8X Register Type Summary
Register Type Number of Bytes
General-purpose registers (including 16-byte common
working register area, expanded 2 separately
addressable register pages. LCD data registers (Page2’s
00H~13H)
CPU and system control registers
272
20
16
50
Mapped clock, peripheral, I/O control, and data registers
Total Addressable Bytes
The S3C8-series architecture supports the logical expansion of the physical 512-byte internal register file (using
an 8-bit data bus) into as many as 2 separately addressable register pages. Page addressing is controlled by the
register page pointer (PP, DFH). In the S3C84I8X/F84I8X/C84I9X/F84I9X microcontroller, a paged register file
expansion is implemented for data registers, and the register page pointer must be changed to address other
pages.
After a reset, the page pointer's source value (lower nibble) and the destination value (upper nibble) are always
"0000", automatically selecting page 0 as the source and destination page for register addressing.
In the S3C84I9X/F84I9X microcontroller, page 0,1,2 are implemented.
In the S3C84I8X/F84I8X microcontroller, page 0,2 are implemented.
A hardware reset operation writes the 4-bit destination and source values shown
above to the register page pointer(00H). These values should be modified to
other pages
The term set 1 refers to the upper 64 bytes of the register file, locations C0H–FFH.
The upper 32-byte area of this 64-byte space (E0H–FFH) is expanded two 32-byte register banks, bank 0 and
bank 1. The set register bank instructions, SB0 or SB1, are used to address one bank or the other. A hardware
reset operation always selects bank 0 addressing.
The upper two 32-byte areas (bank 0 and bank 1) of set 1 (E0H–FFH) contains 64 mapped system and peripheral
control registers. The lower 32-byte area contains 16 system registers (D0H–DFH) and a 16-byte common
working register area (C0H–CFH). You can use the common working register area as a “scratch” area for data
operations being performed in other areas of the register file.
Registers in set 1 locations are directly accessible at all times using Register addressing mode. The 16-byte
working register area can only be accessed using working register addressing (For more information about
working register addressing, please refer to Chapter 3, “Addressing Modes.”)
REGISTER SET 2
The same 64-byte physical space that is used for set 1 locations C0H–FFH is logically duplicated to add another
64 bytes of register space. This expanded area of the register file is called set 2. For
S3C84I8X/F84I8X/C84I9X/F84I9X, the set 2 address range (C0H–FFH) is accessible on pages 0-1.
The logical division of set 1 and set 2 is maintained by means of addressing mode restrictions. You can use only
Register addressing mode to access set 1 locations. In order to access registers in set 2, you must use Register
Indirect addressing mode or Indexed addressing mode.
The set 2 register area is commonly used for stack operations.
The lower 192 bytes (00H–BFH) of the S3C84I9X/F84I9X's two 256-byte register pages (S3C84I8X/F84I8X's one
256-byte) is called prime register area. Prime registers can be accessed using any of the seven addressing
modes (see Chapter 3, "Addressing Modes.")
The prime register area on page 0 is immediately addressable following a reset. In order to address prime
registers on pages 0, or 1 you must set the register page pointer (PP) to the appropriate source and destination
values.
FFH
F0H
E0H
D0H
C0H
Bank 0
CPU and system control
General-purpose
Peripheral and I/O
Set 1
Bank 1
FFH
C0H
BFH
00H
Page 1
Page 0
Set 2
Page 0
Prime
Space
13H
00H
Figure 2-6. Set 1, Set 2, Prime Area Register(S3C84I9X/F84I9X)
Instructions can access specific 8-bit registers or 16-bit register pairs using either 4-bit or 8-bit address fields.
When 4-bit working register addressing is used, the 256-byte register file can be seen by the programmer as one
that consists of 32 8-byte register groups or "slices." Each slice comprises of eight 8-bit registers.
Using the two 8-bit register pointers, RP1 and RP0, two working register slices can be selected at any one time to
form a 16-byte working register block. Using the register pointers, you can move this 16-byte register block
anywhere in the addressable register file, except for the set 2 area.
The terms slice and block are used in this manual to help you visualize the size and relative locations of selected
working register spaces:
— One working register slice is 8 bytes (eight 8-bit working registers, R0–R7 or R8–R15)
— One working register block is 16 bytes (sixteen 8-bit working registers, R0–R15)
All the registers in an 8-byte working register slice have the same binary value for their five most significant
address bits. This makes it possible for each register pointer to point to one of the 24 slices in the register file
other than set 2. The base addresses for the two selected 8-byte register slices are contained in register pointers
RP0 and RP1.
After a reset, RP0 and RP1 always point to the 16-byte common area in set 1 (C0H–CFH).
FFH
F8H
F7H
F0H
CFH
C0H
1 1 1 1 1 X X X
RP1 (Registers R8-R15)
Each register pointer points to
one 8-byte slice of the register
space, selecting a total 16byte working register block.
Slice 32
Slice 31
~~
0 0 0 0 0 X X X
RP0 (Registers R0-R7)
Slice 2
Slice 1
10H
FH
8H
7H
0H
Set 1
Only
2-12
Figure 2-8. 8-Byte Working Register Areas (Slices)
Register pointers RP0 and RP1, mapped to addresses D6H and D7H in set 1, are used to select two movable
8-byte working register slices in the register file. After a reset, RP# point to the working register common area:
RP0 points to addresses C0H–C7H, and RP1 points to addresses C8H–CFH.
To change a register pointer value, you load a new value to RP0 and/or RP1 using an SRP or LD instruction.
(see Figures 2-6 and 2-7).
With working register addressing, you can only access those two 8-bit slices of the register file that are currently
pointed to by RP0 and RP1. You cannot, however, use the register pointers to select a working register space in
set 2, C0H–FFH, because these locations can be accessed only using the Indirect Register or Indexed
addressing modes.
The selected 16-byte working register block usually consists of two contiguous 8-byte slices. As a general
programming guideline, it is recommended that RP0 point to the "lower" slice and RP1 point to the "upper" slice
(see Figure 2-6). ). In some cases, it may be necessary to define working register areas in different (noncontiguous) areas of the register file. In Figure 2-7, RP0 points to the "upper" slice and RP1 to the "lower" slice.
Because a register pointer can point to either of the two 8-byte slices in the working register block, you can flexibly
define the working register area to support program requirements.
Figure 2-10. Non-Contiguous 16-Byte Working Register Block
) PROGRAMMING TIP — Using the RPs to Calculate the Sum of a Series of Registers
Calculate the sum of registers 80H–85H using the register pointer. The register addresses from 80H through 85H
contain the values 10H, 11H, 12H, 13H, 14H, and 15 H, respectively:
The sum of these six registers, 6FH, is located in the register R0 (80H). The instruction string used in this
example takes 12 bytes of instruction code and its execution time is 36 cycles. If the register pointer is not used to
calculate the sum of these registers, the following instruction sequence would have to be used:
Now, the sum of the six registers is also located in register 80H. However, this instruction string takes 15 bytes of
instruction code rather than 12 bytes, and its execution time is 50 cycles rather than 36 cycles.
The S3C8-series register architecture provides an efficient method of working register addressing that takes full
advantage of shorter instruction formats to reduce execution time.
With Register (R) addressing mode, in which the operand value is the content of a specific register or register
pair, you can access any location in the register file except for set 2. With working register addressing, you use a
register pointer to specify an 8-byte working register space in the register file and an 8-bit register within that
space.
Registers are addressed either as a single 8-bit register or as a paired 16-bit register space. In a 16-bit register
pair, the address of the first 8-bit register is always an even number and the address of the next register is always
an odd number. The most significant byte of the 16-bit data is always stored in the even-numbered register, and
the least significant byte is always stored in the next (+1) odd-numbered register.
Working register addressing differs from Register addressing as it uses a register pointer to identify a specific
8-byte working register space in the internal register file and a specific 8-bit register within that space.
Each register pointer (RP) can independently point
to one of the 24 8-byte "slices" of the register file
(other than set 2). After a reset, RP0 points to
locations C0H-C7H and RP1 to locations C8H-CFH
(that is, to the common working register area).
NOTE:
00H
In the S3C84I9X/F84I9X microcontroller ,pages 0-2 are
implemented and S3C84I8X/F84I8X microcon troller,
page0 and page2 are inplemented.
Page0-2 contain all of the add res s able registers
in the internal register file.
After a reset, register pointers RP0 and RP1 automatically select two 8-byte register slices in set 1, locations
C0H–CFH, as the active 16-byte working register block:
RP0 → C0H–C7H
RP1 → C8H–CFH
This 16-byte address range is called common area. That is, locations in this area can be used as working
registers by operations that address any location on any page in the register file. Typically, these working
registers serve as temporary buffers for data operations between different pages.
FFH
F0H
E0H
D0H
C0H
Following a hardware reset, register
pointers RP0 and RP1 point to the
common working register area,
locations C0H-CFH.
) PROGRAMMING TIP — Addressing the Common Working Register Area
As the following examples show, you should access working registers in the common area, locations C0H–CFH,
using working register addressing mode only.
Examples 1:
LD 0C2H,40H ; Invalid addressing mode!
Use working register addressing instead:
SRP #0C0H
LD R2,40H ; R2 (C2H) ← the value in location 40H
Example 2:
ADD 0C3H,#45H ; Invalid addressing mode!
Use working register addressing instead:
SRP #0C0H
ADD R3,#45H ; R3 (C3H) ← R3 + 45H
4-BIT WORKING REGISTER ADDRESSING
Each register pointer defines a movable 8-byte slice of working register space. The address information stored in
a register pointer serves as an addressing "window" that makes it possible for instructions to access working
registers very efficiently using short 4-bit addresses. When an instruction addresses a location in the selected
working register area, the address bits are concatenated in the following way to form a complete 8-bit address:
— The high-order bit of the 4-bit address selects one of the register pointers ("0" selects RP0, "1" selects RP1).
— The five high-order bits in the register pointer select an 8-byte slice of the register space.
— The three low-order bits of the 4-bit address select one of the eight registers in the slice.
As shown in Figure 2-11, the result of this operation is that the five high-order bits from the register pointer are
concatenated with the three low-order bits from the instruction address to form the complete address. As long as
the address stored in the register pointer remains unchanged, the three bits from the address will always point to
an address in the same 8-byte register slice.
Figure 2-12 shows a typical example of 4-bit working register addressing. The high-order bit of the instruction
"INC R6" is "0", which selects RP0. The five high-order bits stored in RP0 (01110B) are concatenated with the
three low-order bits of the instruction's 4-bit address (110B) to produce the register address 76H (01110110B).
You can also use 8-bit working register addressing to access registers in a selected working register area. To
initiate 8-bit working register addressing, the upper four bits of the instruction address must contain the value
"1100B." This 4-bit value (1100B) indicates that the remaining four bits have the same effect as 4-bit working
register addressing.
As shown in Figure 2-13, the lower nibble of the 8-bit address is concatenated in much the same way as for 4-bit
addressing. Bit 3 selects either RP0 or RP1, which then supplies the five high-order bits of the final address. The
three low-order bits of the complete address are provided by the original instruction.
Figure 2-14 shows an example of 8-bit working register addressing. The four high-order bits of the instruction
address (1100B) specify 8-bit working register addressing. Bit 3 ("1") selects RP1 and the five high-order bits in
RP1 (10101B) become the five high-order bits of the register address. The three low-order bits of the register
address (011) are provided by the three low-order bits of the 8-bit instruction address. The five-address bits from
RP1 and the three address bits from the instruction are concatenated to form the complete register address,
0ABH (10101011B).
These address
bits indicate 8-bit
working register
addressing
The S3C8-series microcontrollers use the system stack for data storage, subroutine calls and returns. The PUSH
and POP instructions are used to control system stack operations. The S3C84I8X/F84I8X/C84I9X/F84I9X
architecture supports stack operations in the internal register file.
Stack Operations
Return addresses for procedure calls, interrupts, and data are stored on the stack. The contents of the PC are
saved to stack by a CALL instruction and restored by the RET instruction. When an interrupt occurs, the contents
of the PC and the FLAGS register are pushed to the stack. The IRET instruction then pops these values back to
their original locations. The stack address value is always decreased by one before a push operation and
increased by one after a pop operation. The stack pointer (SP) always points to the stack frame stored on the top
of the stack, as shown in Figure 2-15.
High Address
PCL
PCL
Top of
stack
PCH
Top of
stack
PCH
Flags
Stack contents
after a call
instruction
Low Address
Stack contents
after an
interrupt
Figure 2-18. Stack Operations
User-Defined Stacks
You can freely define stacks in the internal register file as data storage locations. The instructions PUSHUI,
PUSHUD, POPUI, and POPUD support user-defined stack operations.
Stack Pointers (SPL, SPH)
Register locations D8H and D9H contain the 16-bit stack pointer (SP) that is used for system stack operations.
The most significant byte of the SP address, SP15–SP8, is stored in the SPH register (D8H), and the least
significant byte, SP7–SP0, is stored in the SPL register (D9H). After a reset, the SP value is undetermined.
Because only internal memory space is implemented in the S3C84I8X/F84I8X/C84I9X/F84I9X, the SPL must be
initialized to an 8-bit value in the range 00H–FFH.
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 specified in SAM88RCinstructions may be condition
codes, immediate data, or a location in the register file, program memory, or data memory.
The S3C8-series instruction set supports seven explicit addressing modes. Not all of these addressing modes are
available for each instruction. The seven addressing modes and their symbols are:
In Register addressing mode (R), the operand value is the content of a specified register or register pair
(see Figure 3-1).
Working register addressing differs from Register addressing in that it uses a register pointer to specify an 8-byte
working register space in the register file and an 8-bit register within that space (see Figure 3-2).
Program MemoryRegister File
8-bit Register
File Address
One-Operand
Instruction
(Example)
Sample Instruction:
dst
OPCODE
Point to One
OPERAND
Register in Register
File
Value used in
Instruction Execution
DECCNTR; Where CNTR is the label of an 8-bit register address
4-bit
Working Register
Two-Operand
Instruction
(Example)
Sample Instruction:
ADDR1, R2; Where R1 and R2 are registers in the currently
Figure 3-1. Register Addressing
MSB Point to
RP0 ot RP1
Program Memory
dst
OPCODE
src
3 LSBs
Point to the
Working Register
(1 of 8)
selected working register area.
Figure 3-2. Working Register Addressing
Register File
RP0 or RP1
Selected
RP points
to start
of working
register
block
OPERAND
3-2
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.