The S3CB018/FB018 single-chip CMOS microcontroller is designed for high performance using Samsung’ s
newest 8-bit CPU core, CalmRISC.
CalmRISC is an 8-bit low power RISC microcontroller. Its basic architecture follows Harvard style, that is, it has
separate program memory and data memory. Both instruction and data can be fetched simultaneously without
causing a stall, using separate paths for memory access. Represented below is the top block diagram of the
CalmRISC microcontroller.
1-1
Page 2
PRODUCT OVERVIEWS3CB018/FB018
S3CB018/FB018 OVERVIEW
FEATURES SUMMARY
CPU
•8-Bit RISC architecture
Memory
•ROM: 4 Kword (8 K-byte)
•RAM: 3072 (1024+2048) byte
1024 (X-memory) byte
2048 (Y-memory) byte
Stack
•size: maximum 16 (word)-level
26 I/O Pins
•I/O: 26 pins, including 8 S/W open drain pins
8-Bit Basic Timer
•Programmable interval timer
•8 kinds of clock source
Watchdog Timer
•System reset when 11-bit counter overflows
16-Bit Timer/Counter
•Programmable interval timer
•Two 8-bit timer counter mode and one 16-bit
timer counter mode, selectable by S/W
Watch Timer
•Real time clock or interval time measurement
•Four frequency outputs for buzzer sound
8-Bit Serial I/O Interface
•8-bit transmit/receive mode
•8-bit receive mode
•LSB first or MSB first transmission selectable
•Internal and external clock source
16-Bit Serial I/O Interface
•16-bit transmit/receive mode
•External clock source
Coprocessor
• MAC 816
• 8 x 16, 16 x 16 Multiply and Accumulation
• Arithmetic operation
Two Power-Down Modes
•Idle mode: only CPU clock stop
•Stop mode: selected system clock and CPU
clock stop
Oscillation Sources
•Crystal and Ceramic (0.4-20MHz), RC
Oscillation
•Programmable oscillation source
Instruction Execution Times
•50ns at 20MHz for 1 cycle instruction
•100ns at 20MHz for 2 cycle instruction
1-2
Page 3
S3CB018/FB018PRODUCT OVERVIEW
DO[7:0]
DI[7:0]
PA[19:0]
PD[15:0]
Program Memory Address
Generation Unit
TBH TBL
ABUS[7:0]
ALULALUR
ALU
PC[19:0]
20
HS[0]
Hardware
Stack
HS[15]
BBUS[7:0]
Flag
RBUS
20
8
8
R0
R1
R2
R3
GPR
DA[15:0]
ILHILXILL
Data Memory
Address
Generation Unit
Bank 0,1
IDH
Figure 1-1. Top Block Diagram of CalmRISC
SR0SR1
IDL0
IDL1
SPR
1-3
Page 4
PRODUCT OVERVIEWS3CB018/FB018
The CalmRISC building blocks consist of:
— An 8-bit ALU
— 16 general purpose registers (GPR)
— 11 special purpose registers (SPR)
— 16-level hardware stack
— Program memory address generation unit
— Data memory address generation unit
16 GPR’ s are grouped into four banks (Bank0 to Bank3) and each bank has four 8-bit registers (R0, R1, R2, and
R3). SPR’ s, designed for special purposes, include status registers, link registers for branch-link instructions, and
data memory index registers. The data memory address generation unit provides the data memory address
(denoted as DA[15:0] in the top block diagram) for a data memory access instruction. Data memory contents are
accessed through DI[7:0] for read operations and DO[7:0] for write operations. The program memory address
generation unit contains a program counter, PC[19:0], and supplies the program memory address through
PA[19:0] and fetches the corresponding instruction through PD[15:0] as the result of the program memory access.
CalmRISC has a 16-level hardware stack for low power stack operations as well as a temporary storage area.
CalmRISC has a 3-stage pipeline as described below:
Instruction Fetch
(IF)
Instruction Decode/
Data Memory Access
(ID/MEM)
Execution/Writeback
(EXE/WB)
Figure 1-2. CalmRISC Pipeline Diagram
As can be seen in the pipeline scheme, CalmRISC adopts a register-memory instruction set. In other words, data
memory where R is a GPR, can be one operand of an ALU instruction as shown below:
The first stage (or cycle) is Instruction Fetch stage (IF for short), where the instruction pointed to by the program
counter, PC[19:0] , is read into the Instruction Register (IR for short). The second stage is Instruction Decode and
Data Memory Access stage (ID/MEM for short), where the fetched instruction (stored in IR) is decoded and data
memory access is performed, if necessary. The final stage is Execute and Write-back stage (EXE/WB), where the
required ALU operation is executed and the result is written back into the destination registers.
Since CalmRISC instructions are pipelined, the next instruction fetch is not postponed until the current instruction
is completely finished, but is performed immediately after the current instruction fetch is done. The pipeline stream
of instructions is illustrated in the following diagram.
1-4
Page 5
S3CB018/FB018PRODUCT OVERVIEW
/ 1
ID/MEM
/ 2
EXE/WBIF
IF
ID/MEM
/ 3
IF
/ 4
EXE/WB
ID/MEM
IFIF
EXE/WB
/ 5
ID/MEM
IF
/ 6
EXE/WB
ID/MEM
IF
EXE/WB
ID/MEM
EXE/WB
Figure 1-3. CalmRISC Pipeline Stream Diagram
Most CalmRISC instructions are 1-word instructions, while same branch instructions such as “LCALL” and “LJT”
instructions are 2-word instructions. In Figure 1-3, the instruction, I4, is a long branch instruction and it takes two
clock cycles to fetch the instruction. As indicated in the pipeline stream, the number of clocks per instruction (CPI)
is 1 except for long branches, which take 2 clock cycles per instruction.
P0.0-P0.7I/OI/O port with bit programmable pins; Input and output mode are
selectable by software; Software assignable pull-up. P0.4-P0.7
can be used as inputs for comparator input CIN0-CIN3.;
Alternately they can be used as SI, SO, SCK, BUZ, CSI, CSO,
CSCK, CFSYNC.
P1.0-P1.7OOutput port with bit programmable pins; Push-pull output mode
and open-drain output mode are selected by software;
Software assignable pull-up.
P2.0-P2.7I/OI/O port with bit programmable pins; Input and output mode are
selectable by software; Software assignable pull-up; P2.0-P2.3
can be used as inputs for external interrupts INT10-INT13.
(with noise filter) ; Alternately they can be used as TAOUT,
TACLK or TBOUT, TBCLK.
P3.0-P3.1I/OI/O port with bit programmable pins; Input or output mode
selected by software; software assignable pull-up; P3.0-P3.1
can be used as inputs for external interrupts INT00-INT01.
(with noise filter and interrupt polarity control)
P0.0-P0.7I/OI/O port with bit programmable pins; Input and output mode are
selectable by software; Software assignable pull-up. P0.4-P0.7
can be used as SI, SO, SCK, BUZ, CSI, CSO, CSCK,
CFSYNC, Alternately.
P1.0-P1.5OO port with bit programmable pins; Push-pull output mode and
open-drain output mode are selected by software; Software
assignable pull-up.
P2.0-P2.7I/OI/O port with bit programmable pins; Input and output mode are
selectable by software; Software assignable pull-up; P2.0-P2.3
can be used as inputs for external interrupts INT10-INT13.
(with noise filter); Alternately they can be used as TAOUT,
TACLK or TBOUT, TBCLK.
P3.0-P3.1I/OI/O port with bit programmable pins; Input or output mode
selected by software; software assignable pull-up; P3.0-P3.1
can be used as inputs for external interrupts INT00-INT01.
(with noise filter and interrupt polarity control)
NOTE: In S3CB018/FB018, the CSI, CSO, CSCK, CFSYNC pins are shared with P0.7-P0.4.
Share
Type
D-2
F-10
Pins
SI, SO, SCK
BUZ, CSI,
CSO, CSCK,
CFSYNC
E-2
D-4
INT10-INT13
D-2
TAOUT
TACLK
TBOUT
TBCLK
D-4INT00-INT01
1-8
Page 9
S3CB018/FB018PRODUCT OVERVIEW
Table 1-3. I/O Pin Description
Pin NamePin TypeDescription
CSIIAD/DA Serial Input (from codec)
CSOOAD/DA Serial Output (to codec)
CSCKIAD/DA Serial Clock (from codec)
CFSYNCIAD/DA Sync signal (from codec)
SII/OSerial data input
SOI/OSerial data output
SCKI/OSerial I/O interface clock signal
BUZI/O0.5 kHz, 1 kHz, 2 kHz, or 4 kHz frequency output at 4.19 MHz for buzzer sound
INT10-INT13IExternal interrupts. Stop release. Can’ t be masked by S/W individually but
wholly.
TAOUTI/OTimer A interval mode output
TACLKI/OTimer A counter external clock input
TBOUTI/OTimer B interval mode output
TBCLKI/OTimer B counter external clock input
INT00-INT01IExternal interrupts. Stop release. Can be masked by S/W individually.
SDATISerial data for Programmable memory
SCLKISerial clock for Programmable memory
VDD–Power supply
VSS–Ground
TEST–Test signal input
RESETIReset signal
XIN, X
OUT
–Crystal, ceramic and RC oscillator signal for system clock (For external clock
39TMODEITest Mode pin; 1: skip warm-up time, 0: normal mode
40PIN_RESBIAsynchronous reset, active low
41JTAGSELIJTAG mode select; 1: parallel, 0: serial
42PNTRST_STSTEINI
IJTAG/UART pin
T
44PTCK_MCLKIJTAG/UART pin
45PTMSIJTAG/UART pin
46PTDI_RXDIJTAG/UART pin
47PTDO_TXDOJTAG/UART pin
49NPMWEOProgram Memory Write Enable, active low
50NPMOEOProgram Memory Output Enable, active low
51NPMCSOProgram Memory Chip Select, active low
52RUNSTORun Status Indicator
54OUTDISII/O PAD Disable for debugger
55DOCNTXIData Bus Output Control
56XDOCNTXIExternal X-Memory Data Bus Output Control
57NPM64KWIUp to 64KW Program Memory, active low
Supply voltage
Input voltage
Output voltage
Output current
highAll I/O pins active– 60
Output current
lowTotal pin current for ports 1, 2, 3+ 100
Operating
temperature
Storage
temperature
Table 18-2. D.C. Electrical Characteristics
(T
= – 40°C to + 85°C, VDD = 1.8 V to 5.5 V)
A
ParameterSymbolConditionsMinTypMaxUnit
Operating Voltage
(HSX mode)
Operating Voltage
(MSX mode)
V
V
DD
DD
F
F
F
F
CPU
CPU
CPU
CPU
= 20 MHz
= 3 MHz
= 10 MHz
= 3 MHz
4.5–5.5V
1.85.5
4.5–5.5
1.85.5
18-1
Page 16
ELECTRICAL DATAS3C
(TA= 40
°°
C, V = 1.8 V to 5.5 V)
ParameterConditionsMinMaxUnit
Input low voltage
Output high voltage
V
IH1IH2
XV
IH2
V
V
V
All input pins except V
IL1
X
IL2
OH1VDD
IN
= 5V; IOH = -1 mA
IL2
0.8 V
0.1
-
DD
––
VDD-1.0
–
0.2 V
0.1
––V
All output pins
Output low voltage
Input high leakage
current
Input low leakage
current
V
OL1VDD
V
OL2VDD
I
LIH1
I
LIH2
I
LIL1
I
LIL2
= 5V; IOL = 8 mA
All output pins except V
= 5V; IOL = 15 mA, Port 1
VIN = V
DD
All input pins except I
VIN = V
DD
XIN, XT
IN
V
= 0 V
IN
All input pins except I
LIH2
LIL2
VIN = 0 V
–2
OL2
––3uA
20
––-3
-20
XIN, XTIN, RESET
Output high leakage
current
Output low leakage
current
Oscillator feed back
resistors
Pull-up resistor
I
LOH
I
R
(HSX)
R
(MSX)
R
(LSX)
R
V
= V
OUT
DD
All I/O pins and Output pins
V
LOL
OUT
= 0 V
All I/O pins and Output pins
VDD = 5.0 V, TA = 25°C, XIN = VDD,
1. Supply current does not include current drawn through internal pull-up resistors or external output current loads.
2. In operating current test mode Timer A and Timer B are running.
3. In idle current test mode the Watch timer is running.
4. The operating and idle currents are measured at weak mode.
DD3
Stop mode
V
= 5 V ± 10%
DD
V
= 3 V ± 10%
DD
–0.53uA
0.21.2
Table 18-3. A. C. Electrical Characteristics
(T
= –40°C to + 85°C, V
A
= 1.8 V to 5.5 V)
DD
ParameterSymbolConditionsMinTypMaxUnit
t
Interrupt input high,
low width
RESET input
low width
NOTE: User must keep a value larger than the min value.
INTH
t
INTL
t
RSL
,
P2.0 - P2.3, P3.0 - P3.1
V
= 5V
DD
V
= 5V ± 10%
DD
200––ns
1––us
18-3
Page 18
ELECTRICAL DATAS3CB018/FB018
t
INTL
t
INTH
0.8 VDD
0.2 VDD
Figure 18-1. Input Timing for External Interrupts
t
RSL
RESET
0.2 VDD
Figure 18-2. Input Timing for RESET
18-4
Page 19
S3CB018/FB018ELECTRICAL DATA
Table 18-4. Data Retention Supply Voltage in Stop Mode
(TA = – 40°C to + 85°C, V
= 1.8 V to 5.5V)
DD
ParameterSymbolConditionsMinTypMaxUnit
Data retention
supply voltage
Data retention
supply current
NOTE: Supply current does not include current drawn through internal pull-up resistors or external output current loads.
VDD
RESET
NOTE: t
V
DDDR
I
DDDR
Execution of
STOP Instruction
WAIT
V
= 1.5V
DDDR
~
~
~
~
is the same as 2048 x 32 x 1/fxx
Stop Mode
Data Retention Mode
VDDDR
1.5–5.5V
––2µA
RESET
Occur
Oscillation
Stabilization Time
Normal
Operating Mode
0.2VDD
tWAIT
Figure 18-3. Stop Mode Release Timing When Initiated by a RESET
18-5
Page 20
ELECTRICAL DATAS3CB018/FB018
Oscillation
Stabilization Time
t
WAIT
Normal
Operating
Mode
VDD
INT
NOTE:
Osc Start
up time
~
~
~
~
Execution of
STOP Instruction
t
is the same as 2048 x 32 x 1/fxx. The value of 2048 which is selected for the clock
WAIT
source of the basic timer counter can be changed. Then the value of tWAIT will be changed
and ,when you select 16 instead of 32, the value of twait will also be changed.
Stop Mode
Data Retention
V
DDDR
0.2VDD
Figure 18-4. Stop Mode Release Timing When Initiated by Interrupts
XIN input high and low level width (tXH, tXL)
VDD = minimum oscillation voltage range.
Ceramic––50ms
External clock
LSX32768Hz
XIN input high and low level width (tXH, tXL)
VDD = minimum oscillation voltage range.
Crystal
NOTE: Oscillation stabilization time (t
release.
XIN
ST1
)
ST1
––10ms
50––ns
––100ms
50––ns
–200500ms
) is the time that isrequired to stabilize oscillation after a reset or STOP mode
1/fosc1
tXHtXL
DD
V
- 0.1 V
0.1 V
18-10
Figure 18-7. Clock Timing Measurement at X
IN
Page 25
S3CB018/FB018ELECTRICAL DATA
f
CPU
20 MHz
B
10 MHZ
A
3 MHZ
0.4 MHz
1234567
5.54.51.8
Supply Voltage (V)
Minimum instruction clock = 1/1 x oscillator frequency
Figure 18-8. HSX Mode Operating Voltage Range
fCPU
10 MHz
B
A
3 MHZ
0.4 MHz
1234567
5.54.51.8
Supply Voltage (V)
Minimum instruction clock = 1/1 x oscillator frequency
Figure 18-9. MSX Mode Operating Voltage Range
18-11
Page 26
S3CB018/FB018MECHANICAL DATA
19 MECHANICAL DATA
OVERVIEW
The S3CB018/FB018 is available in a 30-pin SDIP package (Samsung: 30-SDIP-400) and a 32-pin SOP package
(32-SOP-450A). Package dimensions are shown in Figures 20-1 and 20-2.
#30#16
0.2
±
8.94
(1.30)
NOTE: Dimensions are in millimeters.
30-SDIP-400
27.88MAX
27.48
±
0.2
±
0.56
0.1
±
1.12
0.1
#15#1
1.778
10.16
0.2
±
3.81
5.08 MAX
0.3
±
3.30
0.51 MIN
0-15
+ 0.1
0.25
- 0.05
Figure 19-1. 30-Pin SDIP Package Dimensions
19-1
Page 27
MECHANICAL DATAS3CB018/FB018
0-8
#17#32
0.3
±
32-SOP-450A
12.00
#1#16
19.90
(0.43)
NOTE: Dimensions are in millimeters
0.40
±
0.1
Figure 19-2. 32-SOP-450A Package Dimensions
0.2
0.2
11.43
8.34 ±
±
0.78
+ 0.1
0.20
0.2
±
0.2
±
2.00
- 0.05
2.40 MAX
1.27
0.05 MIN
19-2
Page 28
S3CB018/FB018S3FB018
20S3FB018 FLASH MCU
OVERVIEW
The S3FB018 single-chip CMOS microcontroller is the FLASH version of the S3CB018 microcontroller.
It has an on-chip FLASH ROM instead of masked ROM. The FLASH ROM is accessed in serial data format.
The S3FB018 is fully compatible with the S3CB018, both in function and in pin configuration. Because of its simple
programming requirements, the S3FB018 is ideal for use as an evaluation chip for the S3CB018.
20-1
Page 29
S3FB018S3CB018/FB018
PIN ASSIGNMENTS
V
X
V
PP
/TEST
SI/P0.0
SO/P0.1
RESET/RESET
SCK/P0.2
BUZ/P0.3
CSI/P0.4
CSO/P0.5
CSCK/P0.6
CFSYNC/P0.7
P1.0
P1.1
P1.7
SS
XIN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
S3FB018
32-SOP
(Top-View)
OUT
Figure 20-1. 32-SOP Pin Assignment
V
32
P3.1/INT01/
31
P3.0/INT00/SDAT
30
P2.7/TACLK
29
P2.6/TBOUT
28
P2.5/TBCLK
27
P2.4/TAOUT
26
P2.3/INT13
25
P2.2/INT12
24
P2.1/INT11
23
P2.0/INT10
22
P1.2
21
P1.3
20
P1.4
19
P1.5
18
P1.6
17
DD
SCLK
20-2
X
VPP/TEST
SI/P0.0
SO/P0.1
RESET/RESET
SCK/P0.2
BUZ/P0.3
CSI/P0.4
CSO/P0.5
CSCK/P0.6
CFSYNC/P0.7
P1.0
P1.1
XIN
1
SS
2
3
4
5
6
7
8
9
10
11
12
13
14
15
S3FB018
30-SDIP
(Top View)
V
OUT
Figure 20-2. 30-SDIP Pin Assignment
V
30
P3.1/INT01/SCLK
29
P3.0/INT00/SDAT
28
P2.7/TACLK
27
P2.6/TBOUT
26
P2.5/TBCLK
25
P2.4/TAOUT
24
P2.3/INT13
23
P2.2/INT12
22
P2.1/INT11
21
P2.0/INT10
20
P1.2
19
P1.3
18
P1.4
17
P1.5
16
DD
Page 30
S3CB018/FB018S3FB018
Table 20-1. Descriptions of Pins Used to Read/Write the FLASH ROM
Main ChipDuring Programming
Pin NamePin NamePin No.I/OFunction
P3.0SDAT
30(28)I/O
Serial data pin. Output port when reading and input
port when writing. Can be assigned as a Input/push-
pull output port.
P3.1SCLK
TESTVpp (TEST)
31(29)I/O
4I
Serial clock pin. Input only pin.
Power supply pin for FLASH ROM cell writing
(indicates that FLASH enters into the writing mode).
When 12.5 V is applied, FLASH is in writing mode
and, when 5 V is applied, FLASH is in the reading
mode. When FLASH is operating , hold GND.
RESETRESET
VDD/V
SS
VDD/V
SS
7I
32/1(30/1)–
Chip Initialization
Logic power supply pin. V
should be tied to
DD
+5 V during programming.
NOTE: Pin No. is for 100 QFP type package. (for 100 TQFP, the pins with the same name have same functions).
Table 20-2. Comparison of S3FB018 and S3CB018 Features
CharacteristicS3FB519S3CB519
Program Memory4K word (8K byte) FLASH ROM4K word (8K byte) FLASH ROM
Operating Voltage (VDD)
OTP Programming Mode
1.8 V to 5.5 V1.8 V to 5.5 V
VDD = 5 V, V
(TEST) = 12.5 V
PP
Pin Configuration32-SOP/30-SDIP32-SOP/30-SDIP
FLASH ROM Programmability User programmableProgrammed at the factory
20-3
Page 31
S3FB018S3CB018/FB018
Table 20-3. Absolute Maximum Ratings
(TA = 25°C)
ParameterSymbolConditionsRatingUnit
Supply voltage
Input voltage
Output voltage
Output current
V
DD
V
I
V
O
I
OH
One I/O pin active– 18mA
–– 0.3 to + 6.0V
–
–
– 0.3 to V
– 0.3 to VDD + 0.3
DD
+ 0.3
highAll I/O pins active– 60
Output current
I
OL
One I/O pin active+ 30
lowTotal pin current for ports 1, 2, 3+ 100
Operating