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
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
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
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
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
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