Samsung s3c44b0x
Samsung s3c44b0x
Samsung s3c44b0x
1 PRODUCT OVERVIEW
INTRODUCTION
SAMSUNG's S3C44B0X 16/32-bit RISC microprocessor is designed to provide a cost-effective and high performance
micro-controller solution for hand-held devices and general applications. To reduce total system cost, S3C44B0X
also provides the following: 8KB cache, optional internal SRAM, LCD controller, 2-channel UART with handshake, 4-
channel DMA, System manager (chip select logic, FP/ EDO/SDRAM controller), 5-channel timers with PWM, I/O
ports, RTC, 8-channel 10-bit ADC, IIC-BUS interface, IIS-BUS interface, Sync. SIO interface and PLL for clock.
The S3C44B0X was developed using a ARM7TDMI core, 0.25 um CMOS standard cells, and a memory compiler. Its
low-power, simple, elegant and fully static design is particularly suitable for cost-sensitive and power sensitive
applications. Also S3C44B0X adopts a new bus architecture, SAMBA II (SAMSUNG ARM CPU embedded
Microcontroller Bus Architecture).
An outstanding feature of the S3C44B0X is its CPU core, a 16/32-bit ARM7TDMI RISC processor (66MHz) designed
by Advanced RISC Machines, Ltd. The architectural enhancements of ARM7TDMI include the Thumb de-
compressor, an on-chip ICE breaker debug support, and a 32-bit hardware multiplier.
By providing a complete set of common system peripherals, the S3C44B0X minimizes overall system costs and
eliminates the need to configure additional components. The integrated on-chip functions that are described in this
document are as follows:
• 2.5V Static ARM7TDMI CPU core with 8KB cache . (SAMBA II bus architecture up to 66MHz)
• External memory controller. (FP/EDO/SDRAM Control, Chip Select logic)
• LCD controller (up to 256 color DSTN) with 1-ch LCD-dedicated DMA.
• 2-ch general DMAs / 2-ch peripheral DMAs with external request pins
• 2-ch UART with handshake(IrDA1.0, 16-byte FIFO) / 1-ch SIO
• 1-ch multi-master IIC-BUS controller
• 1-ch IIS-BUS controller
• 5-ch PWM timers & 1-ch internal timer
• Watch Dog Timer
• 71 general purpose I/O ports / 8-ch external interrupt source
• Power control: Normal, Slow, Idle, and Stop mode
• 8-ch 10-bit ADC.
• RTC with calendar function.
• On-chip clock generator with PLL.
1-1
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
FEATURES
FEATURES (Continued)
1-2
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
UART
LCD Controller
• 2-channel UART with DMA-based or interrupt-
• Supports color/monochrome/gray LCD panel
based operation
• Supports single scan and dual scan displays
• Supports 5-bit, 6-bit, 7-bit, or 8-bit serial data
transmit/receive • Supports virtual screen function
• Supports H/W handshaking during • System memory is used as display memory
transmit/receive • Dedicated DMA for fetching image data from
• Programmable baud rate system memory
• Supports IrDA 1.0 (115.2kbps) • Programmable screen size
• Loop back mode for testing • Gray level: 16 gray levels
• Each channel have two internal 32-byte FIFO for • 256 Color levels
Rx and Tx.
1-3
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
FEATURES (Continued)
1-4
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
BLOCK DIAGRAM
Bus Arbiter
GPIO P
(Controller) u
r
AIN[7:0] ADC P p
e I 2 C Bus o
r Controller s
i e
p I2 S Bus
h Controller I
e /
Watchdog Timer
r O
a UART 0,1 (Each
l 16byte FIFO)
B
32,768 Hz u Synchronout I/O
SIOCK
RTC s
(Real Time Clock)
PWM Timer
0-4,5 (internal)
TCLK EXTCLK
1-5
S3C44B0X RISC MICROPROCESSOR
SIOTxD/nRTS1/IISLRCK/GPF5
SIOCLK/nCTS1/IISCLK/GPF8
SIORDY/TxD1/IISDO/GPF6
SIORxD/RxD1/IISDI/GPF7
ENDIAN/CODECLK/GPE8
ExINT7/IISLRCK/GPG7
TOUT2/TCLK/GPE5
TOUT1/TCLK/GPE4
TOUT4/VD7/GPE7
TOUT3/VD6/GPE6
IICSDA/GPF1
TOUT0/GPE3
IICSCL/GPF0
CLKout/GPE0
VSSADC
EXTCLK
nRESET
PLLCAP
EXTAL0
VDDIO
nTRST
VSSIO
VSSIO
XTAL0
AIN5
AIN4
AIN3
AIN2
AIN1
AIN0
OM3
OM2
OM1
OM0
TMS
VDD
TDO
VSS
TCK
TDI
80
79
78
77
76
75
74
73
72
71
70
69
68
67
66
65
64
63
62
61
60
59
58
57
56
55
54
53
52
51
50
49
48
47
46
45
44
43
42
41
AIN6 81 40 ExINT6/IISDO/GPG6
AIN7 82 39 ExINT5/IISDI/GPG5
S3C44B0X
VD3/GPD3 95 26 nGCS7:nSCS1:nRAS1
VD2/GPD2 96 25 nGCS6:nSCS0:nRAS0
VD1/GPD1 97 24 nGCS5/GPB10
160-QFP
VD0/GPD0 98 23 nGCS4/GPB9
RxD0/GPE2 99 22 VSS
TxD0/GPE1 100 21 VDD
DATA31/nCTS0/GPC15 101 20 nGCS3/GPB8
DATA30/nRTS0/GPC14 102 19 nGCS2/GPB7
DATA29/RxD1/GPC13 103 18 nGCS1/GPB6
DATA28/TxD1/GPC12 104 17 nGCS0
DATA27/nCTS1/GPC11 105 16 nWE
DATA26/nRTS1/GPC10 106 15 nOE
DATA25/nXDREQ1/GPC9 107 14 nBE3:nWBE3:DQM3/GPB5
DATA24/nXDACK1/GPC8 108 13 nBE2:nWBE2:DQM2/GPB4
VDD 109 12 nBE1:nWBE1:DQM1
VSS 110 11 nBE0:nWBE0:DQM0
DATA23/VD4/GPC7 111 10 VSSIO
DATA22/VD5/GPC6 112 9 VDDIO
DATA21/VD6/GPC5 113 8 nCAS3:nSRAS/GPB3
DATA20/VD7/GPC4 114 7 nCAS2:nSCAS/GPB2
DATA19/IISCLK/GPC3 115 6 nCAS1
DATA18/IISDI/GPC2 116 5 nCAS0
DATA17/IISDO/GPC1 117 4 ADDR0/GPA0
DATA16/IISLRCK/GPC0 118 3 ADDR1
DATA15 119 2 ADDR2
PIN ASSIGNMENTS
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
VDD
VSS
VSSIO
VSSIO
VDDIO
DATA9
DATA8
DATA7
DATA6
DATA5
DATA4
DATA3
DATA2
DATA1
DATA0
ADDR9
ADDR8
ADDR7
ADDR6
ADDR5
ADDR4
DATA13
DATA12
DATA11
DATA10
ADDR15
ADDR14
ADDR13
ADDR12
ADDR11
ADDR10
ADDR24/GPA9
ADDR23/GPA8
ADDR22/GPA7
ADDR21/GPA6
ADDR20/GPA5
ADDR19/GPA4
ADDR18/GPA3
ADDR17/GPA2
ADDR16/GPA1
1-6
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
G
Ball Pad A1
F Corner Indicator
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Bottom View
1-7
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
Pin Pin Name Default I/O State (2) I/O State (2) I/O State I/O TYPE(6)
No. Function @BUS REQ. @STOP @Initial
1 ADDR3 ADDR3 Hi-z Hi-z O phot8
2 ADDR2 ADDR2
3 ADDR1 ADDR1
4 ADDR0/GPA0 ADDR0 Hi-z/O Hi-z/O
5 nCAS0 nCAS0 Hi-z Low
6 nCAS1 nCAS1
7 nCAS2:nSCAS/GPB2 nSCAS High/Low/O
8 nCAS3:nSRAS/GPB3 nSRAS
9 VDDIO VDDIO – (3) – (3) P vdd3op
10 VSSIO VSSIO vss3op
11 nBE0:nWBE0:DQM0 DQM0 Hi-z Hi-z O phot6
12 nBE1:nWBE1:DQM1 DQM1
13 nBE2:nWBE2:DQM2/GPB4 DQM2
14 nBE3:nWBE3:DQM3/GPB5 DQM3
15 nOE nOE phot8
16 nWE nWE phot6
17 nGCS0 nGCS0 phot8
18 nGCS1/GPB6 nGCS1 Hi-z/O Hi-z/O
19 nGCS2/GPB7 nGCS2
20 nGCS3/GPB8 nGCS3
21 VDD VDD − − P vdd2I
22 VSS VSS vss2I
23 nGCS4/GPB9 nGCS4 Hi-z/O Hi-z/O O phot8
24 nGCS5/GPB10 nGCS5
25 nGCS6:nSCS0:nRAS0 nSCS0 Hi-z High/High/Low
26 nGCS7:nSCS1:nRAS1 nSCS1
27 SCKE/GPB0 SCKE Hi-z/O Low/O phot6
28 SCLK/GPB1 SCLK High/O phot10
29 nWAIT/GPF2 GPF2 − − IO phbsu50ct8sm
30 nXDREQ0/nXBREQ/GPF4 GPF4
31 nXDACK0/nXBACK/GPF3 GPF3
32 ExINT0/VD4/GPG0 GPG0
33 ExINT1/VD5/GPG1 GPG1
1-8
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
1-9
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
Pin Pin Name Default I/O State I/O State I/O State I/O TYPE
No. Function @BUS REQ. @STOP @Initial
34 VDD VDD − − P vdd2i
35 VSS VSS vss2i
36 ExINT2/nCTS0/GPG2 GPG2 IO phbsu50ct8sm
37 ExINT3/nRTS0/GPG3 GPG3
38 ExINT4/IISCLK/GPG4 GPG4
39 ExINT5/IISDI/GPG5 GPG5
40 ExINT6/IISDO/GPG6 GPG6
41 ExINT7/IISLRCK/GPG7 GPG7
42 nTRST nTRST I phis
43 TCK TCK
44 TMS TMS
45 TDI TDI
46 TDO TDO O phot6
47 VDDIO VDDIO P vdd3op
48 VSSIO VSSIO vss3op
49 CLKout/GPE0 GPE0 IO phbsu50ct8sm
50 nRESET nRESET I phis
51 OM0 OM0 I(1)
52 OM1 OM1
53 OM2 OM2
54 OM3 OM3
55 ENDIAN/CODECLK/GPE8 CODECLK IO(1) phbsu50ct8sm
56 SIOCLK/nCTS1/IISCLK/GPF8 GPF8
57 SIORxD/RxD1/IISDI/GPF7 GPF7
58 SIORDY/TxD1/IISDO/GPF6 GPF6
59 SIOTxD/nRTS1/IISLRCK/GPF5 GPF5
60 IICSDA/GPF1 GPF1 phbsu50cd4sm
61 IICSCL/GPF0 GPF0
62 VDD VDD P vdd2i
63 VSS VSS vss2i
64 XTAL0 XTAL0 AI(5) phsoscm16
65 EXTAL0 EXTAL0 AO(5)
66 PLLCAP PLLCAP AI(5) phnc50_option
1-10
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
Pin Pin Name Default I/O State I/O State I/O State I/O TYPE
No. Function @BUS REQ. @STOP @Initial
67 EXTCLK EXTCLK − − I phis
68 TOUT0/GPE3 GPE3 IO phbsu50ct8sm
69 TOUT1/TCLK/GPE4 GPE4
70 TOUT2/TCLK/GPE5 GPE5
71 TOUT3/VD6/GPE6 GPE6
72 TOUT4/VD7/GPE7 GPE7
73 VSSIO VSSIO P vss3op
74 VSSADC VSSADC vss2t
75 AIN0 AIN0 AI(5) phnc50
76 AIN1 AIN1
77 AIN2 AIN2
78 AIN3 AIN3
79 AIN4 AIN4
80 AIN5 AIN5
81 AIN6 AIN6
82 AIN7 AIN7
83 AREFT AREFT phnc50_option
84 AREFB AREFB
85 AVCOM AVCOM
86 VDDADC VDDADC P vdd2t
87 XTAL1 XTAL1 I phnc50
88 EXTAL1 EXTAL1 O
89 VDDRTC VDDRTC P vdd2t
90 VSSIO VSSIO vss3op
91 VFRAME/GPD7 GPD7 IO phbsu50ct8sm
92 VM/GPD6 GPD6
93 VLINE/GPD5 GPD5
94 VCLK/GPD4 GPD4
95 VD3/GPD3 GPD3
96 VD2/GPD2 GPD2
97 VD1/GPD1 GPD1
98 VD0/GPD0 GPD0
1-11
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
Pin Pin Name Default I/O State I/O State I/O State I/O TYPE
No. Function @BUS REQ. @STOP @Initial
99 RxD0/GPE2 GPE2 − − IO phbsu50ct8sm
100 TxD0/GPE1 GPE1
101 DATA31/nCTS0/GPC15 DATA31 Hi-z/IO Hi-z/IO I(Hi-z) phbsu50ct12sm
102 DATA30/nRTS0/GPC14 DATA30
103 DATA29/RxD1/GPC13 DATA29
104 DATA28/TxD1/GPC12 DATA28
105 DATA27/nCTS1/GPC11 DATA27
106 DATA26/nRTS1/GPC10 DATA26
107 DATA25/nXDREQ1/GPC9 DATA25
108 DATA24/nXDACK1/GPC8 DATA24
109 VDD VDD − − P vdd2i
110 VSS VSS vss2i
111 DATA23/VD4/GPC7 DATA23 Hi-z/IO Hi-z/IO I(Hi-z) phbsu50ct12sm
112 DATA22/VD5/GPC6 DATA22
113 DATA21/VD6/GPC5 DATA21
114 DATA20/VD7/GPC4 DATA20
115 DATA19/IISCLK/GPC3 DATA19
116 DATA18/IISDI/GPC2 DATA18
117 DATA17/IISDO/GPC1 DATA17
118 DATA16/IISLRCK/GPC0 DATA16
119 DATA15 DATA15 Hi-z Hi-z I(Hi-z)
120 DATA14 DATA14
121 DATA13 DATA13
122 DATA12 DATA12
123 DATA11 DATA11
124 DATA10 DATA10
125 VDDIO VDDIO − − P vdd3op
126 VSSIO VSSIO vss3op
127 DATA9 DATA9 Hi-z Hi-z I(Hi-z) phbsu50ct12sm
128 DATA8 DATA8
129 DATA7 DATA7
130 DATA6 DATA6
1-12
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
Pin Pin Name Default I/O State I/O State I/O State I/O TYPE
No. Function @BUS REQ. @STOP @Initial
131 DATA5 DATA5 Hi-z Hi-z I(Hi-z) phbsu50ct12sm
132 DATA4 DATA4
133 DATA3 DATA3
134 DATA2 DATA2
135 DATA1 DATA1
136 DATA0 DATA0
137 ADDR24/GPA9 ADDR24 Hi-z/O Hi-z/O O phot8
138 VDD VDD − − P vdd2i
139 VSS VSS vss2i
140 ADDR23/GPA8 ADDR23 Hi-z/O Hi-z/O O phot8
141 ADDR22/GPA7 ADDR22
142 ADDR21/GPA6 ADDR21
143 ADDR20/GPA5 ADDR20
144 ADDR19/GPA4 ADDR19
145 ADDR18/GPA3 ADDR18
146 ADDR17/GPA2 ADDR17
147 ADDR16/GPA1 DATA16
148 ADDR15 ADDR15 Hi-z Hi-z
149 ADDR14 ADDR14
150 ADDR13 ADDR13
151 ADDR12 ADDR12
152 VSSIO VSSIO − − P vss3op
153 ADDR11 ADDR11 Hi-z Hi-z O phot8
154 ADDR10 ADDR10
155 ADDR9 ADDR9
156 ADDR8 ADDR8
157 ADDR7 ADDR7
158 ADDR6 ADDR6
159 ADDR5 ADDR5
160 ADDR4 ADDR4
1-13
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
1-14
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
1-15
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
NOTES :
1. OM[3:0] and ENDIAN value are latched only at the rising edge of nRESET. Therefore, when nRESET is L, the pins of
OM[3:0] and ENDIAN are in input state. After nRESET becomes H, the pin of ENDIAN will be in output state.
2. The @BUS REQ. shows the pin states at the external bus, which is used by the other bus master. The @STOP shows
the pin states when S3C44B0X is in STOP mode.
3. ' − ' mark indicates the unchanged pin state at STOP mode or Bus released mode.
4. IICSDA,IICSCL pins are open-drain type.
5. AI/AO means analog input/output.
1-16
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
1-17
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
SIGNAL DESCRIPTIONS
nOE O nOE (Output Enable) indicates that the current bus cycle is a read cycle.
nXBREQ I nXBREQ (Bus Hold Request) allows another bus master to request control of the local
bus. BACK active indicates that bus control has been granted.
nXBACK O nXBACK (Bus Hold Acknowledge) indicates that the S3C44B0X has surrendered
control of the local bus to another bus master.
nWAIT I nWAIT requests to prolong a current bus cycle. As long as nWAIT is L, the current bus
cycle cannot be completed.
ENDIAN I It determines whether or not the data type is little endian or big endian. The logic level
is determined by the pull-up/down resistor during the RESET cycle.
0:little endian 1:big endian
DRAM/SDRAM/SRAM
nRAS[1:0] O Row Address Strobe
nCAS[3:0] O Column Address strobe
nSRAS O SDRAM Row Address Strobe
nSCAS O SDRAM Column Address Strobe
nSCS[1:0] O SDRAM Chip Select
DQM[3:0] O SDRAM Data Mask
SCLK O SDRAM Clock
SCKE O SDRAM Clock Enable
1-18
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
1-19
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
1-20
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
1-21
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
1-22
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
1-23
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
1-24
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
1-25
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
1-26
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
1-27
PRODUCT OVERVIEW S3C44B0X RISC MICROPROCESSOR
1-28
S3C44B0X RISC MICROPROCESSOR PRODUCT OVERVIEW
1. In the little endian mode, L. endian address must be used. In the big endian mode, B. endian address must be
used.
2. The special registers have to be accessed by the recommended access unit.
3. All registers except ADC registers, RTC registers and UART registers must be read/written in word unit (32bit) at
little/big endian.
4. It is very important that the ADC registers, RTC registers and UART registers be read/written by the specified
access unit and the specified address. Moreover, one must carefully consider which endian mode is used.
5. W: 32-bit register, which must be accessed by LDR/STR or int type pointer(int *).
HW: 16-bit register, which must be accessed by LDRH/STRH or short int type pointer(short int *).
B: 8-bit register, which must be accessed by LDRB/STRB or char type pointer(char *).
1-29
S3C44B0X RISC MICROPROCESSOR PROGRAMMER'S MODEL
2 PROGRAMMER'S MODEL
OVERVIEW
S3C44B0X has been developed using the advanced ARM7TDMI core, which has been designed by Advanced
RISC Machines, Ltd.
From the programmer's point of view, the ARM7TDMI can be in one of two states:
NOTE
Transition between these two states does not affect the processor mode or the contents of the registers.
SWITCHING STATE
Transition to THUMB state will also occur automatically on return from an exception (IRQ, FIQ, UNDEF, ABORT,
SWI etc.), if the exception was entered with the processor in THUMB state.
• On execution of the BX instruction with the state bit clear in the operand register.
• On the processor taking an exception (IRQ, FIQ, RESET, UNDEF, ABORT, SWI etc.). In this case, the PC is
placed in the exception mode's link register, and execution commences at the exception's vector address.
MEMORY FORMATS
ARM7TDMI views memory as a linear collection of bytes numbered upwards from zero. Bytes 0 to 3 hold the first
stored word, bytes 4 to 7 the second and so on. ARM7TDMI can treat words in memory as being stored either in
Big-Endian or Little-Endian format.
2-1
PROGRAMMER'S MODEL S3C44B0X RISC MICROPROCESSOR
BIG-ENDIAN FORMAT
In Big-Endian format, the most significant byte of a word is stored at the lowest numbered byte and the least
significant byte at the highest numbered byte. Byte 0 of the memory system is therefore connected to data lines
31 through 24.
8 9 10 11 8
4 5 6 7 4
0 1 2 3 0
LITTLE-ENDIAN FORMAT
In Little-Endian format, the lowest numbered byte in a word is considered the word's least significant byte, and
the highest numbered byte the most significant. Byte 0 of the memory system is therefore connected to data lines
7 through 0.
11 10 9 8 8
7 6 5 4 4
3 2 1 0 0
INSTRUCTION LENGTH
Instructions are either 32 bits long (in ARM state) or 16 bits long (in THUMB state).
Data Types
ARM7TDMI supports byte (8-bit), halfword (16-bit) and word (32-bit) data types. Words must be aligned to four-
byte boundaries and half words to two-byte boundaries.
2-2
S3C44B0X RISC MICROPROCESSOR PROGRAMMER'S MODEL
OPERATING MODES
Mode changes may be made under software control, or may be brought about by external interrupts or exception
processing. Most application programs will execute in User mode. The non-user modes' known as privileged
modes-are entered in order to service interrupts or exceptions, or to access protected resources.
REGISTERS
ARM7TDMI has a total of 37 registers - 31 general-purpose 32-bit registers and six status registers - but these
cannot all be seen at once. The processor state and operating mode dictate which registers are available to the
programmer.
The ARM state register set contains 16 directly accessible registers: R0 to R15. All of these except R15 are
general-purpose, and may be used to hold either data or address values. In addition to these, there is a
seventeenth register used to store status information.
Register 14 is used as the subroutine link register. This receives a copy of R15 when a Branch
and Link (BL) instruction is executed. At all other times it may be treated as a
general-purpose register. The corresponding banked registers R14_svc, R14_irq,
R14_fiq, R14_abt and R14_und are similarly used to hold the return values of R15
when interrupts and exceptions arise, or when Branch and Link instructions are
executed within interrupt or exception routines.
Register 15 holds the Program Counter (PC). In ARM state, bits [1:0] of R15 are zero and bits
[31:2] contain the PC. In THUMB state, bit [0] is zero and bits [31:1] contain the PC.
Register 16 is the CPSR (Current Program Status Register). This contains condition code flags
and the current mode bits.
FIQ mode has seven banked registers mapped to R8-14 (R8_fiq-R14_fiq). In ARM state, many FIQ handlers do
not need to save any registers. User, IRQ, Supervisor, Abort and Undefined each have two banked registers
mapped to R13 and R14, allowing each of these modes to have a private stack pointer and link registers.
2-3
PROGRAMMER'S MODEL S3C44B0X RISC MICROPROCESSOR
= banked register
2-4
S3C44B0X RISC MICROPROCESSOR PROGRAMMER'S MODEL
= banked register
2-5
PROGRAMMER'S MODEL S3C44B0X RISC MICROPROCESSOR
R0 R0
R1 R1
Lo-registers
R2 R2
R3 R3
R4 R4
R5 R5
R6 R6
R7 R7
R8
R9
R10
Hi-registers
R11
R12
Stack Pointer (SP) Stack Pointer (R13)
Link register (LR) Link register (R14)
Program Counter (PC) Program Counter (R15)
CPSR CPSR
SPSR SPSR
Figure 2-5. Mapping of THUMB State Registers onto ARM State Registers
2-6
S3C44B0X RISC MICROPROCESSOR PROGRAMMER'S MODEL
A value may be transferred from a register in the range R0-R7 (a Lo register) to a Hi register, and from a Hi
register to a Lo register, using special variants of the MOV instruction. Hi register values can also be compared
against or added to Lo register values with the CMP and ADD instructions. For more information, refer to Figure
3-34.
The ARM7TDMI contains a Current Program Status Register (CPSR), plus five Saved Program Status Registers
(SPSRs) for use by exception handlers. These register's functions are:
31 30 29 28 27 26 25 24 23 8 7 6 5 4 3 2 1 0
~
~
N Z C V I F T M4 M3 M2 M1 M0
~
~
Overflow
Mode bits
Carry/Borrow/Extend
State bit
Zero FIQ disable
Negative/Less Than
IRQ disable
2-7
PROGRAMMER'S MODEL S3C44B0X RISC MICROPROCESSOR
In ARM state, all instructions may be executed conditionally: see Table 3-2 for details.
In THUMB state, only the Branch instruction is capable of conditional execution: see Figure 3-46 for details.
The T bit This reflects the operating state. When this bit is set, the processor is executing in THUMB
state, otherwise it is executing in ARM state. This is reflected on the TBIT external signal.
Note that the software must never change the state of the TBIT in the CPSR. If this
happens, the processor will enter an unpredictable state.
Interrupt disable bits The I and F bits are the interrupt disable bits. When set, these disable the IRQ and FIQ
interrupts respectively.
The mode bits The M4, M3, M2, M1 and M0 bits (M[4:0]) are the mode bits. These determine the
processor's operating mode, as shown in Table 2-1. Not all combinations of the mode bits
define a valid processor mode. Only those explicitly described shall be used. The user
should be aware that if any illegal value is programmed into the mode bits, M[4:0], then the
processor will enter an unrecoverable state. If this occurs, reset should be applied.
Reserved bits The remaining bits in the PSRs are reserved. When changing a PSR's flag or control bits,
you must ensure that these unused bits are not altered. Also, your program should not rely
on them containing specific values, since in future processors they may read as one or
zero.
2-8
S3C44B0X RISC MICROPROCESSOR PROGRAMMER'S MODEL
Reserved bits The remaining bits in the PSR's are reserved. When changing a PSR's flag or control bits,
you must ensure that these unused bits are not altered. Also, your program should not rely
on them containing specific values, since in future processors they may read as one or
zero.
2-9
PROGRAMMER'S MODEL S3C44B0X RISC MICROPROCESSOR
EXCEPTIONS
Exceptions arise whenever the normal flow of a program has to be halted temporarily, for example to service an
interrupt from a peripheral. Before an exception can be handled, the current processor state must be preserved
so that the original program can resume when the handler routine has finished.
It is possible for several exceptions to arise at the same time. If this happens, they are dealt with in a fixed order.
See Exception Priorities on page 2-14.
1. Preserves the address of the next instruction in the appropriate Link Register. If the exception has been
entered from ARM state, then the address of the next instruction is copied into the Link Register (that is,
current PC + 4 or PC + 8 depending on the exception. See Table 2-2 on for details). If the exception has
been entered from THUMB state, then the value written into the Link Register is the current PC offset by a
value such that the program resumes from the correct place on return from the exception. This means that
the exception handler need not determine which state the exception was entered from. For example, in the
case of SWI, MOVS PC, R14_svc will always return to the next instruction regardless of whether the SWI
was executed in ARM or THUMB state.
2. Copies the CPSR into the appropriate SPSR
3. Forces the CPSR mode bits to a value which depends on the exception
4. Forces the PC to fetch the next instruction from the relevant exception vector
It may also set the interrupt disable flags to prevent otherwise unmanageable nestings of exceptions.
If the processor is in THUMB state when an exception occurs, it will automatically switch into ARM state when the
PC is loaded with the exception vector address.
NOTE
An explicit switch back to THUMB state is never needed, since restoring the CPSR from the SPSR
automatically sets the T bit to the value it held immediately prior to the exception.
2-10
S3C44B0X RISC MICROPROCESSOR PROGRAMMER'S MODEL
FIQ
The FIQ (Fast Interrupt Request) exception is designed to support a data transfer or channel process, and in
ARM state has sufficient private registers to remove the need for register saving (thus minimising the overhead
of context switching).
FIQ is externally generated by taking the nFIQ input LOW. This input can except either synchronous or
asynchronous transitions, depending on the state of the ISYNC input signal. When ISYNC is LOW, nFIQ and
nIRQ are considered asynchronous, and a cycle delay for synchronization is incurred before the interrupt can
affect the processor flow.
Irrespective of whether the exception was entered from ARM or Thumb state, a FIQ handler should leave the
interrupt by executing
SUBS PC,R14_fiq,#4
FIQ may be disabled by setting the CPSR's F flag (but note that this is not possible from User mode). If the F flag
is clear, ARM7TDMI checks for a LOW level on the output of the FIQ synchroniser at the end of each instruction.
2-11
PROGRAMMER'S MODEL S3C44B0X RISC MICROPROCESSOR
IRQ
The IRQ (Interrupt Request) exception is a normal interrupt caused by a LOW level on the nIRQ input. IRQ has a
lower priority than FIQ and is masked out when a FIQ sequence is entered. It may be disabled at any time by
setting the I bit in the CPSR, though this can only be done from a privileged (non-User) mode.
Irrespective of whether the exception was entered from ARM or Thumb state, an IRQ handler should return from
the interrupt by executing
SUBS PC,R14_irq,#4
Abort
An abort indicates that the current memory access cannot be completed. It can be signalled by the external
ABORT input. ARM7TDMI checks for the abort exception during memory access cycles.
If a prefetch abort occurs, the prefetched instruction is marked as invalid, but the exception will not be taken until
the instruction reaches the head of the pipeline. If the instruction is not executed - for example because a branch
occurs while it is in the pipeline - the abort does not take place.
If a data abort occurs, the action taken depends on the instruction type:
• Single data transfer instructions (LDR, STR) write back modified base registers: the Abort handler must be
aware of this.
• The swap instruction (SWP) is aborted as though it had not been executed.
• Block data transfer instructions (LDM, STM) complete. If write-back is set, the base is updated. If the
instruction would have overwritten the base with data (ie it has the base in the transfer list), the overwriting is
prevented. All register overwriting is prevented after an abort is indicated, which means in particular that R15
(always the last register to be transferred) is preserved in an aborted LDM instruction.
The abort mechanism allows the implementation of a demand paged virtual memory system. In such a system
the processor is allowed to generate arbitrary addresses. When the data at an address is unavailable, the
Memory Management Unit (MMU) signals an abort. The abort handler must then work out the cause of the abort,
make the requested data available, and retry the aborted instruction. The application program needs no
knowledge of the amount of memory available to it, nor is its state in any way affected by the abort.
After fixing the reason for the abort, the handler should execute the following irrespective of the state (ARM or
Thumb):
This restores both the PC and the CPSR, and retries the aborted instruction.
2-12
S3C44B0X RISC MICROPROCESSOR PROGRAMMER'S MODEL
Software Interrupt
The software interrupt instruction (SWI) is used for entering Supervisor mode, usually to request a particular
supervisor function. A SWI handler should return by executing the following irrespective of the state (ARM or
Thumb):
MOV PC,R14_svc
This restores the PC and CPSR, and returns to the instruction following the SWI.
NOTE
nFIQ, nIRQ, ISYNC, LOCK, BIGEND, and ABORT pins exist only in the ARM7TDMI CPU core.
Undefined Instruction
When ARM7TDMI comes across an instruction which it cannot handle, it takes the undefined instruction trap.
This mechanism may be used to extend either the THUMB or ARM instruction set by software emulation.
After emulating the failed instruction, the trap handler should execute the following irrespective of the state (ARM
or Thumb):
MOVS PC,R14_und
This restores the CPSR and returns to the instruction following the undefined instruction.
Exception Vectors
The following table shows the exception vector addresses.
2-13
PROGRAMMER'S MODEL S3C44B0X RISC MICROPROCESSOR
Exception Priorites
When multiple exceptions arise at the same time, a fixed priority system determines the order in which they are
handled:
Highest priority:
1. Reset
2. Data abort
3. FIQ
4. IRQ
5. Prefetch abort
Lowest priority:
If a data abort occurs at the same time as a FIQ, and FIQs are enabled (ie the CPSR's F flag is clear),
ARM7TDMI enters the data abort handler and then immediately proceeds to the FIQ vector. A normal return from
FIQ will cause the data abort handler to resume execution. Placing data abort at a higher priority than FIQ is
necessary to ensure that the transfer error does not escape detection. The time for this exception entry should be
added to worst-case FIQ latency calculations.
2-14
S3C44B0X RISC MICROPROCESSOR PROGRAMMER'S MODEL
INTERRUPT LATENCIES
The worst case latency for FIQ, assuming that it is enabled, consists of the longest time the request can take to
pass through the synchroniser (Tsyncmax if asynchronous), plus the time for the longest instruction to complete
(Tldm, the longest instruction is an LDM which loads all the registers including the PC), plus the time for the data
abort entry (Texc), plus the time for FIQ entry (Tfiq). At the end of this time ARM7TDMI will be executing the
instruction at 0x1C.
Tsyncmax is 3 processor cycles, Tldm is 20 cycles, Texc is 3 cycles, and Tfiq is 2 cycles. The total time is
therefore 28 processor cycles. This is just over 1.4 microseconds in a system which uses a continuous 20 MHz
processor clock. The maximum IRQ latency calculation is similar, but must allow for the fact that FIQ has higher
priority and could delay entry into the IRQ handling routine for an arbitrary length of time. The minimum latency
for FIQ or IRQ consists of the shortest time the request can take through the synchroniser (Tsyncmin) plus Tfiq.
This is 4 processor cycles.
RESET
When the nRESET signal goes LOW, ARM7TDMI abandons the executing instruction and then continues to
fetch instructions from incrementing word addresses.
1. Overwrites R14_svc and SPSR_svc by copying the current values of the PC and CPSR into them. The value
of the saved PC and SPSR is not defined.
2. Forces M[4:0] to 10011 (Supervisor mode), sets the I and F bits in the CPSR, and clears the CPSR's T bit.
3. Forces the PC to fetch the next instruction from address 0x00.
4. Execution resumes in ARM state.
2-15
PROGRAMMER'S MODEL S3C44B0X RISC MICROPROCESSOR
NOTES
2-16
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
3 INSTRUCTION SET
This chapter describes the ARM instruction set and the THUMB instruction set in the ARM7TDMI core.
FORMAT SUMMARY
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
3-1
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
NOTE
Some instruction codes are not defined but do not cause the Undefined instruction trap to be taken, for
instance a Multiply instruction with bit 6 changed to a 1. These instructions should not be used, as their
action may change in future ARM implementations.
INSTRUCTION SUMMARY
3-2
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
3-3
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
In ARM state, all instructions are conditionally executed according to the state of the CPSR condition codes and
the instruction's condition field. This field (bits 31:28) determines the circumstances under which an instruction is
to be executed. If the state of the C, N, Z and V flags fulfils the conditions encoded by the field, the instruction is
executed, otherwise it is ignored.
There are sixteen possible conditions, each represented by a two-character suffix that can be appended to the
instruction's mnemonic. For example, a Branch (B in assembly language) becomes BEQ for "Branch if Equal",
which means the Branch will only be taken if the Z flag is set.
In practice, fifteen different conditions may be used: these are listed in Table 3-2. The sixteenth (1111) is
reserved, and must not be used.
In the absence of a suffix, the condition field of most instructions is set to "Always" (suffix AL). This means the
instruction will always be executed regardless of the CPSR condition codes.
3-4
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
This instruction is only executed if the condition is true. The various conditions are defined in Table 3-2.
This instruction performs a branch by copying the contents of a general register, Rn, into the program counter,
PC. The branch causes a pipeline flush and refill from the address specified by Rn. This instruction also permits
the instruction set to be exchanged. When the instruction is executed, the value of Rn[0] determines whether the
instruction stream will be decoded as ARM or THUMB instructions.
31 28 27 24 23 20 19 16 15 12 11 8 7 4 3 0
Cond 0 0 0 1 0 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1 Rn
The BX instruction takes 2S + 1N cycles to execute, where S and N are defined as sequential (S-cycle) and non-
sequential (N-cycle), respectively.
ASSEMBLER SYNTAX
BX {cond} Rn
{cond} Two character condition mnemonic. See Table 3-2.
Rn is an expression evaluating to a valid register number.
3-5
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
Examples
ADR R0, Into_THUMB + 1 ; Generate branch target address
; and set bit 0 high - hence
; arrive in THUMB state.
BX R0 ; Branch and change to THUMB
; state.
CODE16 ; Assemble subsequent code as
Into_THUMB ; THUMB instructions
•
•
•
ADR R5, Back_to_ARM ; Generate branch target to word aligned address
; - hence bit 0 is low and so change back to ARM state.
BX R5 ; Branch and change back to ARM state.
•
•
•
ALIGN ; Word align
CODE32 ; Assemble subsequent code as ARM instructions
Back_to_ARM
3-6
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
The instruction is only executed if the condition is true. The various conditions are defined Table 3-2. The
instruction encoding is shown in Figure 3-3, below.
31 28 27 25 24 23 0
Cond 101 L Offset
Branch instructions contain a signed 2's complement 24 bit offset. This is shifted left two bits, sign extended to 32
bits, and added to the PC. The instruction can therefore specify a branch of +/- 32Mbytes. The branch offset must
take account of the prefetch operation, which causes the PC to be 2 words (8 bytes) ahead of the current
instruction.
Branches beyond +/- 32Mbytes must use an offset or absolute destination which has been previously loaded into
a register. In this case the PC should be manually saved in R14 if a Branch with Link type operation is required.
Branch with Link (BL) writes the old PC into the link register (R14) of the current bank. The PC value written into
R14 is adjusted to allow for the prefetch, and contains the address of the instruction following the branch and link
instruction. Note that the CPSR is not saved with the PC and R14[1:0] are always cleared.
To return from a routine called by Branch with Link use MOV PC,R14 if the link register is still valid or LDM
Rn!,{..PC} if the link register has been saved onto a stack pointed to by Rn.
Branch and Branch with Link instructions take 2S + 1N incremental cycles, where S and N are defined as
sequential (S-cycle) and internal (I-cycle).
3-7
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
ASSEMBLER SYNTAX
B{L}{cond} <expression>
{L} Used to request the Branch with Link form of the instruction. If absent, R14 will not be
affected by the instruction.
{cond} A two-character mnemonic as shown in Table 3-2. If absent then AL (ALways) will be
used.
<expression> The destination. The assembler calculates the offset.
EXAMPLES
3-8
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
DATA PROCESSING
The data processing instruction is only executed if the condition is true. The conditions are defined in Table 3-2.
The instruction encoding is shown in Figure 3-4.
31 28 27 26 25 24 21 20 19 16 15 12 11 0
Cond 00 L OpCode S Rn Rd Operand2
3-9
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
The instruction produces a result by performing a specified arithmetic or logical operation on one or two
operands. The first operand is always a register (Rn).
The second operand may be a shifted register (Rm) or a rotated 8 bit immediate value (Imm) according to the
value of the I bit in the instruction. The condition codes in the CPSR may be preserved or updated as a result of
this instruction, according to the value of the S bit in the instruction.
Certain operations (TST, TEQ, CMP, CMN) do not write the result to Rd. They are used only to perform tests and
to set the condition codes on the result and always have the S bit set. The instructions and their effects are listed
in Table 3-3.
3-10
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
CPSR FLAGS
The data processing operations may be classified as logical or arithmetic. The logical operations (AND, EOR,
TST, TEQ, ORR, MOV, BIC, MVN) perform the logical action on all corresponding bits of the operand or
operands to produce the result. If the S bit is set (and Rd is not R15, see below) the V flag in the CPSR will be
unaffected, the C flag will be set to the carry out from the barrel shifter (or preserved when the shift operation is
LSL #0), the Z flag will be set if and only if the result is all zeros, and the N flag will be set to the logical value of
bit 31 of the result.
The arithmetic operations (SUB, RSB, ADD, ADC, SBC, RSC, CMP, CMN) treat each operand as a 32 bit integer
(either unsigned or 2's complement signed, the two are equivalent). If the S bit is set (and Rd is not R15) the V
flag in the CPSR will be set if an overflow occurs into bit 31 of the result; this may be ignored if the operands
were considered unsigned, but warns of a possible error if the operands were 2's complement signed. The C flag
will be set to the carry out of bit 31 of the ALU, the Z flag will be set if and only if the result was zero, and the N
flag will be set to the value of bit 31 of the result (indicating a negative result if the operands are considered to be
2's complement signed).
3-11
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
SHIFTS
When the second operand is specified to be a shifted register, the operation of the barrel shifter is controlled by
the Shift field in the instruction. This field indicates the type of shift to be performed (logical left or right,
arithmetic right or rotate right). The amount by which the register should be shifted may be contained in an
immediate field in the instruction, or in the bottom byte of another register (other than R15). The encoding for the
different shift types is shown in Figure 3-5.
11 7 6 5 4 11 8 7 6 5 4
0 RS 0 1
31 27 26 0
Contents of Rm
carry out
Value of Operand 2 0 0 0 0 0
NOTE
LSL #0 is a special case, where the shifter carry out is the old value of the CPSR C flag. The contents of
Rm are used directly as the second operand. A logical shift right (LSR) is similar, but the contents of Rm
are moved to less significant positions in the result. LSR #5 has the effect shown in Figure 3-7.
3-12
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
31 5 4 0
Contents of Rm
carry out
0 0 0 0 0 Value of Operand 2
The form of the shift field which might be expected to correspond to LSR #0 is used to encode LSR #32, which
has a zero result with bit 31 of Rm as the carry output. Logical shift right zero is redundant as it is the same as
logical shift left zero, so the assembler will convert LSR #0 (and ASR #0 and ROR #0) into LSL #0, and allow
LSR #32 to be specified.
An arithmetic shift right (ASR) is similar to logical shift right, except that the high bits are filled with bit 31 of Rm
instead of zeros. This preserves the sign in 2's complement notation. For example, ASR #5 is shown in Figure
3-8.
31 30 5 4 0
Contents of Rm
carry out
Value of Operand 2
The form of the shift field which might be expected to give ASR #0 is used to encode ASR #32. Bit 31 of Rm is
again used as the carry output, and each bit of operand 2 is also equal to bit 31 of Rm. The result is therefore all
ones or all zeros, according to the value of bit 31 of Rm.
3-13
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
Rotate right (ROR) operations reuse the bits which "overshoot" in a logical shift right operation by reintroducing
them at the high end of the result, in place of the zeros used to fill the high end in logical right operations. For
example, ROR #5 is shown in Figure 3-9.
31 5 4 0
Contents of Rm
carry out
Value of Operand 2
The form of the shift field which might be expected to give ROR #0 is used to encode a special function of the
barrel shifter, rotate right extended (RRX). This is a rotate right by one bit position of the 33 bit quantity formed by
appending the CPSR C flag to the most significant end of the contents of Rm as shown in Figure 3-10.
31 1 0
Contents of Rm
C carry out
in
Value of Operand 2
3-14
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
If this byte is zero, the unchanged contents of Rm will be used as the second operand, and the old value of the
CPSR C flag will be passed on as the shifter carry output.
If the byte has a value between 1 and 31, the shifted result will exactly match that of an instruction specified shift
with the same value and shift operation.
If the value in the byte is 32 or more, the result will be a logical extension of the shift described above:
NOTE
The zero in bit 7 of an instruction with a register controlled shift is compulsory; a one in this bit will cause
the instruction to be a multiply or undefined instruction.
3-15
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
The immediate operand rotate field is a 4 bit unsigned integer which specifies a shift operation on the 8 bit
immediate value. This value is zero extended to 32 bits, and then subject to a rotate right by twice the value in
the rotate field. This enables many common constants to be generated, for example all powers of 2.
WRITING TO R15
When Rd is a register other than R15, the condition code flags in the CPSR may be updated from the ALU flags
as described above.
When Rd is R15 and the S flag in the instruction is not set the result of the operation is placed in R15 and the
CPSR is unaffected.
When Rd is R15 and the S flag is set the result of the operation is placed in R15 and the SPSR corresponding to
the current mode is moved to the CPSR. This allows state changes which atomically restore both PC and CPSR.
This form of instruction should not be used in User mode.
If R15 (the PC) is used as an operand in a data processing instruction the register is used directly.
The PC value will be the address of the instruction, plus 8 or 12 bytes due to instruction prefetching. If the shift
amount is specified in the instruction, the PC will be 8 bytes ahead. If a register is used to specify the shift
amount the PC will be 12 bytes ahead.
NOTE
TEQ, TST, CMP and CMN do not write the result of their operation but do set flags in the CPSR. An
assembler should always set the S flag for these instructions even if this is not specified in the
mnemonic.
The TEQP form of the TEQ instruction used in earlier ARM processors must not be used: the PSR transfer
operations should be used instead.
The action of TEQP in the ARM7TDMI is to move SPSR_<mode> to the CPSR if the processor is in a privileged
mode and to do nothing if in User mode.
Data Processing instructions vary in the number of incremental cycles taken as follows:
3-16
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
ASSEMBLER SYNTAX
where:
<Op2> Rm{,<shift>} or,<#expression>
{cond} A two-character condition mnemonic. See Table 3-2.
{S} Set condition codes if S present (implied for CMP, CMN, TEQ, TST).
Rd, Rn and Rm Expressions evaluating to a register number.
<#expression> If this is used, the assembler will attempt to generate a shifted immediate 8-bit field to
match the expression. If this is impossible, it will give an error.
<shift> <Shiftname> <register> or <shiftname> #expression, or RRX (rotate right one bit with
extend).
<shiftname>s ASL, LSL, LSR, ASR, ROR. (ASL is a synonym for LSL, they assemble to the same
code.)
EXAMPLES
3-17
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2.
The MRS and MSR instructions are formed from a subset of the Data Processing operations and are
implemented using the TEQ, TST, CMN and CMP instructions without the S flag set. The encoding is shown in
Figure 3-11.
These instructions allow access to the CPSR and SPSR registers. The MRS instruction allows the contents of the
CPSR or SPSR_<mode> to be moved to a general register. The MSR instruction allows the contents of a general
register to be moved to the CPSR or SPSR_<mode> register.
The MSR instruction also allows an immediate value or register contents to be transferred to the condition code
flags (N,Z,C and V) of CPSR or SPSR_<mode> without affecting the control bits. In this case, the top four bits of
the specified register contents or 32 bit immediate value are written to the top four bits of the relevant PSR.
OPERAND RESTRICTIONS
• In user mode, the control bits of the CPSR are protected from change, so only the condition code flags of the
CPSR can be changed. In other (privileged) modes the entire CPSR can be changed.
• Note that the software must never change the state of the T bit in the CPSR. If this happens, the processor
will enter an unpredictable state.
• The SPSR register which is accessed depends on the mode at the time of execution. For example, only
SPSR_fiq is accessible when the processor is in FIQ mode.
• You must not specify R15 as the source or destination register.
• Also, do not attempt to access an SPSR in User mode, since no such register exists.
3-18
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
MRS (transfer register contents or immediate value to PSR flag bits only)
31 28 27 26 25 24 23 22 21 12 11 0
Cond 00 I 10 Pd 101001111 Source operand
3-19
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
RESERVED BITS
Only twelve bits of the PSR are defined in ARM7TDMI (N,Z,C,V,I,F, T & M[4:0]); the remaining bits are reserved
for use in future versions of the processor. Refer to Figure 2-6 for a full description of the PSR bits.
To ensure the maximum compatibility between ARM7TDMI programs and future processors, the following rules
should be observed:
• The reserved bits should be preserved when changing the value in a PSR.
• Programs should not rely on specific values from the reserved bits when checking the PSR status, since they
may read as one or zero in future processors.
A read-modify-write strategy should therefore be used when altering the control bits of any PSR register; this
involves transferring the appropriate PSR register to a general register using the MRS instruction, changing only
the relevant bits and then transferring the modified value back to the PSR register using the MSR instruction.
EXAMPLES
When the aim is simply to change the condition code flags in a PSR, a value can be written directly to the flag
bits without disturbing the control bits. The following instruction sets the N,Z,C and V flags:
MSR CPSR_flg,#0xF0000000 ; Set all the flags regardless of their previous state
; (does not affect any control bits).
No attempt should be made to write an 8 bit immediate value into the whole PSR since such an operation cannot
preserve the reserved bits.
3-20
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
ASSEMBLY SYNTAX
The most significant four bits of the register contents are written to the N,Z,C & V flags respectively.
The expression should symbolise a 32 bit value of which the most significant four bits are written to the N,Z,C
and V flags respectively.
Key:
{cond} Two-character condition mnemonic. See Table 3-2..
Rd and Rm Expressions evaluating to a register number other than R15
<psr> CPSR, CPSR_all, SPSR or SPSR_all. (CPSR and CPSR_all are synonyms as are SPSR
and SPSR_all)
<psrf> CPSR_flg or SPSR_flg
<#expression> Where this is used, the assembler will attempt to generate a shifted immediate 8-bit field
to match the expression. If this is impossible, it will give an error.
EXAMPLES
3-21
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction encoding is shown in Figure 3-12.
The multiply and multiply-accumulate instructions use an 8 bit Booth's algorithm to perform integer multiplication.
31 28 27 22 21 20 19 16 15 12 11 8 7 4 3 0
Cond 0 0 0 0 0 0 A S Rd Rn Rs 1 0 0 1 Rm
[21] Accumulate
0 = Multiply only
1 = Multiply and accumulate
The multiply form of the instruction gives Rd:=Rm*Rs. Rn is ignored, and should be set to zero for compatibility
with possible future upgrades to the instruction set. The multiply-accumulate form gives Rd:=Rm*Rs+Rn, which
can save an explicit ADD instruction in some circumstances. Both forms of the instruction work on operands
which may be considered as signed (2's complement) or unsigned integers.
The results of a signed multiply and of an unsigned multiply of 32 bit operands differ only in the upper 32 bits -
the low 32 bits of the signed and unsigned results are identical. As these instructions only produce the low 32 bits
of a multiply, they can be used for both signed and unsigned multiplies.
3-22
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
Operand Restrictions
The destination register Rd must not be the same as the operand register Rm. R15 must not be used as an
operand or as the destination register.
All other register combinations will give correct results, and Rd, Rn and Rs may use the same register when
required.
3-23
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
CPSR FLAGS
Setting the CPSR flags is optional, and is controlled by the S bit in the instruction. The N (Negative) and Z (Zero)
flags are set correctly on the result (N is made equal to bit 31 of the result, and Z is set if and only if the result is
zero). The C (Carry) flag is set to a meaningless value and the V (oVerflow) flag is unaffected.
MUL takes 1S + mI and MLA 1S + (m+1)I cycles to execute, where S and I are defined as sequential (S-cycle)
and internal (I-cycle), respectively.
m The number of 8 bit multiplier array cycles is required to complete the multiply, which is
controlled by the value of the multiplier operand specified by Rs. Its possible values are
as follows
1 If bits [32:8] of the multiplier operand are all zero or all one.
2 If bits [32:16] of the multiplier operand are all zero or all one.
3 If bits [32:24] of the multiplier operand are all zero or all one.
4 In all other cases.
ASSEMBLER SYNTAX
MUL{cond}{S} Rd,Rm,Rs
MLA{cond}{S} Rd,Rm,Rs,Rn
EXAMPLES
3-24
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction encoding is shown in Figure 3-13.
The multiply long instructions perform integer multiplication on two 32 bit operands and produce 64 bit results.
Signed and unsigned multiplication each with optional accumulate give rise to four variations.
31 28 27 23 22 21 20 19 16 15 12 11 8 7 4 3 0
Cond 0 0 0 0 1 U A S RdHi RdLo Rs 1 0 0 1 Rm
[21] Accumulate
0 = Multiply only
1 = Multiply and accumulate
[22] Unsigned
0 = Unsigned
1 = Signed
The multiply forms (UMULL and SMULL) take two 32 bit numbers and multiply them to produce a 64 bit result of
the form RdHi,RdLo := Rm * Rs. The lower 32 bits of the 64 bit result are written to RdLo, the upper 32 bits of the
result are written to RdHi.
The multiply-accumulate forms (UMLAL and SMLAL) take two 32 bit numbers, multiply them and add a 64 bit
number to produce a 64 bit result of the form RdHi,RdLo := Rm * Rs + RdHi,RdLo. The lower 32 bits of the 64 bit
number to add is read from RdLo. The upper 32 bits of the 64 bit number to add is read from RdHi. The lower 32
bits of the 64 bit result are written to RdLo. The upper 32 bits of the 64 bit result are written to RdHi.
The UMULL and UMLAL instructions treat all of their operands as unsigned binary numbers and write an
unsigned 64 bit result. The SMULL and SMLAL instructions treat all of their operands as two's-complement
signed numbers and write a two's-complement signed 64 bit result.
3-25
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
OPERAND RESTRICTIONS
CPSR FLAGS
Setting the CPSR flags is optional, and is controlled by the S bit in the instruction. The N and Z flags are set
correctly on the result (N is equal to bit 63 of the result, Z is set if and only if all 64 bits of the result are zero).
Both the C and V flags are set to meaningless values.
MULL takes 1S + (m+1)I and MLAL 1S + (m+2)I cycles to execute, where m is the number of 8 bit multiplier
array cycles required to complete the multiply, which is controlled by the value of the multiplier operand specified
by Rs.
3-26
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
ASSEMBLER SYNTAX
where:
{cond} Two-character condition mnemonic. See Table 3-2.
{S} Set condition codes if S present
RdLo, RdHi, Rm, Rs Expressions evaluating to a register number other than R15.
EXAMPLES
3-27
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction encoding is shown in Figure 3-14.
The single data transfer instructions are used to load or store single bytes or words of data. The memory address
used in the transfer is calculated by adding an offset to or subtracting an offset from a base register.
The result of this calculation may be written back into the base register if auto-indexing is required.
31 28 27 26 25 24 23 22 21 20 19 16 15 12 11 0
Cond 01 I P U B W L Rn Rd Offset
[11:0] Offset
11 0
Immediate
11 4 3 0
Shift Rm
3-28
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
The offset from the base may be either a 12 bit unsigned binary immediate value in the instruction, or a second
register (possibly shifted in some way). The offset may be added to (U=1) or subtracted from (U=0) the base
register Rn. The offset modification may be performed either before (pre-indexed, P=1) or after (post-indexed,
P=0) the base is used as the transfer address.
The W bit gives optional auto increment and decrement addressing modes. The modified base value may be
written back into the base (W=1), or the old base value may be kept (W=0). In the case of post-indexed
addressing, the write back bit is redundant and is always set to zero, since the old base value can be retained by
setting the offset to zero. Therefore post-indexed data transfers always write back the modified base. The only
use of the W bit in a post-indexed data transfer is in privileged mode code, where setting the W bit forces non-
privileged mode for the transfer, allowing the operating system to generate a user address in a system where the
memory management hardware makes suitable use of this hardware.
The 8 shift control bits are described in the data processing instructions section. However, the register specified
shift amounts are not available in this instruction class. See Figure 3-5.
This instruction class may be used to transfer a byte (B=1) or a word (B=0) between an ARM7TDMI register and
memory.
The action of LDR(B) and STR(B) instructions is influenced by the BIGEND control signal of ARM7TDMI core.
The two possible configurations are described below.
Little-Endian Configuration
A byte load (LDRB) expects the data on data bus inputs 7 through 0 if the supplied address is on a word
boundary, on data bus inputs 15 through 8 if it is a word address plus one byte, and so on. The selected byte is
placed in the bottom 8 bits of the destination register, and the remaining bits of the register are filled with zeros.
Please see Figure 2-2.
A byte store (STRB) repeats the bottom 8 bits of the source register four times across data bus outputs 31
through 0. The external memory system should activate the appropriate byte subsystem to store the data.
A word load (LDR) will normally use a word aligned address. However, an address offset from a word boundary
will cause the data to be rotated into the register so that the addressed byte occupies bits 0 to 7. This means that
half-words accessed at offsets 0 and 2 from the word boundary will be correctly loaded into bits 0 through 15 of
the register. Two shift operations are then required to clear or to sign extend the upper 16 bits.
A word store (STR) should generate a word aligned address. The word presented to the data bus is not affected if
the address is not word aligned. That is, bit 31 of the register being stored always appears on data bus output 31.
3-29
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
memory register
A A
A+3 24 24
B B
A+2 16 16
C C
A+1 8 8
D D
A 0 0
LDR from word aligned address
memory register
A A
A+3 24 24
B B
A+2 16 16
C C
A+1 8 8
D D
A 0 0
LDR from address offset by 2
Big-Endian Configuration
A byte load (LDRB) expects the data on data bus inputs 31 through 24 if the supplied address is on a word
boundary, on data bus inputs 23 through 16 if it is a word address plus one byte, and so on. The selected byte is
placed in the bottom 8 bits of the destination register and the remaining bits of the register are filled with zeros.
Please see Figure 2-1.
A byte store (STRB) repeats the bottom 8 bits of the source register four times across data bus outputs 31
through 0. The external memory system should activate the appropriate byte subsystem to store the data.
A word load (LDR) should generate a word aligned address. An address offset of 0 or 2 from a word boundary will
cause the data to be rotated into the register so that the addressed byte occupies bits 31 through 24. This means
that half-words accessed at these offsets will be correctly loaded into bits 16 through 31 of the register. A shift
operation is then required to move (and optionally sign extend) the data into the bottom 16 bits. An address offset
of 1 or 3 from a word boundary will cause the data to be rotated into the register so that the addressed byte
occupies bits 15 through 8.
A word store (STR) should generate a word aligned address. The word presented to the data bus is not affected if
the address is not word aligned. That is, bit 31 of the register being stored always appears on data bus output 31.
3-30
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
USE OF R15
Write-back must not be specified if R15 is specified as the base register (Rn). When using R15 as the base
register you must remember it contains an address 8 bytes on from the address of the current instruction.
When R15 is the source register (Rd) of a register store (STR) instruction, the stored value will be address of the
instruction plus 12.
When configured for late aborts, the following example code is difficult to unwind as the base register, Rn, gets
updated before the abort handler starts. Sometimes it may be impossible to calculate the initial value.
After an abort, the following example code is difficult to unwind as the base register, Rn, gets updated before the
abort handler starts. Sometimes it may be impossible to calculate the initial value.
EXAMPLE:
LDR R0,[R1],R1
Therefore a post-indexed LDR or STR where Rm is the same register as Rn should not be used.
DATA ABORTS
A transfer to or from a legal address may cause problems for a memory management system. For instance, in a
system which uses virtual memory the required data may be absent from main memory. The memory manager
can signal a problem by taking the processor ABORT input HIGH whereupon the Data Abort trap will be taken. It
is up to the system software to resolve the cause of the problem, then the instruction can be restarted and the
original program continued.
Normal LDR instructions take 1S + 1N + 1I and LDR PC take 2S + 2N +1I incremental cycles, where S,N and I
are defined as sequential (S-cycle), non-sequential (N-cycle), and internal (I-cycle), respectively. STR instructions
take 2N incremental cycles to execute.
3-31
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
ASSEMBLER SYNTAX
<LDR|STR>{cond}{B}{T} Rd,<Address>
where:
<Address>can be:
{!} Writes back the base register (set the W bit) if! is present.
3-32
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
EXAMPLES
3-33
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction encoding is shown in Figure 3-16.
These instructions are used to load or store half-words of data and also load sign-extended bytes or half-words of
data. The memory address used in the transfer is calculated by adding an offset to or subtracting an offset from a
base register. The result of this calculation may be written back into the base register if auto-indexing is required.
31 28 27 25 24 23 22 21 20 19 16 15 12 11 8 7 6 5 4 3 0
Cond 000 P U 0 W L Rn Rd 0000 1 S H 1 Rm
[6][5] S H
0 0 = SWP instruction
0 1 = Unsigned halfword
1 1 = Signed byte
1 1 = Signed halfword
[20] Load/Store
0 = Store to memory
1 = Load from memory
[21] Write-back
0 = No write-back
1 = Write address into base
[23] Up/Down
0 = Down: subtract offset from base
1 = Up: add offset to base
Figure 3-16. Halfword and Signed Data Transfer with Register Offset
3-34
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
31 28 27 25 24 23 22 21 20 19 16 15 12 11 8 7 6 5 4 3 0
Cond 000 P U 1 W L Rn Rd Offset 1 S H 1 Offset
[6][5] S H
0 0 = SWP instruction
0 1 = Unsigned halfword
1 1 = Signed byte
1 1 = Signed halfword
[20] Load/Store
0 = Store to memory
1 = Load from memory
[21] Write-back
0 = No write-back
1 = Write address into base
[23] Up/Down
0 = Down: subtract offset from base
1 = Up: add offset to base
Figure 3-17. Halfword and Signed Data Transfer with Immediate Offset and Auto-Indexing
The offset from the base may be either a 8-bit unsigned binary immediate value in the instruction, or a second
register. The 8-bit offset is formed by concatenating bits 11 to 8 and bits 3 to 0 of the instruction word, such that
bit 11 becomes the MSB and bit 0 becomes the LSB. The offset may be added to (U=1) or subtracted from (U=0)
the base register Rn. The offset modification may be performed either before (pre-indexed, P=1) or after (post-
indexed, P=0) the base register is used as the transfer address.
The W bit gives optional auto-increment and decrement addressing modes. The modified base value may be
written back into the base (W=1), or the old base may be kept (W=0). In the case of post-indexed addressing, the
write back bit is redundant and is always set to zero, since the old base value can be retained if necessary by
setting the offset to zero. Therefore post-indexed data transfers always write back the modified base.
The Write-back bit should not be set high (W=1) when post-indexed addressing is selected.
3-35
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
Setting S=0 and H=1 may be used to transfer unsigned Half-words between an ARM7TDMI register and memory.
The action of LDRH and STRH instructions is influenced by the BIGEND control signal. The two possible
configurations are described in the section below.
The S bit controls the loading of sign-extended data. When S=1 the H bit selects between Bytes (H=0) and Half-
words (H=1). The L bit should not be set low (Store) when Signed (S=1) operations have been selected.
The LDRSB instruction loads the selected Byte into bits 7 to 0 of the destination register and bits 31 to 8 of the
destination register are set to the value of bit 7, the sign bit.
The LDRSH instruction loads the selected Half-word into bits 15 to 0 of the destination register and bits 31 to 16
of the destination register are set to the value of bit 15, the sign bit.
The action of the LDRSB and LDRSH instructions is influenced by the BIGEND control signal. The two possible
configurations are described in the following section.
Little-Endian Configuration
A signed byte load (LDRSB) expects data on data bus inputs 7 through to 0 if the supplied address is on a word
boundary, on data bus inputs 15 through to 8 if it is a word address plus one byte, and so on. The selected byte is
placed in the bottom 8 bit of the destination register, and the remaining bits of the register are filled with the sign
bit, bit 7 of the byte. Please see Figure 2-2.
A halfword load (LDRSH or LDRH) expects data on data bus inputs 15 through to 0 if the supplied address is on a
word boundary and on data bus inputs 31 through to 16 if it is a halfword boundary, (A[1]=1).The supplied
address should always be on a halfword boundary. If bit 0 of the supplied address is HIGH then the ARM7TDMI
will load an unpredictable value. The selected halfword is placed in the bottom 16 bits of the destination register.
For unsigned half-words (LDRH), the top 16 bits of the register are filled with zeros and for signed half-words
(LDRSH) the top 16 bits are filled with the sign bit, bit 15 of the halfword.
A halfword store (STRH) repeats the bottom 16 bits of the source register twice across the data bus outputs 31
through to 0. The external memory system should activate the appropriate halfword subsystem to store the data.
Note that the address must be halfword aligned, if bit 0 of the address is HIGH this will cause unpredictable
behaviour.
3-36
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
Big-Endian Configuration
A signed byte load (LDRSB) expects data on data bus inputs 31 through to 24 if the supplied address is on a
word boundary, on data bus inputs 23 through to 16 if it is a word address plus one byte, and so on. The selected
byte is placed in the bottom 8 bit of the destination register, and the remaining bits of the register are filled with
the sign bit, bit 7 of the byte. Please see Figure 2-1.
A halfword load (LDRSH or LDRH) expects data on data bus inputs 31 through to 16 if the supplied address is on
a word boundary and on data bus inputs 15 through to 0 if it is a halfword boundary, (A[1]=1). The supplied
address should always be on a halfword boundary. If bit 0 of the supplied address is HIGH then the ARM7TDMI
will load an unpredictable value. The selected halfword is placed in the bottom 16 bits of the destination register.
For unsigned half-words (LDRH), the top 16 bits of the register are filled with zeros and for signed half-words
(LDRSH) the top 16 bits are filled with the sign bit, bit 15 of the halfword.
A halfword store (STRH) repeats the bottom 16 bits of the source register twice across the data bus outputs 31
through to 0. The external memory system should activate the appropriate halfword subsystem to store the data.
Note that the address must be halfword aligned, if bit 0 of the address is HIGH this will cause unpredictable
behaviour.
USE OF R15
Write-back should not be specified if R15 is specified as the base register (Rn). When using R15 as the base
register you must remember it contains an address 8 bytes on from the address of the current instruction.
When R15 is the source register (Rd) of a Half-word store (STRH) instruction, the stored address will be address
of the instruction plus 12.
DATA ABORTS
A transfer to or from a legal address may cause problems for a memory management system. For instance, in a
system which uses virtual memory the required data may be absent from the main memory. The memory
manager can signal a problem by taking the processor ABORT input HIGH whereupon the Data Abort trap will be
taken. It is up to the system software to resolve the cause of the problem, then the instruction can be restarted
and the original program continued.
3-37
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
ASSEMBLER SYNTAX
<LDR|STR>{cond}<H|SH|SB> Rd,<address>
{!} Writes back the base register (set the W bit) if ! is present.
3-38
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
EXAMPLES
3-39
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction encoding is shown in Figure 3-18.
Block data transfer instructions are used to load (LDM) or store (STM) any subset of the currently visible
registers. They support all possible stacking modes, maintaining full or empty stacks which can grow up or down
memory, and are very efficient instructions for saving or restoring context, or for moving large blocks of data
around main memory.
The instruction can cause the transfer of any registers in the current bank (and non-user mode programs can also
transfer to and from the user bank, see below). The register list is a 16 bit field in the instruction, with each bit
corresponding to a register. A 1 in bit 0 of the register field will cause R0 to be transferred, a 0 will cause it not to
be transferred; similarly bit 1 controls the transfer of R1, and so on.
Any subset of the registers, or all the registers, may be specified. The only restriction is that the register list
should not be empty.
Whenever R15 is stored to memory the stored value is the address of the STM instruction plus 12.
31 28 27 25 24 23 22 21 20 19 16 15 0
Cond 100 P U S W L Rn Register list
3-40
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
ADDRESSING MODES
The transfer addresses are determined by the contents of the base register (Rn), the pre/post bit (P) and the up/
down bit (U). The registers are transferred in the order lowest to highest, so R15 (if in the list) will always be
transferred last. The lowest register also gets transferred to/from the lowest memory address. By way of
illustration, consider the transfer of R1, R5 and R7 in the case where Rn=0x1000 and write back of the modified
base is required (W=1). Figure 3.19-22 show the sequence of register transfers, the addresses used, and the
value of Rn after the instruction has completed.
In all cases, had write back of the modified base not been required (W=0), Rn would have retained its initial value
of 0x1000 unless it was also in the transfer list of a load multiple register instruction, when it would have been
overwritten with the loaded value.
ADDRESS ALIGNMENT
The address should normally be a word aligned quantity and non-word aligned addresses do not affect the
instruction. However, the bottom 2 bits of the address will appear on A[1:0] and might be interpreted by the
memory system.
0x100C 0x100C
Rn 0x1000 R1 0x1000
0x0FF4 0x0FF4
1 2
0x100C Rn 0x100C
R7
R5 R5
R1 0x1000 R1 0x1000
0x0FF4 0x0FF4
3 4
3-41
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
0x100C 0x100C
R1
Rn 0x1000 0x1000
0x0FF4 0x0FF4
1 2
0x100C Rn R7 0x100C
R5 R5
R1 R1
0x1000 0x1000
0x0FF4 0x0FF4
3 4
0x100C 0x100C
Rn 0x1000 0x1000
R1
0x0FF4 0x0FF4
1 2
0x100C 0x100C
0x1000 R7 0x1000
R5 R5
R1 R1
0x0FF4 Rn 0x0FF4
3 4
3-42
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
0x100C 0x100C
Rn 0x1000 0x1000
0x0FF4 R1 0x0FF4
1 2
0x100C 0x100C
0x1000 0x1000
R7
R5 R5
R1 0x0FF4 Rn R1 0x0FF4
3 4
When the S bit is set in a LDM/STM instruction its meaning depends on whether or not R15 is in the transfer list
and on the type of instruction. The S bit should only be set if the instruction is to execute in a privileged mode.
LDM with R15 in Transfer List and S Bit Set (Mode Changes)
If the instruction is a LDM then SPSR_<mode> is transferred to CPSR at the same time as R15 is loaded.
STM with R15 in Transfer List and S Bit Set (User Bank Transfer)
The registers transferred are taken from the User bank rather than the bank corresponding to the current mode.
This is useful for saving the user state on process switches. Base write-back should not be used when this
mechanism is employed.
When the instruction is LDM, care must be taken not to read from a banked register during the following cycle
(inserting a dummy instruction such as MOV R0, R0 after the LDM will ensure safety).
R15 should not be used as the base register in any LDM or STM instruction.
3-43
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
When write-back is specified, the base is written back at the end of the second cycle of the instruction. During a
STM, the first register is written out at the start of the second cycle. A STM which includes storing the base, with
the base as the first register to be stored, will therefore store the unchanged value, whereas with the base second
or later in the transfer order, will store the modified value. A LDM will always overwrite the updated base if the
base is in the list.
DATA ABORTS
Some legal addresses may be unacceptable to a memory management system, and the memory manager can
indicate a problem with an address by taking the ABORT signal HIGH. This can happen on any transfer during a
multiple register load or store, and must be recoverable if ARM7TDMI is to be used in a virtual memory system.
• Overwriting of registers stops when the abort happens. The aborting load will not take place but earlier ones
may have overwritten registers. The PC is always the last register to be written and so will always be
preserved.
• The base register is restored, to its modified value if write-back was requested. This ensures recoverability in
the case where the base register is also in the transfer list, and may have been overwritten before the abort
occurred.
The data abort trap is taken when the load multiple has completed, and the system software must undo any base
modification (and resolve the cause of the abort) before restarting the instruction.
Normal LDM instructions take nS + 1N + 1I and LDM PC takes (n+1)S + 2N + 1I incremental cycles, where S,N
and I are defined as sequential (S-cycle), non-sequential (N-cycle), and internal (I-cycle), respectively. STM
instructions take (n-1)S + 2N incremental cycles to execute, where n is the number of words transferred.
3-44
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
ASSEMBLER SYNTAX
<LDM|STM>{cond}<FD|ED|FA|EA|IA|IB|DA|DB> Rn{!},<Rlist>{^}
where:
FD, ED, FA, EA define pre/post indexing and the up/down bit by reference to the form of stack required. The F
and E refer to a "full" or "empty" stack, i.e. whether a pre-index has to be done (full) before storing to the stack.
The A and D refer to whether the stack is ascending or descending. If ascending, a STM will go up and LDM
down, if descending, vice-versa.
IA, IB, DA, DB allow control when LDM/STM are not being used for stacks and simply mean Increment After,
Increment Before, Decrement After, Decrement Before.
3-45
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
EXAMPLES
These instructions may be used to save state on subroutine entry, and restore it efficiently on return to the calling
routine:
3-46
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
31 28 27 23 22 21 20 19 16 15 12 11 8 7 4 3 0
Cond 00010 B 00 Rn Rd 0000 1001 Rm
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction encoding is shown in Figure 3-23.
The data swap instruction is used to swap a byte or word quantity between a register and external memory. This
instruction is implemented as a memory read followed by a memory write which are "locked" together (the
processor cannot be interrupted until both operations have completed, and the memory manager is warned to
treat them as inseparable). This class of instruction is particularly useful for implementing software semaphores.
The swap address is determined by the contents of the base register (Rn). The processor first reads the contents
of the swap address. Then it writes the contents of the source register (Rm) to the swap address, and stores the
old memory contents in the destination register (Rd). The same register may be specified as both the source and
destination.
The LOCK output goes HIGH for the duration of the read and write operations to signal to the external memory
manager that they are locked together, and should be allowed to complete without interruption. This is important
in multi-processor systems where the swap instruction is the only indivisible instruction which may be used to
implement semaphores; control of the memory must not be removed from a processor while it is performing a
locked operation.
This instruction class may be used to swap a byte (B=1) or a word (B=0) between an ARM7TDMI register and
memory. The SWP instruction is implemented as a LDR followed by a STR and the action of these is as
described in the section on single data transfers. In particular, the description of Big and Little Endian
configuration applies to the SWP instruction.
3-47
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
USE OF R15
DATA ABORTS
If the address used for the swap is unacceptable to a memory management system, the memory manager can
flag the problem by driving ABORT HIGH. This can happen on either the read or the write cycle (or both), and in
either case, the Data Abort trap will be taken. It is up to the system software to resolve the cause of the problem,
then the instruction can be restarted and the original program continued.
Swap instructions take 1S + 2N +1I incremental cycles to execute, where S,N and I are defined as sequential
(S-cycle), non-sequential, and internal (I-cycle), respectively.
ASSEMBLER SYNTAX
<SWP>{cond}{B} Rd,Rm,[Rn]
EXAMPLES
3-48
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction encoding is shown in Figure 3-24, below.
31 28 27 24 23 0
Cond 1111 Comment Field (Ignored by Processor)
The software interrupt instruction is used to enter Supervisor mode in a controlled manner. The instruction
causes the software interrupt trap to be taken, which effects the mode change. The PC is then forced to a fixed
value (0x08) and the CPSR is saved in SPSR_svc. If the SWI vector address is suitably protected (by external
memory management hardware) from modification by the user, a fully protected operating system may be
constructed.
The PC is saved in R14_svc upon entering the software interrupt trap, with the PC adjusted to point to the word
after the SWI instruction. MOVS PC,R14_svc will return to the calling program and restore the CPSR.
Note that the link mechanism is not re-entrant, so if the supervisor code wishes to use software interrupts within
itself it must first save a copy of the return address and SPSR.
COMMENT FIELD
The bottom 24 bits of the instruction are ignored by the processor, and may be used to communicate information
to the supervisor code. For instance, the supervisor may look at this field and use it to index into an array of entry
points for routines which perform the various supervisor functions.
Software interrupt instructions take 2S + 1N incremental cycles to execute, where S and N are defined as
sequential (S-cycle) and non-sequential (N-cycle).
3-49
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
ASSEMBLER SYNTAX
SWI{cond} <expression>
EXAMPLES
Supervisor code
The previous examples assume that suitable supervisor code exists, for instance:
Supervisor ; SWI has routine required in bits 8-23 and data (if any) in
; bits 0-7. Assumes R13_svc points to a suitable stack
STMFD R13,{R0-R2,R14} ; Save work registers and return address.
LDR R0,[R14,#-4] ; Get SWI instruction.
BIC R0,R0,#0xFF000000 ; Clear top 8 bits.
MOV R1,R0,LSR#8 ; Get routine offset.
ADR R2,EntryTable ; Get start address of entry table.
LDR R15,[R2,R1,LSL#2] ; Branch to appropriate routine.
WriteIRtn ; Enter with character in R0 bits 0-7.
• • •
LDMFD R13,{R0-R2,R15}^ ; Restore workspace and return,
; restoring processor mode and flags.
3-50
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction encoding is shown in Figure 3-25.
This class of instruction is used to tell a coprocessor to perform some internal operation. No result is
communicated back to ARM7TDMI, and it will not wait for the operation to complete. The coprocessor could
contain a queue of such instructions awaiting execution, and their execution can overlap other activity, allowing
the coprocessor and ARM7TDMI to perform independent tasks in parallel.
COPROCESSOR INSTRUCTIONS
The S3C44B0X, unlike some other ARM-based processors, does not have an external coprocessor interface. It
does not have a on-chip coprocessor also.
So then all coprocessor instructions will cause the undefined instruction trap to be taken on the S3C44B0X.
These coprocessor instructions can be emulated by the undefined trap handler. Even though external
coprocessor can not be connected to the S3C44B0X, the coprocessor instructions are still described here in full
for completeness. (Remember that any external coprocessor described in this section is a software emulation.)
31 28 27 24 23 20 19 16 15 12 11 8 7 5 4 3 0
Cond 1110 CP Opc CRn CRd Cp# Cp 0 CRm
Only bit 4 and bits 24 to 31 The coprocessor fields are significant to ARM7TDMI. The remaining bits are used by
coprocessors. The above field names are used by convention, and particular coprocessors may redefine the use
of all fields except CP# as appropriate. The CP# field is used to contain an identifying number (in the range 0 to
15) for each coprocessor, and a coprocessor will ignore any instruction which does not contain its number in the
CP# field.
The conventional interpretation of the instruction is that the coprocessor should perform an operation specified in
the CP Opc field (and possibly in the CP field) on the contents of CRn and CRm, and place the result in CRd.
3-51
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
Coprocessor data operations take 1S + bI incremental cycles to execute, where b is the number of cycles spent
in the coprocessor busy-wait loop.
ASSEMBLER SYNTAX
CDP{cond} p#,<expression1>,cd,cn,cm{,<expression2>}
EXAMPLES
3-52
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction encoding is shown in Figure 3-26.
This class of instruction is used to load (LDC) or store (STC) a subset of a coprocessors's registers directly to
memory. ARM7TDMI is responsible for supplying the memory address, and the coprocessor supplies or accepts
the data and controls the number of words transferred.
31 28 27 25 24 23 22 21 20 19 16 15 12 11 8 7 0
Cond 110 P U N W L Rn CRd CP# Offset
The CP# field is used to identify the coprocessor which is required to supply or accept the data, and a
coprocessor will only respond if its number matches the contents of this field.
The CRd field and the N bit contain information for the coprocessor which may be interpreted in different ways by
different coprocessors, but by convention CRd is the register to be transferred (or the first register where more
than one is to be transferred), and the N bit is used to choose one of two transfer length options. For instance
N=0 could select the transfer of a single register, and N=1 could select the transfer of all the registers for context
switching.
3-53
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
ADDRESSING MODES
ARM7TDMI is responsible for providing the address used by the memory system for the transfer, and the
addressing modes available are a subset of those used in single data transfer instructions. Note, however, that
the immediate offsets are 8 bits wide and specify word offsets for coprocessor data transfers, whereas they are
12 bits wide and specify byte offsets for single data transfers.
The 8 bit unsigned immediate offset is shifted left 2 bits and either added to (U=1) or subtracted from (U=0) the
base register (Rn); this calculation may be performed either before (P=1) or after (P=0) the base is used as the
transfer address. The modified base value may be overwritten back into the base register (if W=1), or the old
value of the base may be preserved (W=0). Note that post-indexed addressing modes require explicit setting of
the W bit, unlike LDR and STR which always write-back when post-indexed.
The value of the base register, modified by the offset in a pre-indexed instruction, is used as the address for the
transfer of the first word. The second word (if more than one is transferred) will go to or come from an address
one word (4 bytes) higher than the first transfer, and the address will be incremented by one word for each
subsequent transfer.
ADDRESS ALIGNMENT
The base address should normally be a word aligned quantity. The bottom 2 bits of the address will appear on
A[1:0] and might be interpreted by the memory system.
USE OF R15
If Rn is R15, the value used will be the address of the instruction plus 8 bytes. Base write-back to R15 must not
be specified.
DATA ABORTS
If the address is legal but the memory manager generates an abort, the data trap will be taken. The write-back of
the modified base will take place, but all other processor state will be preserved. The coprocessor is partly
responsible for ensuring that the data transfer can be restarted after the cause of the abort has been resolved,
and must ensure that any subsequent actions it undertakes can be repeated when the instruction is retried.
Coprocessor data transfer instructions take (n-1)S + 2N + bI incremental cycles to execute, where:
S, N and I are defined as sequential (S-cycle), non-sequential (N-cycle), and internal (I-cycle), respectively.
3-54
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
ASSEMBLER SYNTAX
<LDC|STC>{cond}{L} p#,cd,<Address>
NOTE
If Rn is R15, the assembler will subtract 8 from the offset value to allow for ARM7TDMI pipelining.
EXAMPLES
NOTE
Although the address offset is expressed in bytes, the instruction offset field is in words. The assembler
will adjust the offset appropriately.
3-55
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2.. The
instruction encoding is shown in Figure 3-27.
This class of instruction is used to communicate information directly between ARM7TDMI and a coprocessor. An
example of a coprocessor to ARM7TDMI register transfer (MRC) instruction would be a FIX of a floating point
value held in a coprocessor, where the floating point number is converted into a 32 bit integer within the
coprocessor, and the result is then transferred to ARM7TDMI register. A FLOAT of a 32 bit value in ARM7TDMI
register into a floating point value within the coprocessor illustrates the use of ARM7TDMI register to coprocessor
transfer (MCR).
An important use of this instruction is to communicate control information directly from the coprocessor into the
ARM7TDMI CPSR flags. As an example, the result of a comparison of two floating point values within a
coprocessor can be moved to the CPSR to control the subsequent flow of execution.
31 28 27 24 23 21 20 19 16 15 12 11 8 7 5 4 3 0
Cond 1110 CP Opc L CRn Rd CP# CP 1 CRm
The CP# field is used, as for all coprocessor instructions, to specify which coprocessor is being called upon.
The CP Opc, CRn, CP and CRm fields are used only by the coprocessor, and the interpretation presented here is
derived from convention only. Other interpretations are allowed where the coprocessor functionality is
incompatible with this one. The conventional interpretation is that the CP Opc and CP fields specify the operation
the coprocessor is required to perform, CRn is the coprocessor register which is the source or destination of the
transferred information, and CRm is a second coprocessor register which may be involved in some way which
depends on the particular operation specified.
3-56
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
TRANSFERS TO R15
When a coprocessor register transfer to ARM7TDMI has R15 as the destination, bits 31, 30, 29 and 28 of the
transferred word are copied into the N, Z, C and V flags respectively. The other bits of the transferred word are
ignored, and the PC and other CPSR bits are unaffected by the transfer.
A coprocessor register transfer from ARM7TDMI with R15 as the source register will store the PC+12.
MRC instructions take 1S + (b+1)I +1C incremental cycles to execute, where S, I and C are defined as sequential
(S-cycle), internal (I-cycle), and coprocessor register transfer (C-cycle), respectively. MCR instructions take 1S +
bI +1C incremental cycles to execute, where b is the number of cycles spent in the coprocessor busy-wait loop.
ASSEMBLER SYNTAX
<MCR|MRC>{cond} p#,<expression1>,Rd,cn,cm{,<expression2>}
EXAMPLES
3-57
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
UNDEFINED INSTRUCTION
The instruction is only executed if the condition is true. The various conditions are defined in Table 3-2. The
instruction format is shown in Figure 3-28.
31 28 27 25 24 5 4 3 0
Cond 011 xxxxxxxxxxxxxxxxxxxx 1 xxxx
Note that the undefined instruction mechanism involves offering this instruction to any coprocessors which may
be present, and all coprocessors must refuse to accept it by driving CPA and CPB HIGH.
This instruction takes 2S + 1I + 1N cycles, where S, N and I are defined as sequential (S-cycle), non-sequential
(N-cycle), and internal (I-cycle).
ASSEMBLER SYNTAX
The assembler has no mnemonics for generating this instruction. If it is adopted in the future for some specified
use, suitable mnemonics will be added to the assembler. Until such time, this instruction must not be used.
3-58
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
The following examples show ways in which the basic ARM7TDMI instructions can combine to give efficient
code. None of these methods saves a great deal of execution time (although they may save some), mostly they
just save code.
CMP Rn,#p
CMPNE Rm,#q ; If condition not satisfied try other test.
BEQ Label
Absolute Value
3-59
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
3-60
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
NOTE
Overflow checking is not applicable to unsigned and signed multiplies with a 64-bit result, since overflow
does not occur in such calculations.
It is often necessary to generate (pseudo-) random numbers and the most efficient algorithms are based on shift
generators with exclusive-OR feedback rather like a cyclic redundancy check generator. Unfortunately the
sequence of a 32 bit generator needs more than one feedback tap to be maximal length (i.e. 2^32-1 cycles
before repetition), so this example uses a 33 bit register with taps at bits 33 and 20. The basic algorithm is
newbit:=bit 33 eor bit 20, shift left the 33 bit number and put in newbit at the bottom; this operation is performed
for all the newbits needed (i.e. 32 bits). The entire operation can be done in 5 S cycles:
ADD Ra,Ra,Ra,LSL #n
RSB Ra,Ra,Ra,LSL #n
3-61
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
Multiplication by 6
This is not quite optimal, but close. An example of its non-optimality is multiply by 45 which is done by:
3-62
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
3-63
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
NOTES
3-64
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
The thumb instruction sets are 16-bit versions of ARM instruction sets (32-bit format). The ARM instructions are
reduced to 16-bit versions, Thumb instructions, at the cost of versatile functions of the ARM instruction sets. The
thumb instructions are decompressed to the ARM instructions by the Thumb decompressor inside the
ARM7TDMI core.
As the Thumb instructions are compressed ARM instructions, the Thumb instructions have the 16-bit format
instructions and have some restrictions. The restrictions by 16-bit format is fully notified for using the Thumb
instructions.
FORMAT SUMMARY
The THUMB instruction set formats are shown in the following figure.
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
3-65
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
OPCODE SUMMARY
The following table summarizes the THUMB instruction set. For further information about a particular instruction
please refer to the sections listed in the right-most column.
3-66
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
3-67
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
15 14 13 12 11 10 6 5 3 2 0
0 0 0 Op Offset5 Rs Rd
[12:11] Opcode
0 = LSL
1 = LSR
2 = ASR
OPERATION
These instructions move a shifted value between Lo registers. The THUMB assembler syntax is shown in
Table 3-8.
NOTE
All instructions in this group set the CPSR condition codes.
3-68
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
All instructions in this format have an equivalent ARM instruction as shown in Table 3-8. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-69
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
FORMAT 2: ADD/SUBTRACT
15 14 13 12 11 10 9 8 6 5 3 2 0
0 0 0 1 1 1 Op Rn/Offset3 Rs Rd
[9] Opcode
0 = ADD
1 = SUB
OPERATION
These instructions allow the contents of a Lo register or a 3-bit immediate value to be added to or subtracted
from a Lo register. The THUMB assembler syntax is shown in Table 3-9.
NOTE
All instructions in this group set the CPSR condition codes.
3-70
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
All instructions in this format have an equivalent ARM instruction as shown in Table 3-9. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-71
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
15 14 13 12 11 10 8 7 0
0 0 0 Op Rd Offset8
[12:11] Opcode
0 = MOV
1 = CMP
2 = ADD
3 = SUB
OPERATIONS
The instructions in this group perform operations between a Lo register and an 8-bit immediate value. The
THUMB assembler syntax is shown in Table 3-10.
NOTE
All instructions in this group set the CPSR condition codes.
10 ADD Rd, #Offset8 ADDS Rd, Rd, #Offset8 Add 8-bit immediate value to contents of
Rd and place the result in Rd.
11 SUB Rd, #Offset8 SUBS Rd, Rd, #Offset8 Subtract 8-bit immediate value from
contents of Rd and place the result in Rd.
3-72
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
All instructions in this format have an equivalent ARM instruction as shown in Table 3-10. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-73
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
15 14 13 12 11 10 9 6 5 3 2 0
0 0 0 0 0 0 Op Rs Rd
[9:6] Opcode
OPERATION
NOTE
All instructions in this group set the CPSR condition codes.
3-74
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
All instructions in this format have an equivalent ARM instruction as shown in Table 3-11. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-75
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
15 14 13 12 11 10 9 8 7 6 5 3 2 0
0 0 0 0 0 0 Op H1 H2 Rs/Hs Rd/Hd
[9:8] Opcode
OPERATION
There are four sets of instructions in this group. The first three allow ADD, CMP and MOV operations to be
performed between Lo and Hi registers, or a pair of Hi registers. The fourth, BX, allows a Branch to be performed
which may also be used to switch processor state. The THUMB assembler syntax is shown in Table 3-12.
NOTE
In this group only CMP (Op = 01) sets the CPSR condition codes.
The action of H1= 0, H2 = 0 for Op = 00 (ADD), Op =01 (CMP) and Op = 10 (MOV) is undefined, and should not
be used.
3-76
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
All instructions in this format have an equivalent ARM instruction as shown in Table 3-12. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
THE BX INSTRUCTION
Bit 0 of the address determines the processor state on entry to the routine:
NOTE
The action of H1 = 1 for this instruction is undefined, and should not be used.
3-77
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
EXAMPLES
Hi-Register Operations
If R15 is used as an operand, the value will be the address of the instruction + 4 with bit 0 cleared. Executing a
BX PC in THUMB state from a non-word aligned address will result in unpredictable execution.
3-78
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 8 7 0
0 0 0 0 0 Rd Word 8
OPERATION
This instruction loads a word from an address specified as a 10-bit immediate offset from the PC. The THUMB
assembler syntax is shown below.
3-79
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
All instructions in this format have an equivalent ARM instruction. The instruction cycle times for the THUMB
instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-80
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 9 8 6 5 3 2 0
0 1 0 1 L B 0 Ro Rb Rd
3-81
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
OPERATION
These instructions transfer byte or word values between registers and memory. Memory addresses are pre-
indexed using an offset register in the range 0-7. The THUMB assembler syntax is shown in Table 3-14.
All instructions in this format have an equivalent ARM instruction as shown in Table 3-14. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-82
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 9 8 6 5 3 2 0
0 1 0 1 H S 1 Ro Rb Rd
[11] H Flag
OPERATION
These instructions load optionally sign-extended bytes or halfwords, and store halfwords. The THUMB assembler
syntax is shown below.
3-83
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
All instructions in this format have an equivalent ARM instruction as shown in Table 3-15. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-84
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 6 5 3 2 0
0 1 1 B L Offset5 Rb Rd
3-85
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
OPERATION
These instructions transfer byte or word values between registers and memory using an immediate 5 or 7-bit
offset. The THUMB assembler syntax is shown in Table 3-16.
All instructions in this format have an equivalent ARM instruction as shown in Table 3-16. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-86
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 6 5 3 2 0
0 1 0 0 L Offset5 Rb Rd
OPERATION
These instructions transfer halfword values between a Lo register and memory. Addresses are pre-indexed, using
a 6-bit immediate value. The THUMB assembler syntax is shown in Table 3-17.
3-87
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
All instructions in this format have an equivalent ARM instruction as shown in Table 3-17. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
STRH R6, [R1, #56] ; Store the lower 16 bits of R4 at the address formed by
; adding 56 R1. Note that the THUMB opcode will contain
; 28 as the Offset5 value.
LDRH R4, [R7, #4] ; Load into R4 the halfword found at the address formed by
; adding 4 to R7. Note that the THUMB opcode will contain
; 2 as the Offset5 value.
3-88
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 8 7 0
1 0 0 1 L Rd Word 8
OPERATION
The instructions in this group perform an SP-relative load or store. The THUMB assembler syntax is shown in the
following table.
3-89
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
All instructions in this format have an equivalent ARM instruction as shown in Table 3-18. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-90
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 8 7 0
1 0 1 0 SP Rd Word 8
[11] Source
0 = PC
1 = SP
OPERATION
These instructions calculate an address by adding an 10-bit constant to either the PC or the SP, and load the
resulting address into a register. The THUMB assembler syntax is shown in the following table.
Where the PC is used as the source register (SP = 0), bit 1 of the PC is always read as 0. The value of the PC
will be 4 bytes greater than the address of the instruction before bit 1 is forced to 0.
3-91
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
All instructions in this format have an equivalent ARM instruction as shown in Table 3-19. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-92
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 9 8 7 6 0
1 0 1 1 0 0 0 0 S SWord 7
OPERATION
This instruction adds a 9-bit signed constant to the stack pointer. The following table shows the THUMB
assembler syntax.
All instructions in this format have an equivalent ARM instruction as shown in Table 3-20. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
ADD SP, #268 ; SP (R13) := SP + 268, but don't set the condition codes.
; Note that the THUMB opcode will
; contain 67 as the Word7 value and S=0.
ADD SP, #-104 ; SP (R13) := SP - 104, but don't set the condition codes.
; Note that the THUMB opcode will contain
; 26 as the Word7 value and S=1.
3-93
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
15 14 13 12 11 10 9 8 7 0
1 0 1 1 L 1 0 R Rlist
OPERATION
The instructions in this group allow registers 0-7 and optionally LR to be pushed onto the stack, and registers 0-7
and optionally PC to be popped off the stack. The THUMB assembler syntax is shown in Table 3-21.
NOTE
The stack is always assumed to be Full Descending.
3-94
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
All instructions in this format have an equivalent ARM instruction as shown in Table 3-21. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-95
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
15 14 13 12 11 10 8 7 0
1 1 0 0 L Rb Rlist
OPERATION
These instructions allow multiple loading and storing of Lo registers. The THUMB assembler syntax is shown in
the following table.
All instructions in this format have an equivalent ARM instruction as shown in Table 3-22. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-96
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 8 7 0
1 1 0 1 Cond SOffset 8
[11:8] Condition
OPERATION
The instructions in this group all perform a conditional Branch depending on the state of the CPSR condition
codes. The branch offset must take account of the prefetch operation, which causes the PC to be 1 word (4
bytes) ahead of the current instruction.
3-97
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
All instructions in this format have an equivalent ARM instruction as shown in Table 3-23. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-98
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 9 8 7 0
1 1 0 1 1 1 1 1 Value 8
OPERATION
The SWI instruction performs a software interrupt. On taking the SWI, the processor switches into ARM state and
enters Supervisor (SVC) mode.
All instructions in this format have an equivalent ARM instruction as shown in Table 3-24. The instruction cycle
times for the THUMB instruction are identical to that of the equivalent ARM instruction.
EXAMPLES
3-99
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
15 14 13 12 11 10 0
1 1 1 0 0 Offset11
OPERATION
This instruction performs a PC-relative Branch. The THUMB assembler syntax is shown below. The branch offset
must take account of the prefetch operation, which causes the PC to be 1 word (4 bytes) ahead of the current
instruction.
EXAMPLES
3-100
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
15 14 13 12 11 10 0
1 1 1 1 H Offset
OPERATION
The assembler splits the 23-bit two's complement half-word offset specified by the label into two 11-bit halves,
ignoring bit 0 (which must be 0), and creates two THUMB instructions.
Instruction 1 (H = 0)
In the first instruction the Offset field contains the upper 11 bits of the target address. This is shifted left by 12 bits
and added to the current PC address. The resulting address is placed in LR.
Instruction 2 (H =1)
In the second instruction the Offset field contains an 11-bit representation lower half of the target address. This is
shifted left by 1 bit and added to LR. LR, which now contains the full 23-bit address, is placed in PC, the address
of the instruction following the BL is placed in LR and bit 0 of LR is set.
The branch offset must take account of the prefetch operation, which causes the PC to be 1 word (4 bytes) ahead
of the current instruction
3-101
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
EXAMPLES
3-102
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
The following examples show ways in which the THUMB instructions may be used to generate small and efficient
code. Each example also shows the ARM equivalent so these may be compared.
The following shows code to multiply by various constants using 1, 2 or 3 Thumb instructions alongside the ARM
equivalents. For other constants it is generally better to use the built-in MUL instruction rather than using a
sequence of 4 or more instructions.
Thumb ARM
(2..5) ; (2..5)
LSL Ra, Ra, #n ; MOV Ra, Ra, LSL #n
3-103
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
This example shows a general purpose signed divide and remainder routine in both Thumb and ARM code.
Thumb code
;signed_divide ; Signed divide of R1 by R0: returns quotient in R0,
; remainder in R1
;Save signs (0 or -1 in R0 & R2) for later use in determining ; sign of quotient & remainder.
PUSH {R0, R2}
;Justification, shift 1 bit at a time until divisor (R0 value) ; is just <= than dividend (R1 value). To do this shift
dividend ; right by 1 and stop as soon as shifted value becomes >.
LSR R0, R1, #1
MOV R2, R3
B %FT0
just_l LSL R2, #1
0 CMP R2, R0
BLS just_l
MOV R0, #0 ; Set accumulator to 0
B %FT0 ; Branch into division loop
3-104
S3C44B0X RISC MICROPROCESSOR ARM INSTRUCTION SET
Now fix up the signs of the quotient (R0) and remainder (R1)
POP {R2, R3} ; Get dividend/divisor signs back
EOR R3, R2 ; Result sign
EOR R0, R3 ; Negate if result sign = - 1
SUB R0, R3
EOR R1, R2 ; Negate remainder if dividend sign = - 1
SUB R1, R2
MOV pc, lr
ARM Code
signed_divide ; Effectively zero a4 as top bit will be shifted out later
ANDS a4, a1, #&80000000
RSBMI a1, a1, #0
EORS ip, a4, a2, ASR #32
;ip bit 31 = sign of result
;ip bit 30 = sign of a2
RSBCS a2, a2, #0
;Central part is identical code to udiv (without MOV a4, #0 which comes for free as part of signed entry sequence)
MOVS a3, a1
BEQ divide_by_zero
div_l
CMP a2, a3
ADC a4, a4, a4
SUBCS a2, a2, a3
TEQ a3, a1
MOVNE a3, a3, LSR #1
BNE s_loop2
MOV a1, a4
MOVS ip, ip, ASL #1
RSBCS a1, a1, #0
RSBMI a2, a2, #0
MOV pc, lr
3-105
ARM INSTRUCTION SET S3C44B0X RISC MICROPROCESSOR
DIVISION BY A CONSTANT
Division by a constant can often be performed by a short fixed sequence of shifts, adds and subtracts.
Here is an example of a divide by 10 routine based on the algorithm in the ARM Cookbook in both Thumb and
ARM code.
Thumb Code
udiv10 ; Take argument in a1 returns quotient in a1,
; remainder in a2
MOV a2, a1
LSR a3, a1, #2
SUB a1, a3
LSR a3, a1, #4
ADD a1, a3
LSR a3, a1, #8
ADD a1, a3
LSR a3, a1, #16
ADD a1, a3
LSR a1, #3
ASL a3, a1, #2
ADD a3, a1
ASL a3, #1
SUB a2, a3
CMP a2, #10
BLT %FT0
ADD a1, #1
SUB a2, #10
0
MOV pc, lr
ARM Code
udiv10 ; Take argument in a1 returns quotient in a1,
; remainder in a2
SUB a2, a1, #10
SUB a1, a1, a1, lsr #2
ADD a1, a1, a1, lsr #4
ADD a1, a1, a1, lsr #8
ADD a1, a1, a1, lsr #16
MOV a1, a1, lsr #3
ADD a3, a1, a1, asl #2
SUBS a2, a2, a3, asl #1
ADDPL a1, a1, #1
ADDMI a2, a2, #10
MOV pc, lr
3-106
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
4 MEMORY CONTROLLER
OVERVIEW
The S3C44B0X memory controller provides the necessary memory control signals for external memory access.
S3C44B0X has the following features;
4-1
MEMORY CONTROLLER S3C44B0X RISC MICROPROCESSOR
0x1000_0000
SROM/DRAM/SDRAM
2/4/8/16/32MB
(nGCS7)
Refer to
0x0e00_0000
Table 4-1
SROM/DRAM/SDRAM
2/4/8/16/32MB
(nGCS6)
0x0c00_0000
SROM
32MB
(nGCS5)
0x0a00_0000
SROM
32MB
(nGCS4)
0x0800_0000 256MB SA[27:0]
SROM Accessable Region
32MB
(nGCS3)
0x0600_0000
SROM
32MB
(nGCS2)
0x0400_0000
SROM
32MB
(nGCS1)
0x0200_0000 Special function
Registers (4M bytes)
0x01c0_0000
SROM
28MB
(nGCS0)
0x0000_0000
4-2
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
FUNCTION DESCRIPTION
While nRESET is L, the ENDIAN pin defines which endian mode should be selected. If the ENDIAN pin is connected
to Vss with a pull-down resistor, the little endian mode is selected. If the pin is connected to Vdd with a pull-up
resistor, the big endian mode is selected.
The data bus width of BANK0 (nGCS0) should be configured as one of 8-bit,16-bit and 32-bit. Because the BANK0 is
the booting ROM bank(map to 0x0000_0000), the bus width of BANK0 should be determined before the first ROM
access, which will be determined by the logic level of OM[1:0] at Reset.
OM1 (Operating Mode 1) OM0 (Operating Mode 0) Booting ROM Data width
0 0 8-bit
0 1 16-bit
1 0 32-bit
1 1 Test Mode
4-3
MEMORY CONTROLLER S3C44B0X RISC MICROPROCESSOR
4-4
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
Bank Size Bus Width Base Component Memory Configuration Bank Address
2MByte x8 16Mbit (1M x 8 x 2Bank) x 1 A20
x16 (512K x 16 x 2B) x 1
4MB x8 16Mb (2M x 4 x 2B) x 2 A21
x16 (1M x 8 x 2B) x 2
x32 (512K x 16 x 2B) x 2
8MB x16 16Mb (2M x 4 x 2B) x 4 A22
x32 (1M x 8x 2B) x 4
x8 64Mb (4M x 8 x 2B) x 1
x8 (2M x 8 x 4B) x 1 A[22:21]
x16 (2M x 16 x 2B) x 1 A22
x16 (1M x 16 x 4B) x 1 A[22:21]
x32 (512K x 32 x 4B) x 1
16MB x32 16Mb (2M x 4 x 2B) x 8 A23
x8 64Mb (8M x 4 x 2B) x 2
x8 (4M x 4 x 4B) x 2 A[23:22]
x16 (4M x 8 x 2B) x 2 A23
x16 (2M x 8 x 4B) x 2 A[23:22]
x32 (2M x 16 x 2B) x 2 A23
x32 (1M x 16 x 4B) x 2 A[23:22]
x8 128Mb (4M x 8 x 4B) x 1
x16 (2M x 16 x 4B) x 1
32MB x16 64Mb (8M x 4 x 2B) x 4 A24
x16 (4M x 4 x 4B) x 4 A[24:23]
x32 (4M x 8 x 2B) x 4 A24
x32 (2M x 8 x 4B) x 4 A[24:23]
x16 128Mb (4M x 8 x 4B) x 2
x32 (2M x 16 x 4B) x 2
x8 256Mb (8M x 8 x 4B) x 1
x16 (4M x 16 x 4B) x 1
4-5
MEMORY CONTROLLER S3C44B0X RISC MICROPROCESSOR
A0 A0 DQ0 D0
A1 A1 DQ1 D1
A2 A2 DQ2 D2
A3 A3 DQ3 D3
A4 A4 DQ4 D4
A5 A5 DQ5 D5
A6 A6 DQ6 D6
A7 A7 DQ7 D7
A8 A8
A9 A9 nWE nWE
A10 A10 nOE nOE
A11 A11 nCE nGCSn
A12 A12
A13 A13
A14 A14
A15 A15
A1 A0 DQ0 D0 A1 A0 DQ0 D8
A2 A1 DQ1 D1 A2 A1 DQ1 D9
A3 A2 DQ2 D2 A3 A2 DQ2 D10
A4 A3 DQ3 D3 A4 A3 DQ3 D11
A5 A4 DQ4 D4 A5 A4 DQ4 D12
A6 A5 DQ5 D5 A6 A5 DQ5 D13
A7 A6 DQ6 D6 A7 A6 DQ6 D14
A8 A7 DQ7 D7 A8 A7 DQ7 D15
A9 A8 A9 A8
A10 A9 nWE nWBE0 A10 A9 nWE nWBE1
A11 A10 nOE nOE A11 A10 nOE nOE
A12 A11 nCE nGCSn A12 A11 nCE nGCSn
A13 A12 A13 A12
A14 A13 A14 A13
A15 A14 A15 A14
A16 A15 A16 A15
4-6
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
DQ0 D0
A1 A0
DQ1 D1
A2 A1
DQ2 D2
A3 A2
DQ3 D3
A4 A3
DQ4 D4
A5 A4
DQ5 D5
A6 A5
DQ6 D6
A7 A6
DQ7 D7
A8 A7
DQ8 D8
A9 A8
DQ9 D9
A10 A9
DQ10 D10
A11 A10
DQ11 D11
A12 A11
DQ12 D12
A13 A12
DQ13 D13
A14 A13
DQ14 D14
A15 A14
DQ15 D15
A16 A15
A17 A16
nWE nWE
A18 A17
nOE nOE
A19 A18
nCE nGCSn
4-7
MEMORY CONTROLLER S3C44B0X RISC MICROPROCESSOR
A1 A0 DQ0 D0
A2 A1 DQ1 D1
A3 A2 DQ2 D2
A4 A3 DQ3 D3
A5 A4 DQ4 D4
A6 A5 DQ5 D5
A7 A6 DQ6 D6
A8 A7 DQ7 D7
A9 A8 DQ8 D8
A10 A9 DQ9 D9
A11 A10 DQ10 D10
A12 A11 DQ11 D11
A13 A12 DQ12 D12
A14 A13 DQ13 D13
A15 A14 DQ14 D14
A16 A15 DQ15 D15
nWE nWE
nOE nOE
nCS nGCSn
nUB nBE1
nLB nBE0
4-8
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
4-9
MEMORY CONTROLLER S3C44B0X RISC MICROPROCESSOR
A1 A0 DQ0 D0
A2 A1 DQ1 D1
A3 A2 DQ2 D2
A4 A3 DQ3 D3
A5 A4 DQ4 D4
A6 A5 DQ5 D5
A7 A6 DQ6 D6
A8 A7 DQ7 D7
A9 A8 DQ8 D8
A10 A9 DQ9 D9
A11 A10 DQ10 D10
A12 A11 DQ11 D11
DQ12 D12
nRAS0 nRAS DQ13 D13
nCAS0 nLCAS DQ14 D14
nCAS1 nUCAS DQ15 D15
nWE nWE
nOE
4-10
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
A1 A0 DQ0 D0
A2 A1 DQ1 D1
A3 A2 DQ2 D2
A4 A3 DQ3 D3
A5 A4 DQ4 D4
A6 A5 DQ5 D5
A7 A6 DQ6 D6
A8 A7 DQ7 D7
A9 A8 DQ8 D8
A10 A9 DQ9 D9
A11 A10 DQ10 D10
A12 A11 DQ11 D11
DQ12 D12
A21 BA0 DQ13 D13
A22 BA1 DQ14 D14
DQM0 LDQM DQ15 D15
DQM1 UDQM
nSCS nSCS0
SCKE SCKE nSRAS nSRAS
SCLK SCLK nSCAS nSCAS
nWE nWE
A2 A0 DQ0 D0 A2 A0 DQ0 D0
A3 A1 DQ1 D1 A3 A1 DQ1 D1
A4 A2 DQ2 D2 A4 A2 DQ2 D2
A5 A3 DQ3 D3 A5 A3 DQ3 D3
A6 A4 DQ4 D4 A6 A4 DQ4 D4
A7 A5 DQ5 D5 A7 A5 DQ5 D5
A8 A6 DQ6 D6 A8 A6 DQ6 D6
A9 A7 DQ7 D7 A9 A7 DQ7 D7
A10 A8 DQ8 D8 A10 A8 DQ8 D8
A11 A9 DQ9 D9 A11 A9 DQ9 D9
A12 A10 DQ10 D10 A12 A10 DQ10 D10
A13 A11 DQ11 D11 A13 A11 DQ11 D11
DQ12 D12 DQ12 D12
A22 BA0 DQ13 D13 A22 BA0 DQ13 D13
A23 BA1 DQ14 D14 A23 BA1 DQ14 D14
DQM0 LDQM DQ15 D15 DQM2 LDQM DQ15 D15
DQM1 UDQM DQM3 UDQM
nSCS nSCS0 nSCS nSCS0
SCKE SCKE nSRAS nSRAS SCKE SCKE nSRAS nSRAS
SCLK SCLK nSCAS nSCAS SCLK SCLK nSCAS nSCAS
nWE nWE nWE nWE
Figure 4-11. Memory Interface with 16bit SDRAM (4Mx16 * 2ea, 4bank)
NOTE: Please refer to Table 4-2 the Bank Address configurations of SDRAM.
4-11
MEMORY CONTROLLER S3C44B0X RISC MICROPROCESSOR
4-12
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
NOTES:
1. All types of master clock in this memory controller correspond to the bus clock.
For example, MCLK in DRAM and SRAM is same as the bus clock, and SCLK in SDRAM is also the same as the bus
clock. In this chapter (Memory Controller), one clock means one bus clock.
2. nBE[3:0] is the 'AND' signal nWBE[3:0] and nOE
4-13
MEMORY CONTROLLER S3C44B0X RISC MICROPROCESSOR
4-14
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
4-15
MEMORY CONTROLLER S3C44B0X RISC MICROPROCESSOR
4-16
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
4-17
MEMORY CONTROLLER S3C44B0X RISC MICROPROCESSOR
BANKSIZE REGISTER
NOTE: MRSR register must not be reconfigured while the code is running on SDRAM.
IMPORTANT NOTES
1. All 13 memory control registers have to be written using the STMIA instruction.
2. In STOP mode/SL_IDLE mode, DRAM/SDRAM has to enter the DRAM/SDRAM self-refresh mode.
4-18
S3C44B0X RISC MICROPROCESSOR MEMORY CONTROLLER
NOTES
4-19
S3C44B0X RISC MICROPROCESSOR CLOCK & POWER MANAGEMENT
OVERVIEW
The Clock Generator in S3C44B0X can generate the required clock signals for the CPU as well as peripherals.
The Clock Generator can be controlled to supply or disconnect the clock to each peripheral block by S/W, which
will reduce the power. As well as this kind of S/W controllability, S3C44B0X has various power management
schemes to keep optimal power consumption for a given task.
The power management in S3C44B0X consists of five modes : Normal mode, Slow mode, Idle mode, Stop mode
and SL Idle mode for LCD. The Normal mode is used to supply clocks to CPU as well as all peripherals in
S3C44B0X. In this case, the power consumption will be maximized when all peripherals are turned on. The user
can control the operation of peripherals by S/W. For example, if a timer and DMA are not needed, the user can
disconnect the clock to the timer and DMA to reduce power. The Slow mode is non-PLL mode. Unlike the Normal
mode, the Slow mode uses an external clock directly as master clock in S3C44B0X without PLL. In this case, the
power consumption depends on the frequency of the external clock only. The power consumption due to PLL itself
is excluded. The Idle mode disconnects the clock only to CPU core while it supplies the clock to all peripherals. By
using this Idle mode, power consumption due to CPU core can be reduced. Any interrupt request to CPU can
wake-up from Idle mode. The Stop mode freezes all clocks to the CPU as well as peripherals by disabling PLL.
The power consumption is only due to the leakage current in S3C44B0X, which is less than 10 uA. The wake-up
from Stop mode can be done by external interrupt to CPU. The SL Idle mode causes the LCD controller to work. In
this case, the clock to CPU and all peripherals except LCD controller should be stopped, therefore, the power
consumption in the SL Idle mode is less than that in the Idle mode.
5-1
CLOCK & POWER MANAGEMENT S3C44B0X RISC MICROPROCESSOR
FUNCTION DESCRIPTION
CLOCK GENERATION
Figure 5-1 shows a block diagram of the clock generator. The main clock source comes from an external crystal or
external clock. The clock generator has an oscillator(Oscillation Amplifier) which should be connected to an
external crystal, and also has a PLL (Phase-Locked-Loop) which takes the low frequency oscillator output as its
input and generates the high frequency clock required by S3C44B0X. The clock generator block has the logic to
generate a stable clock frequency after a reset or a stop mode.
PWRDN MUX
MUX Fpllo
XTAL0 00
OSC CLKout
EXTAL0 Fin
PLL MUX (External)
01 CLOCK 00,01
EXTCLK CONTROL
Port E control
LOGIC
MUX5 Fout
for Timer5 Test Mode (MCLK)
only(10, 11)
powerdown
OM[3:2]
Table 5-1 shows the relationship between the combination of mode control pins (OM3 and OM2) and the selection
of source clock for S3C44B0X. The OM[3:2] status is latched internally by referring the OM3 and OM2 pins at the
rising edge of nRESET.
If the S3C44B0X operates by PLL output from XTAL0 & EXTAL0, the EXTCLK can be dedicated as TCLK for
Timer 5.
5-2
S3C44B0X RISC MICROPROCESSOR CLOCK & POWER MANAGEMENT
PLL (PHASE-LOCKED-LOOP)
The PLL within the clock generator is the circuit which synchronizes an output signal with a reference input signal
in frequency and phase. In this application, it includes the following basic blocks (Figure 5-2 shows the clock
generator block diagram); the VCO(Voltage Controlled Oscillator) to generate the output frequency proportional to
input DC voltage, the divider P to divide the input frequency(Fin) by p, the divider M to divide the VCO output
frequency by m which is input to PFD(Phase Frequency Detector), the divider S to divide the VCO output
frequency by s which is Fpllo(the output frequency from PLL block), the phase difference detector, charge pump,
and loop filter. The output clock frequency Fpllo is related to the reference input clock frequency Fin by the
following equation:
s
Fpllo = (m * Fin) / (p * 2 )
m = M (the value for divider M)+ 8, p = P(the value for divider P) + 2
The following sections describe the operation of the PLL, that includes the phase difference detector, charge
pump, VCO (Voltage controlled oscillator), and loop filter. If the PLL is on, Fpllo is same as Fout as shown in
Figure 5-1.
Loop Filter
The control signal that the PFD generates for the charge pump, may generate large excursions(ripples) each time
the Fvco output is compared to the Fref. To avoid overloading the VCO, a low pass filter samples and filters the
high-frequency components out of the control signal. The filter is typically a single-pole RC filter consisting of a
resistor and capacitor.
A recommended capacitance in the external loop filter(Capacitance as shown in Figure 5-2) is 700pF.
5-3
CLOCK & POWER MANAGEMENT S3C44B0X RISC MICROPROCESSOR
PWRDN
Fvco 700pF
Divider
VCO
M
M[7:0] Internal External
Divider
S Fpllo
S[1:0]
VDD
or External
External EXTCLK EXTCLK
OSC
Clock for
Timer5
VDD
XTAL0 XTAL0
EXTAL0 EXTAL0
1Mohm
5-4
S3C44B0X RISC MICROPROCESSOR CLOCK & POWER MANAGEMENT
The clock control logic determines the clock source to be used, i.e., the PLL clock or the direct OSC clock. When
PLL is configured to a new frequency value, the clock control logic disables the FOUT until the PLL output is
stabilized using the PLL locking time. The clock control logic is also activated at power-on reset and wake-up from
power-down mode.
t_lock(the PLL lock time by H/W logic) = (1/ Fin) x n, (n = LTIMECNT value)
Power-On Reset
Figure 5-4 shows the clock behavior during the power-on reset sequence. The crystal oscillator begins oscillation
within several milliseconds. When nRESET is released after the stabilization of OSC clock, the PLL starts to
operate according to the default PLL configuration. However PLL is commonly known to be unstable after power-
on reset, so Fin fed directly to Fout instead of the Fpllo(PLL output) before the S/W newly configures the PLLCON.
Even if the user wants to use the default value of PLLCON register after Reset, the user should write the same
value into PLLCON register by S/W.
The PLL begins the lockup sequence again toward the new frequency only after the S/W configures the PLL with a
new frequency. Fout can be configured to be PLL output(Fpllo) immediately after lock time.
Power
nRESET
OSC
Fout
5-5
CLOCK & POWER MANAGEMENT S3C44B0X RISC MICROPROCESSOR
PLL_CLK
PMS setting
PLL Lock-time
FOUT
Figure 5-5. The Case that Changes Slow Clock by Setting PMS Value
5-6
S3C44B0X RISC MICROPROCESSOR CLOCK & POWER MANAGEMENT
POWER MANAGEMENT
The power management block controls the system clocks by software for reduction of power consumption in
S3C44B0X. These schemes are related to PLL, clock control logic, peripheral clock control, and wake-up signal.
S3C44B0X has five power-down modes. The following section describes each power managing mode. The
transition between the modes is not allowed freely. For available transitions among the modes, please refer to
Figure 5-11.
Normal Mode
In normal mode, all peripherals(UART, DMA, Timer, and so on) and the basic blocks(CPU core, bus controller,
memory controller, interrupt controller, and power management block) may operate fully. But, the clock to each
peripheral, except the basic blocks, can be stopped selectively by S/W to reduce power consumption.
NOTE: The basic blocks consist of the CPU core, bus controller, memory controller, interrupt controller,
and power management.
IDLE Mode
In IDLE mode, the clock to CPU core is stopped except bus controller, memory controller, interrupt controller, and
power management block. To exit IDLE mode, EINT[7:0], or RTC alarm interrupt, or the other interrupts should be
activated. (If users are willing to use EINT[7:0], GPIO block has to be turned on before the activation).
STOP Mode
In STOP mode, all clocks are stopped for minimum power consumption. Therefore, the PLL and oscillator circuit
are also stopped. Just after exiting the STOP mode, only THAW mode is available. In other words, the user cannot
return to NORMAL mode from STOP mode as shown in Fig. 5-11, directly. To exit from STOP mode, EINT[7:0] or
RTC alarm interrupt has to be activated.
Just after entering into the STOP mode, the Clock Control Logic output the Fin-clock, instead of the Fpllo-clock,
from Fout during 16 Fin-clocks. After 16 Fin-clocks, the Fout is stopped and S3C44B0X enters into STOP mode
completely. The latency time from command issue of the power down by STOP mode to actual entrance into
power down mode is calculated as follows:
Power down latency time = Input clock period (crystal oscillator clock or external clock) * 16
If S3C44B0X is in the SLOW mode, the S3C44B0X enters into STOP mode immediately because the frequency of
the clock in slow mode is lower than Fin.
The S3C44B0X can exit from STOP mode by external interrupts or RTC alarm interrupt. During the wake-up
sequences, the crystal oscillator and PLL may begin to operate. The lock time is also needed to stabilize Fout. The
lock time is inserted automatically and guaranteed by power management logic. During this lock time the clock is
not supplied. Just after wake-up sequences wake-up interrupt(alarm or external interrupt) is requested.
5-7
CLOCK & POWER MANAGEMENT S3C44B0X RISC MICROPROCESSOR
Fin
(X-tal)
Wake-up
Clock
Disable
lock time
VCO
Output
16 OSC clocks
Fout
Figure 5-6. Entering STOP Mode and Exiting STOP Mode (Wake-up)
IMPORTANT NOTES
1) DRAM has to be in self-refresh mode during STOP mode to retain valid memory data.
2) LCD display must be stopped before entering STOP mode because DRAM is in self-refresh mode
and LCD can't access DRAM during DRAM self-refresh mode. If LCD display is turned on,
SYSTEM will be hanged up.
3) The ports of S3C44B0X must be configured properly according to your system to reduce power
consumption.
4) Before entering STOP mode the CPU must be in SLOW mode with PLL on. The PLL will be
turned off automatically in STOP mode.
5) For the period of entering into STOP mode, if there is any wake-up request at last 3rd clock edge
before the CPU goes into STOP mode, S3C44B0X will never respond to that wake-up source. For
example, if EIN0 is asserted at that point, the EINT0 cannot wake up the system anymore, however
other sources can wake up the system and then the EINT0 can be used for wake-up source in the
next time. So, it is strongly recommended that any wake-up signals should not be asserted until
entering into STOP mode completely. If your application cannot prevent wake-up request at that
clock, please refer to the workaround document, which is located on our web sight.
5-8
S3C44B0X RISC MICROPROCESSOR CLOCK & POWER MANAGEMENT
FOUT
6) When S3C44B0X enters STOP mode, MCLK should be more than 2.5 times of Fin (X-tal frequency).
After wake-up (in NORMAL mode), user can change MCLK to the frequency that user want.
For example, if Fin is 20MHz and a user want MCLK=36MHz, the MCLK before entering into STOP
mode should be more than 50MHz. After wake-up and S3C44B0X returns to NORMAL mode from
STOP mode, MCLK can be changed from 50MHz to 36MHz by setting PLLCON register.
7) When S3C44B0X enters STOP mode in the level triggered EINT mode, the level EINT wake-up
should not be active. If the level EINT wake-up is active, S3C44B0X should skip entering into STOP
mode.
To exit SL_IDLE mode, EINT[7:0] or RTC alarm interrupt has to be activated. In this case, the processor mode will
change into Slow Mode automatically as shown in Fig. 5-11. To return to Normal mode, users have to wait until the
end of lock time, then disable the SLOW mode and clear the SL_IDLE bit. In the PLL lock time, the SLOW clock is
supplied. DRAM has to be in self-refresh mode during SL_IDLE mode to retain the valid data in DRAM.
FOUT
Devided OSC It changes to PLL clock after
clock slow mode is disabled
Figure 5-7. Entering SL_IDLE Mode and Exiting SL_IDLE Mode (Wake-up)
5-9
CLOCK & POWER MANAGEMENT S3C44B0X RISC MICROPROCESSOR
In SLOW mode, the PLL will be turned off to reduce the PLL power consumption. When PLL is turned off in SLOW
mode and users change power mode from SLOW mode to NORMAL mode, the PLL needs clock stabilization
time(PLL lock time). This PLL stabilization time is automatically inserted by the internal logic with lock time count
register. The PLL stability time will take 400us after PLL is turn on. During PLL lock time, the Fout is SLOW clock.
Users can change the frequency by enabling SLOW mode bit in CLKSLOW register in PLL on state. The SLOW
clock is generated during SLOW mode. The timing diagram is as follow.
PLL_CLK
PLL off
FOUT
Figure 5-8. The Case that Exit_from_Slow_Mode Command is Issued in PLL on State
If users exit from SLOW mode to Normal mode by disabling the SLOW mode bit in the CLKSLOW register after
PLL lock time, the frequency is changed just after SLOW mode is disabled. The timing diagram is as follow.
PLL_CLK
FOUT
Figure 5-9. The Case that Exit_from_Slow_Mode Command is Issued after Lock Time is End
5-10
S3C44B0X RISC MICROPROCESSOR CLOCK & POWER MANAGEMENT
If users exit from SLOW mode to Normal mode by disabling SLOW mode bit and PLL off bit simultaneously in
CLKSLOW register, the frequency is changed just after the PLL lock time. The timing diagram is as follow.
PLL_CLK
FOUT
After the wake-up from STOP mode, the processor is in THAW mode as explained above. The new value, which
reflects the new state, has to be re-written into the CLKCON register. Eventually, the processor state will be
changed from THAW state to Normal or SLOW or even STOP mode.
Just after writing the valid configuration value into the CLKCON, the mode returns to normal mode, slow mode, or
even STOP mode.
a) Level signal(H or L) or edge signal(rising or falling or both) is asserted on EINTn input pin.
b) EINTn pin has to be configured as EINT in PCONG register.
It is important to configure the EINTn in the PCONG register as an external interrupt pins. For wake-up, we need
H/L level or rising/falling edge or both edge signals on EINTn pin.
Just after wake-up the corresponding EINTn pin will not be used for wake-up. This means that these pins can be
5-11
CLOCK & POWER MANAGEMENT S3C44B0X RISC MICROPROCESSOR
PLL On/Off
The PLL can only be turned off for power saving in slow mode. If PLL is turned off in any other mode, MCU
operation is not guaranteed.
When the processor is in SLOW mode and tries to change its state into other state requiring that PLL be turned
on, then SLOW_BIT should be clear to move to another state after PLL stabilization.
But, because of the characteristics of I/O pad, the data bus pull-up resistors have to be turned on to reduce the
power consumption in STOP/SL_IDLE mode. D[31:16] pin pull-up resistors can be controlled by PUPC and PUPD
registers. D[15:0] pin pull-up resistors can be controlled by the PUPS register.
The output ports are recommended to be in H state to reduce STOP mode current consumption.
5-12
S3C44B0X RISC MICROPROCESSOR CLOCK & POWER MANAGEMENT
SL_IDLE_BIT=1
SL_IDLE
EINT[7:0] ,RTC alarm
IDLE_BIT=1
IDLE
Interrupts, EINT[7:0], RTC alarm
NORMAL
(SLOW_BIT=0) IDLE_BIT=0, STOP_BIT=0
& SLOW_BIT=0
THAW
state
SLOW
(SLOW_BIT=1)
EINT[7:0]
STOP_BIT=1
RTC alarm
PLL_OFF=0
& SLOW_BIT=1
SLOW STOP_BIT=1
(PLL on) STOP
5-13
CLOCK & POWER MANAGEMENT S3C44B0X RISC MICROPROCESSOR
NOTE: Fpllo must be greater than 20Mhz and less than 66Mhz.
Example
If Fin=14.318Mhz and Fout=60Mhz, the calculated value is as follows;
MDIV=59, PDIV=6 and SDIV=1 (This value may be calculated using PLLSET.EXE utility, provided by SAMSUNG. )
5-14
S3C44B0X RISC MICROPROCESSOR CLOCK & POWER MANAGEMENT
5-15
CLOCK & POWER MANAGEMENT S3C44B0X RISC MICROPROCESSOR
5-16
S3C44B0X RISC MICROPROCESSOR CLOCK & POWER MANAGEMENT
NOTES
5-17
S3C44B0X RISC MICROPROCESSOR CPU WRAPPER & BUS PRIORITIES
OVERVIEW
The CPU wrapper consists of a cache, write buffer, and CPU core. The bus arbitration logic determines the priority of
each bus master.
The CPU wrapper has an 8-Kbyte internal memory. The internal memory can be used in three ways. First the 8-
Kbyte memory can be used as an 8KB unified (instruction/data) cache. Second, the internal memory can be used as
a 4-Kbyte unified cache and a 4-Kbyte internal SRAM. Third, the internal memory can be used wholly as an 8-Kbyte
internal SRAM.
The internal unified (instruction/data) cache adopts four-way set associative architecture with a four-word (16 bytes)
line size. It has a write-through policy to keep data coherency. When a cache miss occurs, four words of memory
are fetched sequentially from external memory. It has an LRU (Least Recently Used) algorithm to raise the hit ratio.
The unified cache deals with instruction and data by distinguishing them.
The internal SRAM mainly will be used to reduce ISR(interrupt service routine) execution time. ISR execution time
will be reduced because the internal SRAM has the fastest access time. Also, the ISR in SRAM is very efficient
because most ISR codes may cause cache-miss.
The bus arbitration logic can determine the priorities of bus masters. The bus arbitration logic supports a round-robin
priority mode and a fixed priority mode. Also, The priorities among LCD_DMA, BDMA, ZDMA, nBREQ (external bus
masters) can be changed by S/W.
6-1
6-2
31 28 27 11 10 4 3 2 1 0
17 17 17 17
Height = 128
Seg3 Tag Seg2 Tag Seg1 Tag Seg0 Tag
CPU WRAPPER & BUS PRIORITIES
7
LRU Decoder
17 17 17 17
Instr3 Instr2 Instr1 Instr0 Instr3 Instr2 Instr1 Instr0 Instr3 Instr2 Instr1 Instr0 Instr3 Instr2 Instr1 Instr0
Select 7
Set
32
S3C44B0X RISC MICROPROCESSOR
S3C44B0X RISC MICROPROCESSOR CPU WRAPPER & BUS PRIORITIES
CACHE OPERATION
Cache Organization
S3C44B0X cache has an 8KB (or 4KB) cache memory, four Tag RAMs and one LRU memory. The internal unified
(instructions/data) cache adopts a four-way set associative architecture with 4-word (16 bytes) line size. It has a
write-through policy to keep data coherency. It has an LRU (Least Recently Used) algorithm to raise the hit ratio.
The value of CS "1xxx" represents that all of the sets are valid. Then the next cache miss occurs, the least
significant 3 bits of CS select set are replaced. First bit selects a group of sets. "0" selects group 0 (which contains
set0 and set1 ) , otherwise group1 (which contains set2 and set3 ). Second bit selects the set of group 0 . "0"
selects set0, otherwise set1. Third bit selects the set of group 1. "0" selects set2, otherwise set 3. For example, if
LS 3bit is 000, the victim is set0. If LS 3bit is "101", the victim is set3.
No
All 4 Lines in the set valid
Yes
Replace Invalid Line
S0 = 0?
L0 or L1 least L2 or L3 least
resently used resently used
Yes No Yes No
S1 = 0? S2 = 0?
6-3
CPU WRAPPER & BUS PRIORITIES S3C44B0X RISC MICROPROCESSOR
Data coherency is important when the cache memory is re-enabled because the cache memory does not have auto
flush mode. You also have to be cautious whether or not DMA changes memory data. The DMA accessible memory
area should be non-cacheable to keep data coherency. To keep data coherency between cache and external
memory, S3C44B0X uses the write-through method.
Cache Flushing
A cache flushing can re-enable the cache operation. When the cache is disabled, the LRU RAM can be manipulated
exactly like normal memory. The cache can be flushed by writing 0 to the LRU RAM and making all cache data
invalid. The memory location of the LRU memory is as follows:
NOTE
Cache flushing must be executed only in the cache disable mode.
Non-Cacheable Area
The S3C44B0X provides two non-cacheable areas. Each of them requires two cache control fields, which indicate the
start and end address of each non-cacheable area. In a non-cacheable area, the cache is not updated when cache
misses a read.
Usually a cache stores any data in the whole system memory area, but sometimes it needs a non-cacheable area
because the cache cannot keep track of the external memory device whose contents are changed without read/write
operation.
The size of a non-cacheable area can be increased/decreased by 4KB units. The end address has to point the next
4KB block. For example, if non-cacheable area is 0x10000~0x22fff, the start address value of NCACHBEn is 0x10
and the end address value of NCACHBEn is 0x23.
6-4
S3C44B0X RISC MICROPROCESSOR CPU WRAPPER & BUS PRIORITIES
S3C44B0X has a maximum 8 KB 4way set associative cache or internal SRAM. If the internal SRAM is 4 KB, the
other 4KB internal memory can be used as a 2 way set associative cache. The memory access cycle of the internal
SRAM is 1 MCLK cycle.
Addresses in a set memory is increased sequentially and addresses in TAG/LRU increases of 16byte.
Don't access the interval addresses between 0x10003004 and 0x1000300f .
NOTE: The cache tag3:0 & LRU must be read/written by word access (32bit). The address bit[3:0] of .tag & LRU must be 0.
For example, if you want to read the 2nd item among 128 cache tag 0 items, you should not read the address
0x10002004, but 0x10002010. Therefore, the tag0 addresses are 0x10002000, 0x10002010, 0x10002020,...,
0x100027f0.
0x1000_0000 0x1000_2000
Valid data
0x1000_0010 0x1000_2010 1 word
Valid data (valid)
0x1000_0020 0x1000_2020
. 3 word
. Set 0 (invalid) Tag0 Size
.
. (2KB) . (512B) 2KB
.
Valid data Valid data 4 word
0x1000_07f0 0x1000_27f0
Valid data
0x1000_0800 0x1000_2800
6-5
CPU WRAPPER & BUS PRIORITIES S3C44B0X RISC MICROPROCESSOR
WRITE-BUFFER OPERATION
The write buffer block will write the data when the system bus is not occupied by higher priority bus masters. Also,
CPU performance will be enhanced because the CPU does not have to wait the completion of the write operation.
The write buffer has 4 registers. Each register includes a 32-bit data field, a 28-bit address field, and a 2-bit status
field.
27 0 31 0
[1:0] MAS
00 = 8-bit data mode
01 = 16-bit data mode
10 = 32-bit data mode
11 = Not used
[27:0] Address
Indicates the address of write data
6-6
S3C44B0X RISC MICROPROCESSOR CPU WRAPPER & BUS PRIORITIES
In S3C44B0X, there are seven bus masters, LCD_DMA, BDMA0, BDMA1, ZDMA0, ZDMA1, nBREQ (external bus
masters), and CPU wrapper. The priorities among these bus masters after a reset are as follows;
The round-robin priority mode or fixed priority mode can be selected. In the round-robin priority mode, the bus master
which had once served will have the lowest priority. In this way, all the bus masters have equal priorities.
In the fixed priority mode, each bus master's priority is written onto SBUSCON. SBUSCON determines which is 1st -
4th priority bus master.
6-7
CPU WRAPPER & BUS PRIORITIES S3C44B0X RISC MICROPROCESSOR
There are 3 control registers for the CPU wrapper block (cache, write buffer, and ARM7TDMI). SYSCFG register
controls the general system operation. NCACHBE0 & NCACHBE1 registers provide non-cacheable areas.
6-8
S3C44B0X RISC MICROPROCESSOR CPU WRAPPER & BUS PRIORITIES
6-9
CPU WRAPPER & BUS PRIORITIES S3C44B0X RISC MICROPROCESSOR
NOTE: The priorities are only valid in the fixed priority mode.
6-10
S3C44B0X RISC MICROPROCESSOR DMA
7 DMA
OVERVIEW
The S3C44B0X has 4 channel DMA Controllers. The two DMAs(we call it ZDMA : General DMA) are attached to
SSB (Samsung System Bus) and the other two DMAs(we call it as BDMA : Bridge DMA) are inside the bridge,
which is an interface layer between SSB and SPB (Samsung Peripheral Bus).
The two ZDMA controllers attached to SSB are to transfer data from memory to memory, from memory to I/O
memory(Fixed destination), and from I/O devices and I/O devices to memory. The other two BDMA controllers
transfer data from memory to I/O devices and I/O devices to memory. In this case, I/O devices means the
peripherals, attached to SPB like SIO, IIS and UART. The main advantage of DMA is that it can transfer the data
without CPU intervention. The operation of ZDMA and BDMA can be initiated by S/W, the request from internal
peripherals or the external request pins (nXDREQ0,1).
The most important feature in ZDMA is the on-the-fly mode, which reduces the number of cycles during DMA
operation between external memory and a fixed external peripheral (Fixed source or destination addressed device).
Usually, the DMA transfer consists of two separate cycles, one is 'Read' from the source memory or I/O device and
the other is 'Write' to memory or destination I/O device. To perform these operations, the memory controller reads the
data on data bus and writes this data to data bus, again. The on-the-fly-mode has inseparable Read/Write cycle. In
other words, the memory controller generates the acknowledge signal for the source or destination device to read or
write data on the data bus. At the same time, the memory controller also generates the Read or Write-related control
signals for memory access. This kind of on-the-fly-mode can reduce the number of required DMA cycles, different
from the general DMA cycles, which has separate Read and Write cycles. To operate the on-the-fly mode, the bus
size of the source should be the same as that of the destination.
7-1
DMA S3C44B0X RISC MICROPROCESSOR
ZDMA/BDMA OPERATION
Figure 7-1 shows the internal diagram of a ZDMA block. The ZDMA is interfaced to SSB and can transfer data from
external memory to external memory. Unlikely the BDMA(Bridge DMA), this DMA can be used to transfer data
between memory-mapped device or memories. In other words, data transfer between fixed source and external
memory, external memory and external memory, and external memory and fixed destination can be done by using
this DMA. The DMA operation can be started by S/W or an external DMA request signal, which will be explained
later.
In the ZDMA, there is a temporary buffer which allows multiple transfers to enhance bus utilization as well as transfer
speed. In other words, the S3C44B0X has a 4-word FIFO-type buffer to support the 4-word burst transfer during DMA
operation. For example, during the DMA operation between memories, a 4-word burst write happens after a 4-word
burst read.
SSB
Source Selector
SBS_Signals
nXDREQ[0], nXACK[0]
ZDMA 0 nXDREQ[1], nXACK[1]
ZDMA 1
Source Selector
Channel
SBS_STATE
Arbiter
FIFO ZDMA
(4-WORD) Control
7-2
S3C44B0X RISC MICROPROCESSOR DMA
Figure 7-2 shows the internal diagram of a BDMA block. The BDMA is in the Bridge, which is the interface layer
between SSB and SPB. The main role of BDMA is to transfer the data between external memory and internal
peripherals like UART, IIS and SIO, which are attached to SPB. The timer can also request a DMA operation
anytime; it is useful for operating the ADC block automatically. Usually, the CPU or other master devices should
access the external memory through memory controller, which is attached to SPB. Please be reminded that the
BDMA is also a type of master device. To transfer the data from memory (peripheral devices) to peripheral devices
(memory) attached to SPB (SSB), the memory controller attached to SSB should be used. Because the BDMA is in
the Bridge, which is an interface layer between SSB and SPB, it can transfer the data between two devices, which
are attached to SSB as well as SPB.
The BDMA cannot support a 4-word burst transfer (the block transfer mode) because BDMA does not have a
temporary buffer and because the peripheral devices attached to SPB is slow. Specifically, the BDMA can support
the data transfer from external memory to external memory, a slightly ineffective way of data transfer if you look at
the block diagram. Even if BDMA can support the data transfer between external memories, ZDMA is recommended
for use instead of to transfer data between external memories faster transfer and optional bus utilization are required.
But, if more number of DMA channels for data transfer between external memories (Maximum 2 channels using
ZDMA) is needed, the BDMA can be used.
SSB
x
BDMA 0 Source Selector UART0
IIS
SBS_Signals SIO
BDMA 1
x
Channel UART1
SBS_STATE Source Selector TIMER
Arbiter
SLAVE BDMA
Peripheral Control
SPB_Sginals
SPB
7-3
DMA S3C44B0X RISC MICROPROCESSOR
There are four types of external DMA request/acknowledge protocols. Each type defines how the signals like DMA
request and acknowledge are related to these protocols. Because ZDMA and BDMA can support external triggering,
these protocols correspond to ZMDA only, not BDMA.
Handshake Mode
In the handshake mode, the DMA can generate a single DMA acknowledge corresponding to the single DMA
request. The Figure 7-3 shows the handshake mode of DMA operation. In this figure, the DMA service means a
paired or an inseparable Read and Write cycle during DMA operation, which is one DMA operation. During one DMA
operation (Pared or inseparable Read and Write cycle), the bus controller does not allocate bus usage right to other
bus masters. If the user wants to allocate the bus usage properly for the higher priority master during one DMA
operation, the user should use the single step mode, which is explained in the next page. The single step mode
considers one DMA operation to consist of separable Read and Write cycle. It means that the bus controller can
allocate the bus usage to other higher bus master between Read and Write cycle.
The DMA request by nXDREQ causes one byte, one half word, or one word to be transmitted. The handshake mode
requires the DMA request for every data transfer. The nXDREQ can be released after active nXDACK and request
again after inactive nXDACK as shown in Figure 7-3.
nXDREQ[1]
nXDACK[1]
DMA Service
7-4
S3C44B0X RISC MICROPROCESSOR DMA
When the DMA request signal goes low, the bus controller indicates the bus allocation for the DMA operation by
lowering the DMA acknowledge signal if there is no higher priority bus request. During the first low level period of the
DMA acknowledge signal, there will be a DMA read cycle. After the DMA read cycle, there will be a rising of the
DMA acknowledge signal to indicate the end of the DMA read cycle. Simultaneously, the next DMA write cycle
initiates if the DMA request signal is still low at the rising edge of DMA acknowledge. But, if the DMA request signal
is already high at the rising edge of DMA acknowledge, the next DMA write cycle will be delayed until a new DMA
request signal is activated. These two cases are shown in below Figure 7-4 and Figure 7-5.
nXDREQ[1]
nXDACK[1]
Ready
nXDREQ[1]
nXDACK[1]
Ready Idle
State State
7-5
DMA S3C44B0X RISC MICROPROCESSOR
If the number of DMA transfer operation is too large, the long bus occupation during the whole service mode of DMA
operation may cause problem because the other bus services will not be provided. To solve this kind of problem, the
DMA releases the bus mastership in the whole service mode every time one unit (1byte, or 1 half-word, or 1 word) is
transferred. When the DMA releases the bus mastership, the other bus masters, such as the CPU, the other DMA,
and the external bus master, may have bus mastership. This feature in the whole service mode can provide the
optimal bus sharing, preventing the monopoly of bus mastership by DMA. If the other master intercepts the bus
mastership as shown in Figure 7-7, the remainder of DMA operation can be executed after servicing the impinged
bus mastership, without the re-activation of nXDREQ.
nXDREQ[1]
nXDACK[1]
nXDREQ[1]
nXDACK[1]
Figure 7-7. Whole Service Mode When Another Bus Master Acquires Bus Mastership
7-6
S3C44B0X RISC MICROPROCESSOR DMA
Demand Mode
Demand mode implies continuous DMA transfer cycles as long as DMA request signal is activated, as shown in
figure 7-8.
Unlike the whole service mode, this mode does not permit the bus hand-over bus mastership to higher priority bus
master, which make this request to bus controller during DMA operations. In other words, no other bus master can
have bus mastership during the demand mode.
The sole monopoly of the bus mastership in demand mode prevents the demand mode from exceeding the specified
maximum time, such as the DRAM refresh period.
nXDREQ[1]
nXDACK[1]
NOTE
The bus controller does not permit the hand-over of bus mastership during the DMA operation using the
demand mode. In other words, the DMA monopolizes bus usage right up to the completion of DMA
operation. Care is warranted when using the DMA operation in the demand mode because this kind of
monopoly may cause an un-expected malfunction on other masters by blocking optimal bus sharing.
7-7
DMA S3C44B0X RISC MICROPROCESSOR
There are three types of DMA transfer modes (Unit transfer mode, Block transfer mode and On the fly transfer mode).
Different from the external DMA request/acknowledge protocol, the DMA transfer mode defines the number of
reads/writes per unit transfer as shown in the following table.
nXDREQ[1]
nXDACK[1]
7-8
S3C44B0X RISC MICROPROCESSOR DMA
If the block transfer mode is used, the total data size to be transferred should be a multiple of 16 bytes. In other
words, the minimum transfer size is 16 bytes, i.e., 4 words. Because the DMA count is defined in byte unit, 16
should be the DMA transfer count in the case of 4 words transfer. If the transfer size or DMA count is not a multiple
of 16, for example 16, 32, 48, 64, and so on, the DMA can not transfer the data completely. If assume 100 bytes-
transfer (DMA count is 100), 6x16 = 96 bytes can be transferred. But, the remaining 4 bytes can not be transferred
because DMA operation will be stopped after 96 bytes transfer. The users should be aware of this characteristics
when they select the block transfer mode of DMA.
NOTE: The ADDR[3:0] should be '0' to meet 16-byte align condition in Block Transfer Mode.
nXDREQ[1]
nXDACK[1]
7-9
DMA S3C44B0X RISC MICROPROCESSOR
In on-the-fly transfer mode, the read and write operation occur simultaneously. The DMA acknowledge signal notifies
the external device to read or write. Simultaneously, the memory controller should generate Read-related or Write-
related control signals to the external memory. If the external device can support the on-the-fly mode (can read/write
the data by DMA acknowledge), the data transfer rates will be doubled. During the on-the-fly transfer cycle,
S3C44B0X data bus will be in Hi-z state. Figure 7-11 shows the example of the on-the-fly transfer mode with the
whole service mode.
nXDREQ[1]
nXDACK[1]
7-10
S3C44B0X RISC MICROPROCESSOR DMA
In ZDMA, S/W or H/W produces the nXDREQ (external DMA request signal), which is the DMA request source. The
S/W trigger can be done by writing the CMD field as 01 in ZDCON0/1 register, i.e., the start of DMA. Before the start
of DMA, the DMA-related parameters, such as source address, destination address, transfer count and so on,
should be configured. Based-on these configuration, the DMA operation will start when the CMD field is written as
01. In S/W trigger, the DMA operations will continue as long as the burst mastership is allocated to the DMA master
and as long as the DMA transfer count or TC(Terminal Count) reaches zero, i.e., the completion of DMA operation. If
the higher bus master acquires the bus mastership, DMA operations will continue after the service of higher priority
bus master. The DMA operations can also be initiated by nXDREQ(External DMA request signal) as well as S/W if
the DMA is configured for the external trigger mode, i.e., enable External DMA request by writing QDS bit as 1 in the
ZDCON0/1 register.
In BDMA, there are six hardware request sources, UART0, UART1, SIO , Timer and IIS. The BDMA can be initiated
by software as the ZDMA. These sources can be selected by writing the QSC field in the BDICNT register.
In the auto reload mode, the register content of Z(B)DCSRCn, Z(B)DCDSTn, and Z(B)DCCNTn are reloaded from the
registers of Z(B)DISRCn, Z(B)DIDESn, and Z(B)DICNTn when the DMA count decreases to 0. The configuration
parameters relating to DMA operation are contained in the registers of Z(B)DISRCn, Z(B)DIDESn, and Z(B)DICNTn,
for example, soure/destination address and source/destination transfer count. This kind of Auto-reloading can
preschedule DMA operation automatically. In other words, to change the configuration, the configuration in the
registers of Z(B)DISRCn, Z(B)DIDESn, and Z(B)DICNTn should be changed before the end of DMA operation based-
on current configuration. But, this kind of parameter auto-reloading can not guarantee the DMA re-run automatically
after the current DMA operation. The DMA will re-run if Z(B)DCONn CMD field is written newly or external DMA
request is issued.
To support the Auto-reload mdoe, the DMA should have two registers sets. The registers, Z(B)DISRCn, Z(B)DIDESn,
and Z(B)DICNTn, have the initial configuration for DMA operation as above-mentioned and registers, Z(B)DCSRCn,
Z(B)DCDESn and Z(B)DCCNTn, have the configuraion reflecting the current DMA operation. For example, these
register should have dynamic values of source address, destination address, and the remained transfer count or
TC(Terminal Count) during DMA operation.
The register contents of Z(B)DISRCn, Z(B)DIDESn, and Z(B)DICNTn can be reloaded into the registers Z(B)DCSRCn,
Z(B)DCDESn and Z(B)DCCNTn under one of the four cases.
case 1) Auto Reload(AR) is equal to 1 and DMA Count reaches to 0, which are normal auto-reload mode of
DMA
operation.
case 2) Writes new configuration into the Z(B)DISRC0, Z(B)DIDES0, and Z(B)DICNT0. If DMA is in Auto-reload
mode, these new contests of the register will be re-loaded automatically as same as above case.
If DMA is not active, these new configuration will be written into registers, Z(B)DISRC0, Z(B)DIDES0,
and Z(B)DICNT0, immediately
case 3) When DMA is enable, i.e., EN bit in Z(B)DICNT register changes from 0 to 1. The register contents of
Z(B)DISRC0, Z(B)DIDES0, and Z(B)DICNT0 will be loaded into the registers of Z(B)DCSRC0,
Z(B)DCDES0, and Z(B)DCCNT0 immediately to start of DMA operation, regardless of whether the DMA
is in Auto-reload mode, or not.
case 4) S/W command is Cancel. When user writes the CMD field as 11 in the register of ZDCON0/1. In this
case, the register content of Z(B)DISRC0, Z(B)DIDES0, and Z(B)DICNT0 will be loaded into the
registers, Z(B)DCSRC0, Z(B)DCDES0, and Z(B)DCCNT0 immediately.
7-11
DMA S3C44B0X RISC MICROPROCESSOR
NOTE: If users start the ZDMA operation by CMD=01b, the DREQ protocol must be whole service mode.
7-12
S3C44B0X RISC MICROPROCESSOR DMA
ZDMA0 CURRENT SRC/DST ADDRESS AND COUNT REGISTERS (ZDCSRC0, ZDCDES0, ZDCCNT0)
ZDMA1 CURRENT SRC/DST ADDRESS AND COUNT REGISTERS (ZDCSRC1, ZDCDES1, ZDCCNT1)
7-13
DMA S3C44B0X RISC MICROPROCESSOR
7-14
S3C44B0X RISC MICROPROCESSOR DMA
7-15
DMA S3C44B0X RISC MICROPROCESSOR
7-16
S3C44B0X RISC MICROPROCESSOR DMA
BDMA0 INITIAL SRC/DST ADDRESS AND COUNT REGISTERS (BDISRC0, BDIDES0, BDICNT0)
BDMA0 CURRENT SRC/DST ADDRESS AND COUNT REGISTERS (BDCSRC0, BDCDES0, BDCCNT0)
BDMA1 INITIAL SRC/DST ADDRESS AND COUNT REGISTERS (BDISRC1, BDIDES1, BDICNT1)
BDMA1 CURRENT SRC/DST ADDRESS AND COUNT REGISTERS (BDCSRC1, BDCDES1, BDCCNT1)
7-17
DMA S3C44B0X RISC MICROPROCESSOR
7-18
S3C44B0X RISC MICROPROCESSOR DMA
7-19
DMA S3C44B0X RISC MICROPROCESSOR
7-20
S3C44B0X RISC MICROPROCESSOR I/O PORTS
8 I/O PORTS
OVERVIEW
S3C44B0X has 71 multi-functional input/output port pins. There are seven ports:
Each port can be easily configured by software to meet various system configuration and design requirements. The
function of each pin to be used must be defined before starting the main program. If the multiplexed functions on a
pin are not used, the pin can be configured as I/O ports.
Before pin configurations, the initial pin states are configured elegantly to avoid some problems.
8-1
I/O PORTS S3C44B0X RISC MICROPROCESSOR
8-2
S3C44B0X RISC MICROPROCESSOR I/O PORTS
8-3
I/O PORTS S3C44B0X RISC MICROPROCESSOR
NOTES:
8-4
S3C44B0X RISC MICROPROCESSOR I/O PORTS
1. The underlined function name is selected just after a reset.(ENDIAN(PE8) is used only when nRESET is L.
2. IICSDA and IICSCL pins are open-drain pin. So, this pin needs pull-up resistors when used as output port(PF[1:0]).
PORT CONTROL DESCRIPTIONS
In S3C44B0X, most pins are multiplexed pins. Therefore, the functions for each pin should be selected. The PCONn
(port control register) determines which function is used for each pin.
If PG0 - PG7 are used for the wakeup signal in power down mode, these ports must be configured in interrupt mode.
If these ports are configured as output ports, data can be written to the corresponding bit of PDATn. If Ports are
configured as input ports, the data can be read from the corresponding bit of PDATn.
The port pull-up resistor controls the pull-up resistor enable/disable of each port group. When the corresponding bit is
0, the pull-up resistor of the pin is enabled. When 1, the pull-up resistor is disabled.
The 8 external interrupts are requested by various signaling methods. The EXTINT register configures the signaling
method among the low level trigger, high level trigger, falling edge trigger, rising edge trigger, and both edge triggers
for the external interrupt request
Because each external interrupt pin has a digital filter, the interrupt controller can recognize the request signal longer
than 3 clocks.
8-5
I/O PORTS S3C44B0X RISC MICROPROCESSOR
8-6
S3C44B0X RISC MICROPROCESSOR I/O PORTS
8-7
I/O PORTS S3C44B0X RISC MICROPROCESSOR
8-8
S3C44B0X RISC MICROPROCESSOR I/O PORTS
8-9
I/O PORTS S3C44B0X RISC MICROPROCESSOR
8-10
S3C44B0X RISC MICROPROCESSOR I/O PORTS
8-11
I/O PORTS S3C44B0X RISC MICROPROCESSOR
8-12
S3C44B0X RISC MICROPROCESSOR I/O PORTS
If PG0 - PG7 are to be used for wake-up signals in power down mode, the ports will be set in the interrupt mode.
8-13
I/O PORTS S3C44B0X RISC MICROPROCESSOR
In STOP/SL_IDLE mode, the data bus(D[31:0] or D[15:0] is in Hi-Z state. But, because of the characteristics of IO
pad, the data bus pull-up resistors have to be turned on to reduce the power consumption in STOP/SL_IDLE mode.
D[31:16] pin pull-up resistors can be controlled by PUPC register. D[15:0] pin pull-up resistors can be controlled by
the SPUCR register.
In STOP mode, memory control signals can be selected as Hi-z state or previous state in order to protect against
memory mal-functions by setting the HZ@STOP field in SPUCR register.
8-14
S3C44B0X RISC MICROPROCESSOR I/O PORTS
The 8 external interrupts can be requested by various signaling methods. The EXTINT register configures the
signaling method between the level trigger and edge trigger for the external interrupt request, and also configures the
signal polarity.
NOTE: Because each external interrupt pin has a digital filter, the interrupt controller can recognize a request signal
that is longer than 3 clocks.
8-15
I/O PORTS S3C44B0X RISC MICROPROCESSOR
The external interrupt requests(4, 5, 6, and 7) are 'OR'ed to provide a single interrupt source to interrupt controller.
EINT4, EINT5, EINT6, and EINT7 share the same interrupt request line(EINT4/5/6/7) in interrupt controller. If each of
the 4 bits in the external interrupt request is generated, EXTINTPNDn will be set as 1. The interrupt service routine
must clear the interrupt pending condition(INTPND) after clearing the external pending condition(EXTINTPND).
EXTINTPND is cleared by writing 1.
8-16
S3C44B0X RISC MICROPROCESSOR PWM TIMER
9 PWM TIMER
OVERVIEW
The S3C44B0X has six 16-bit timers, each timer can operate in interrupt-based or DMA-based mode. The timers 0,
1, 2, 3 and 4 have the PWM function (Pulse Width Modulation). Timer 5 has an internal timer only with no output
pins. Timer 0 has a dead-zone generator, which is used with a large current device.
Timer 0 and timer 1 share an 8-bit prescaler; timers 2 & 3 share another 8-bit prescaler; and timers 4 & 5 share the
other 8-bit prescaler. Each timer, except timers 4 and 5, has a clock-divider which has 5 different divided signals
(1/2, 1/4, 1/8, 1/16, 1/32). Timers 4/5 have 4 divided signals(1/2, 1/4, 1/8, 1/16) and one input TCLK/EXTCLK. Each
timer block receives its own clock signals from the clock-divider, which receives the clock from the corresponding 8-
bit prescaler. The 8-bit prescaler is programmable and divides the MCLK signal according to the loading value which
is stored in TCFG0 and TCFG1 registers.
The timer count buffer register(TCNTBn) has an initial value which is loaded into the down-counter when the timer is
enabled. The timer compare buffer register(TCMPBn) has an initial value which is loaded into the compare register to
be compared with the down-counter value. This double buffering feature of TCNTBn and TCMPBn makes the timer
generate a stable output when the frequency and duty ratio are changed.
Each timer has its own 16-bit down-counter which is driven by the timer clock. When the down-counter reaches zero,
the timer interrupt request is generated to inform the CPU that the timer operation has been completed. When the
timer counter reaches zero, the value of corresponding TCNTBn is automatically loaded into the down-counter to
continue the next operation. However, if the timer stops, for example, by clearing the timer enable bit of TCONn
during the timer running mode, the value of TCNTBn will not be reloaded into the counter.
The value of TCMPBn is used for PWM (pulse width modulation). The timer control logic changes the output level
when the down-counter value matches the value of the compare register in the timer control logic. Therefore, the
compare register determines the turn-on time(or turn-off time) of an PWM output.
FEATURES
9-1
PWM TIMER S3C44B0X RISC MICROPROCESSOR
Dead Zone
MUX0
Generator
MUX0
Control
Logic
MCLK 1/2
1/4
8-Bit
1/8 TCMPB1 TCNTB1
Prescaler
1/16
TOUT1
1/32
MUX1
Clock Control
Divider Logic
TCMPB2 TCNTB2
TOUT2
MUX2
Control
Logic
1/2
1/4
8-Bit
1/8 TCMPB3 TCNTB3
Prescaler
1/16
1/32
TOUT3
MUX3
Clock Control
Divider Logic
TCMPB4 TCNTB4
TOUT4
MUX4
Control
Logic
1/2
8-Bit 1/4
TCLK TCNTB5
Prescaler
1/8
1/16
MUX5
Clock Control
TOUT5 (No Pin)
Divider Logic
EXTCLK
9-2
S3C44B0X RISC MICROPROCESSOR PWM TIMER
An 8-bit prescaler and an independent 4-bit divider make the following output frequencies:
Start bit = 1 Timer is started TCNTn = TCMPn Auto-reload TCNTn = TCMPn Timer is stopped
TCMPn 1 0
TCNTn 3 3 2 1 0 2 1 0 0
Auto-reload = 0
TCNTBn = 3 TCNTBn = 2
TCMPBn = 1 TCMPBn = 0
Manual Update = 1 Manual Update = 0 Interrupt Request Interrupt Request
Auto-reload = 1 Auto-reload = 1
TOUTn
Command
Status
A timer (except the timer ch-5) has TCNTBn, TCNTn, TCMPBn and TCMPn. TCNTBn and TCMPBn are loaded into
TCNTn and TCMPn when the timer reaches 0. When TCNTn reaches 0, the interrupt request will occur if the interrupt
is enabled. (TCNTn and TCMPn are the names of the internal registers. The TCNTn register can be read from the
TCNTOn register)
9-3
PWM TIMER S3C44B0X RISC MICROPROCESSOR
S3C44B0X PWM Timers have a double buffering feature, which can change the reload value for the next timer
operation without stopping the current timer operation. So, although the new timer value is set, a current timer
operation is completed successfully.
The timer value can be written into TCNTBn (timer counter buffer register) and the current counter value of the timer
can be read from TCNTOn (timer count observation register). If TCNTBn is read, the read value is not the current
state of the counter but the reload value for the next timer duration.
The auto-reload is the operation, which copies the TCNTBn into TCNTn when TCNTn reaches 0. The value, written
into TCNTBn, is loaded to TCNTn only when the TCNTn reaches to 0 and auto-reload is enabled. If the TCNTn is 0
and the auto-reload bit is 0, the TCNTn does not operate any further.
Write Write
TCNTBn = 100 TCNTBn = 200
Start
TCNTBn = 150
Auto-reload
Interrupt
9-4
S3C44B0X RISC MICROPROCESSOR PWM TIMER
Because an auto-reload operation of the timer occurs when the down counter reaches to 0, a starting value of the
TCNTn is not defined at first. In this case, the starting value has to be loaded by the manual update bit. The
sequence of starting a timer is as follows;
2) Set the manual update bit of the corresponding timer. It is recommended to configure the inverter on/off bit.
3) Set the start bit of the corresponding timer to start the timer(At the same time, clear the manual update bit).
Also, if the timer is stopped by force, the TCNTn retains the counter value and is not reloaded from TCNTBn. If new
value has to be set, manual update has to be done.
NOTE
Whenever TOUT inverter on/off bit is changed, the TOUTn logic value will be changed whether or not the
timer runs. Therefore, it is desirable that the inverter on/off bit is configured with the manual update bit.
9-5
PWM TIMER S3C44B0X RISC MICROPROCESSOR
1 2 3 4 6 7 9 10
TOUTn
50 110 40 40 20 60
5 8 11
9-6
S3C44B0X RISC MICROPROCESSOR PWM TIMER
60 50 40 30 30
PWM feature can be implemented by using the TCMPBn. PWM frequency is determined by TCNTBn. A PWM value
is determined by TCMPBn in figure 9-5.
For a lower PWM output value, decrease the TCMPBn value. For a higher PWM output value, increase the TCMPBn
value. If an output inverter is enabled, the increment/decrement may be reversed.
Because of the double buffering feature, TCMPBn, for a next PWM cycle, can be written at any point in the current
PWM cycle by ISR or something else
9-7
PWM TIMER S3C44B0X RISC MICROPROCESSOR
Inverter off
Inverter on
Initial State Period 1 Period 2 Timer Stop
The following methods can be used to maintain TOUT as high or low.(assume the inverter is off)
1. Turn off the auto-reload bit. And then, TOUTn goes to high level and the timer is stopped after TCNTn reaches to
0. This method is recommended.
2. Stop the timer by clearing the timer start/stop bit to 0. If TCNTn ≤ TCMPn, the output level is high. If TCNTn
>TCMPn, the output level is low.
3. Write the TCMPBn which is bigger than TCNTBn. This inhibits the TOUTn from going to high because TCMPBn
can not have the same value as TCNTn.
4. TOUTn can be inverted by the inverter on/off bit in TCON. The inverter removes the additional circuit to
adjust the output level.
9-8
S3C44B0X RISC MICROPROCESSOR PWM TIMER
The dead zone is for the PWM control in a power device. This feature is used to insert the time gap between a turn-
off of a switching device and a turn on of another switching device. This time gap prohibits the two switching devices
turning on simultaneously, even for a very short time.
TOUT0 is the PWM output. nTOUT0 is the inversion of the TOUT0. If the dead zone is enabled, the output wave form
of TOUT0 and nTOUT0 will be TOUT0_DZ and nTOUT0_DZ, respectively. nTOUT0_DZ is routed to the TOUT1 pin.
In the dead zone interval, TOUT0_DZ and nTOUT0_DZ can never be turned on simultaneously.
TOUT0
nTOUT0
Deadzone
Interval
TOUT0_DZ
nTOUT0_DZ
Figure 9-7. The Wave Form When a Dead Zone Feature is Enabled
9-9
PWM TIMER S3C44B0X RISC MICROPROCESSOR
The PWM timer can generate a DMA request at every specific times. The timer keeps DMA request signal low until
the timer receives the ACK signal. When the timer receives the ACK signal, it makes the request signal inactive.
One of 6 timers can generate a DMA request. The timer, that generates the DMA request, is determined by setting
DMA mode bits(in TCFG1 register). If a timer is configured as DMA request mode, the timer does not generate an
interrupt request. The others can generate interrupt normally.
DMA mode DMA Timer0 INT Timer1 INT Timer2 INT Timer3 INT Timer4 INT Timer5 INT
request
0000 No select ON ON ON ON ON ON
0001 Timer0 OFF ON ON ON ON ON
0010 Timer1 ON OFF ON ON ON ON
0011 Timer2 ON ON OFF ON ON ON
0100 Timer3 ON ON ON OFF ON ON
0101 Timer4 ON ON ON ON OFF ON
0110 Timer5 ON ON ON ON ON OFF
0111 No select ON ON ON ON ON ON
MCLK
Timer4_Int_tmp
nDMA_ACK
nDMA_REQ
Timer4_Int
9-10
S3C44B0X RISC MICROPROCESSOR PWM TIMER
9-11
PWM TIMER S3C44B0X RISC MICROPROCESSOR
9-12
S3C44B0X RISC MICROPROCESSOR PWM TIMER
9-13
PWM TIMER S3C44B0X RISC MICROPROCESSOR
9-14
S3C44B0X RISC MICROPROCESSOR PWM TIMER
TIMER 0 COUNT BUFFER REGISTER & COMPARE BUFFER REGISTER (TCNTB0, TCMPB0)
9-15
PWM TIMER S3C44B0X RISC MICROPROCESSOR
TIMER 1 COUNT BUFFER REGISTER & COMPARE BUFFER REGISTER (TCNTB1, TCMPB1)
9-16
S3C44B0X RISC MICROPROCESSOR PWM TIMER
TIMER 2 COUNT BUFFER REGISTER & COMPARE BUFFER REGISTER (TCNTB2, TCMPB2)
9-17
PWM TIMER S3C44B0X RISC MICROPROCESSOR
TIMER 3 COUNT BUFFER REGISTER & COMPARE BUFFER REGISTER (TCNTB3, TCMPB3)
9-18
S3C44B0X RISC MICROPROCESSOR PWM TIMER
TIMER 4 COUNT BUFFER REGISTER & COMPARE BUFFER REGISTER (TCNTB4, TCMPB4)
9-19
PWM TIMER S3C44B0X RISC MICROPROCESSOR
9-20
S3C44B0X RISC MICROPROCESSOR UART
10 UART
OVERVIEW
The S3C44B0X UART (Universal Asynchronous Receiver and Transmitter) unit provides two independent
asynchronous serial I/O (SIO) ports, each of which can operate in interrupt-based or DMA-based mode. In other
words, UART can generate an interrupt or DMA request to transfer data between CPU and UART. It can support bit
rates of up to 115.2K bps. Each UART channel contains two 16-byte FIFOs for receive and transmit.
The S3C44B0X UART includes programmable baud-rates, infra-red (IR) transmit/receive, one or two stop bit insertion,
5-bit, 6-bit, 7-bit or 8-bit data width and parity checking.
Each UART contains a baud-rate generator, transmitter, receiver and control unit, as shown in Figure10-1. The baud-
rate generator can be clocked by MCLK. The transmitter and the receiver contain 16-byte FIFOs and data shifters.
Data, which is to be transmitted, is written to FIFO and then copied to the transmit shifter. It is then shifted out by
the transmit data pin (TxDn). The received data is shifted from the receive data pin (RxDn), and then copied to FIFO
from the shifter.
FEATURES
10-1
UART S3C44B0X RISC MICROPROCESSOR
BLOCK DIAGRAM
Peripheral BUS
Transmitter
Control Buad-rate
Clock Source
Unit Generator
Receiver
10-2
S3C44B0X RISC MICROPROCESSOR UART
UART OPERATION
The following sections describe the UART operations that include data transmission, data reception, interrupt
generation, baud-rate generation, loopback mode, infra-red mode, and auto flow control.
Data Transmission
The data frame for transmission is programmable. It consists of a start bit, 5 to 8 data bits, an optional parity bit and
1 to 2 stop bits, which can be specified by the line control register (UCONn). The transmitter can also produce the
break condition. The break condition forces the serial output to logic 0 state for a duration longer than one frame
transmission time. This block transmit break signal after the present transmission word transmits perfectly. After the
break signal transmit, continously transmit data into the Tx FIFO (Tx holding register in the case of Non-FIFO mode).
Data Reception
Like the transmission, the data frame for reception is also programmable. It consists of a start bit, 5 to 8 data bits,
an optional parity bit and 1 to 2 stop bits in the line control register (UCONn). The receiver can detect overrun error,
parity error, frame error and break condition, each of which can set an error flag.
- The overrun error indicates that new data has overwritten the old data before the old data has been read.
- The parity error indicates that the receiver has detected an unexpected parity condition.
- The frame error indicates that the received data does not have a valid stop bit.
- The break condition indicates that the RxDn input is held in the logic 0 state for a duration longer than one
frame transmission time.
Receive time-out condition occurs when it does not receive data during the 3 word time and the Rx FIFO is not
empty in the FIFO mode.
In AFC, nRTS is controlled by condition of the receiver and operation of transmitter is controlled by the nCTS signal.
The UART's transmitter transfers the data in FIFO only when nCTS signal active(In AFC, nCTS means that the other
UART's FIFO is ready to receive data). Before the UART receives data, nRTS has to be activated when its receive
FIFO has a spare more than 2-byte and has to be inactivated when its receive FIFO has a spare under 1-byte(In
AFC, nRTS means that its own receive FIFO is ready to receive data).
10-3
UART S3C44B0X RISC MICROPROCESSOR
2. Check the value of Rx FIFO count in UFSTATn register. If the value is less than 15, users have to set the value of
UMCONn[0] to '1'(activate nRTS), and if it is equal or larger than 15 users have to set the value to '0'(inactivate
nRTS).
3. Repeat item 2.
Tx operation
2. Check the value of UMSTATn[0]. If the value is '1'(nCTS is activated), users write the data to Tx buffer or Tx FIFO
register.
RS-232C interface
If users connect to modem interface(not equal null modem), nRTS, nCTS, nDSR, nDTR, DCD and nRI signals are
need. In this case, users control these signals with general I/O ports by S/W because the AFC does not support the
RS-232C interface.
10-4
S3C44B0X RISC MICROPROCESSOR UART
The overrun error, parity error, frame error and break condition are referred to as the receive error status, each of
which can cause the receive error status interrupt request, if the receive-error-status-interrupt-enable bit is set to one
in the control register UCONn. When a receive-error-status-interrupt-request is detected, the signal causing the
request can be identified by reading UERSTSTn.
When the receiver transfers the data of the receive shifter to the receive FIFO, it activates the receive FIFO full status
signal which will cause the receive interrupt, if the receive mode in control register is selected as the interrupt mode.
When the transmitter transfers data from its transmit FIFO to its transmit shifter, the transmit FIFO empty status
signal is activated. The signal causes the transmit interrupt if the transmit mode in control register is selected as that
interrupt mode.
The receive-FIFO-full and transmit-FIFO-empty status signals can also be connected to generate the DMA request
signals if the receive/transmit mode is selected as the DMA mode.
10-5
UART S3C44B0X RISC MICROPROCESSOR
For example,
It is assumed that the UART FIFO receives A, B, C, D, E characters sequentially and the frame error occurrs while
receiving 'B' , and the parity error occurs while receiving 'D'.
Although the UART error occurred, the error interrupt will not be generated because the character, which was
received with an error, has not been read yet. The error interrupt will occur when the character is read out.
RX-FIFO STATUS-FIFO
break error parity error frame error
-
-
-
-
-
-
-
-
-
-
-
'E'
'D'
'C'
'B'
'A'
10-6
S3C44B0X RISC MICROPROCESSOR UART
Baud-Rate Generation
Each UART's baud-rate generator provides the serial clock for transmitter and receiver. The source clock for the
baud-rate generator can be selected with the S3C44B0X's internal system clock. The baud-rate clock is generated
by dividing the source clock by 16 and a 16-bit divisor specified in the UART baud-rate divisor register (UBRDIVn).
The UBRDIVn can be determined as follows:
where the divisor should be from 1 to (216-1). For example, if the baud-rate is 115200 bps and MCLK is 40 MHz ,
UBRDIVn is:
Loop-back Mode
The S3C44B0X UART provides a test mode referred to as the loopback mode, to aid in isolating faults in the
communication link. In this mode, the transmitted data is immediately received. This feature allows the processor to
verify the internal transmit and to receive the data path of each SIO channel. This mode can be selected by setting
the loopback-bit in the UART control register (UCONn).
Break Condition
The break is defined as a continuous low level signal for more than one frame transmission time on the transmit data
output.
10-7
UART S3C44B0X RISC MICROPROCESSOR
IR (Infrared) Mode
The S3C44B0X UART block supports Infrared (IR) transmission and reception, which can be selected by setting the
Infrared-mode bit in the UART control register (ULCONn). The implementation of the mode is shown in Figure 10-3.
In IR transmit mode, the transmit period is pulsed at a rate of 3/16, the normal serial transmit rate (when the transmit
data bit is zero); In IR receive mode, the receiver must detect the 3/16 pulsed period to recognize a zero value (refer
to the frame timing diagrams shown in Figures 10-5 and 10-6).
Note: The received pulse is recognized by S3C44B0X which sampling frequency is 1/16 bit frame time, so
when it communicates in low speed the Rx pulse must be longer than 1/16 bit frame time. In case of 9600-
baud rate, the Rx pulse width must be longer than 6.51us. (Bit frame width = 104.1us, sampling frequency =
6.51us)
TxD 0
TxD
1
IRS
UART
Block 0 RxD
RxD
1
RE
IrDA Tx IrDA Rx
Encoder Decoder
10-8
S3C44B0X RISC MICROPROCESSOR UART
SIO Frame
0 1 0 1 0 0 1 1 0 1
IR Transmit Frame
0 1 0 1 0 0 1 1 0 1
Bit
Pulse Width = 3/16 Bit Frame
Time
IR Receive Frame
0 1 0 1 0 0 1 1 0 1
10-9
UART S3C44B0X RISC MICROPROCESSOR
There are two UART line control registers, ULCON0 and ULCON1, in the UART block.
10-10
S3C44B0X RISC MICROPROCESSOR UART
There are two UART control registers, UCON0 and UCON1, in the UART block.
10-11
UART S3C44B0X RISC MICROPROCESSOR
There are two UART FIFO control registers, UFCON0 and UFCON1, in the UART block.
NOTE: When the UART does not reach the FIFO trigger level and does not receive data during 3 word time in DMA receive
mode with FIFO, the Rx interrupt will be generated (receive time out), and the users should check the FIFO status
and read out the rest.
There are two UART MODEM control registers, UMCON0 and UMCON1, in the UART block.
10-12
S3C44B0X RISC MICROPROCESSOR UART
There are two UART Tx/Rx status registers, UTRSTAT0 and UTRSTAT1, in the UART block.
10-13
UART S3C44B0X RISC MICROPROCESSOR
There are two UART Rx error status registers, UERSTAT0 and UERSTAT1, in the UART block.
NOTE: These bits (UERSATn[3:0]) are automatically cleared to 0 when the UART error status register is read.
10-14
S3C44B0X RISC MICROPROCESSOR UART
Only the UARTn has a 16-byte transmit FIFO & a 16-byte receive FIFO.
There are two UART FIFO status registers, UFSTAT0 and UFSTAT1, in the UART block.
10-15
UART S3C44B0X RISC MICROPROCESSOR
There are two UART modem status register, UMSTAT0 and UMSTAT1, in the UART block.
nCTS
Delta CTS
Read_UMSTATn
10-16
S3C44B0X RISC MICROPROCESSOR UART
NOTE: When an overrun error occurs, the URXHn must be read. If not, the next received data will also make an
overrun error, even though the overrun bit of USTATn had been cleared.
10-17
UART S3C44B0X RISC MICROPROCESSOR
The value stored in the baud rate divisor register, UBRDIV, is used to determine the serial Tx/Rx clock rate
(baud rate) as follows:
where the divisor should be from 1 to (216-1). For example, if the baud-rate is 115200 bps and MCLK is 40 MHz,
UBRDIVn is:
10-18
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
11 INTERRUPT CONTROLLER
OVERVIEW
The interrupt controller in S3C44B0X receives the request from 30 interrupt sources. These interrupt sources are
provided by internal peripherals such as the DMA controller, UARTand SIO, etc. In these interrupt sources, the four
external interrupts(EINT4/5/6/7) are 'OR'ed to the interrupt controller. The UART0 and 1 Error interrupt are 'OR'ed , as
well.
The role of the interrupt controller is to ask for the FIQ or IRQ interrupt request to the ARM7TDMI core after making
the arbitration process when there are multiple interrupt requests from internal peripherals and external interrupt
request pins.
Originally, ARM7TDMI core only permits the FIQ or IRQ interrupt, which is the arbitration process based on priority
by software. For example, if you define all interrupt source as IRQ (Interrupt Mode Setting), and, if there are 10
interrupt requests at the same time, you can determine the interrupt service priority by reading the interrupt pending
register, which indicates the type of interrupt request that will occur.
This kind of interrupt process requires a long interrupt latency until to jump to the exact service routine.
(The S3C44B0X may support this kind of interrupt processing.)
To solve the above-mentioned problem, S3C44B0X supports a new interrupt processing called vectored interrupt
mode, which is a general feature of the CISC type micro-controller, to reduce the interrupt latency. In other words,
the hardware inside the S3C44B0X interrupt controller provides the interrupt service vector directly.
When the multiple interrupt sources request interrupts, the hardware priority logic determines which interrupt should
be serviced. At same time, this hardware logic applies the jump instruction of the vector table to 0x18(or 0x1c),
which performs the jump to the corresponding service routine. Compared with the previous software method, it will
reduce the interrupt latency, dramatically.
11-1
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
Interrupt Mode
ARM7TDMI has 2 types of interrupt mode, FIQ or IRQ. All the interrupt sources determine the mode of interrupt to be
used at interrupt request.
11-2
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
INTERRUPT SOURCES
Among 30 interrupt sources, 26 sources are provided for the interrupt controller. Four external interrupt (EINT4/5/6/7)
requests are ORed to provide a single interrupt source to the interrupt controller, and two UART error interrupts
(UERROR0/1) are the same configuration.
NOTE: EINT4, EINT5, EINT6, and EINT7 share the same interrupt request line. Therefore, the ISR (interrupt service
routine) will discriminate these four interrupt sources by reading the EXTINPND[3:0] register. EXTINPND[3:0] must
be cleared by writing a 1 in the ISR after the corresponding ISR has been completed.
11-3
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
There is the interrupt priority generating block only for IRQ interrupt request. If the vectored mode is used and an
interrupt source is configured as ISR in INTMOD register, the interrupt will be processed by the interrupt priority
generating block.
The priority generating block consists of five units, 1 master unit and 4 slave units. Each slave priority generating unit
manages six interrupt sources. The master priority generating unit manages 4 slave units and 2 interrupt sources.
Each slave unit has 4 programmable priority sources (sGn) and 2 fixed priotiry sources (sGKn). The priority among
the 4 sources in each slave unit is programmable. The other 2 fixed priorities have the lowest priority among the 6
sources.
The master priority generating unit determines the priority between the 4 slave units and 2 interrupt sources. The 2
interrupt sources, INT_RTC and INT_ADC, have the lowest priority among 26 interrupt sources.
sGA, B, C, D EINT0, 1, 2, 3
mGA
mGA, B, C, D EINT4/5/6/7
sGKA, B
ARM IRQ TICK
mGKA, B
sGA, B, C, D TIMER0, 1, 2, 3
mGC
sGKA, B TIMER4, 5
RXD0, 1
sGA, B, C, D
mGD IIC, SIO
sGKA, B TXD0, 1
mGKA
RTC
mGKB
ADC
11-4
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
INTERRUPT PRIORITY
If source A is configured to FIQ and source B is configured to IRQ, source A has higher priority than source B
because a FIQ interrupt has higher priority than an IRQ interrupt in all cases.
If source A and source B are in different master groups and the master group priority of source A is higher than the
master group priority of source B, the priority of source A is higher than source B.
If source A and source B are in the same master group and source A has higher priority than source B, source A
has the higher priority.
The priorities of sGA, sGB, sGC, and sGD are always higher than those of sGKA and sGKB. The priorities among
sGA,sGB,sGC and sGD are programmable or are determined by the round-robin method. Between sGKA and sGKB,
sGKA has always the higher priority.
The group priority of mGA, mGB, mGC, and mGD are always higher than that of mGKA and mGKB. So, the
priorities of mGKA and mGKB are the lowest among the other interrupt sources. The group priority among mGA,
mGB, mGC and, mGD is programmable or is determined by the round-robin method. Between mGKA and mGKB,
mGKA always has the higher priority.
S3C44B0X has a new feature, the vectored interrupt mode, to reduce the interrupt latency time.
If ARM7TDMI receives the IRQ interrupt request from the interrupt controller, ARM7TDMI executes an instruction at
0x00000018. In vectored interrupt mode, the interrupt controller will load branch instructions on the data bus when
ARM7TDMI fetches the instructions at 0x00000018. The branch instructions let the program counter be a unique
address corresponding to each interrupt source.
The interrupt controller generates the machine code for branching to the vector address of each interrupt source. For
example, If EINT0 is IRQ, the interrupt controller must generate the branch instruction which branches from 0x18 to
0x20. So, the interrupt controller generates the machine code, 0xea000000.
The user program code must locate the branch instruction, which branches to the corresponding ISR (interrupt
service routine) at each vector address. The machine code, branch instruction, at the corresponding vector address
is calculated as follows;
For example, if Timer 0 interrupt to be processed in vector interrupt mode, the branch instruction, which jumps to the
ISR, is located at 0x00000060. The ISR start address is 0x10000. The following 32bit machine code is written at
0x00000060.
The machine code is usually generated automatically by the assembler and therefore the machine code does not
have to be calculated as above.
11-5
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
11-6
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
11-7
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
In the non-vectored interrupt mode, the IRQ/FIQ handler will move the PC to the corresponding ISR by analyzing
I_ISPR/F_ISPR register. HandleXXX addresses hold each corresponding ISR routine start addresses. The source
code for an IRQ interrupt is as follows;
ENTRY
b ResetHandler ; for debug
b HandlerUndef ; handlerUndef
b HandlerSWI ; SWI interrupt handler
b HandlerPabort ; handlerPAbort
b HandlerDabort ; handlerDAbort
b. ; handlerReserved
b IsrIRQ
b HandlerFIQ
......
IsrIRQ
sub sp,sp,#4 ; reserved for PC
stmfd sp!,{r8-r9}
ldr r9,=I_ISPR
ldr r9,[r9]
mov r8,#0x0
0 movs r9,r9,lsr #1
bcs %F1
add r8,r8,#4
b %B0
1 ldr r9,=HandleADC
add r9,r9,r8
ldr r9,[r9]
str r9,[sp,#8]
ldmfd sp!,{r8-r9,pc}
......
HandleADC # 4
HandleRTC # 4
HandleUTXD1 # 4
HandleUTXD0 # 4
......
HandleEINT3 # 4
HandleEINT2 # 4
HandleEINT1 # 4
HandleEINT0 # 4 ; 0xc1(c7)fff84
11-8
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
NOTE: FIQ interrupt mode does not support vectored interrupt mode.
11-9
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
Each of the 26 bits in the interrupt pending register, INTPND, corresponds to an interrupt source. When an interrupt
request is generated, it will be set to 1. The interrupt service routine must then clear the pending condition by writing
'1' to the corresponding bit of I_ISPC/F_ISPC. Although several interrupt sources generate requests simultaneously,
the INTPND will indicate all interrupt sources that generate an interrupt request. Even if the interrupt source is
masked by INTMSK, the corresponding pending bit can be set to 1.
11-10
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
11-11
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
Each of the 26 bits in the interrupt mode register, INTMOD, corresponds to an interrupt source. When the interrupt
mode bit for each source is set to 1, the interrupt is processed by the ARM7TDMI core in the FIQ (fast interrupt)
mode. Otherwise, it is processed in the IRQ mode (normal interrupt). The 26 interrupt sources are summarized as
follows:
11-12
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
Each of the 26 bits except the global mask bit in the interrupt mask register, INTMSK, corresponds to an interrupt
source. When a source interrupt mask bit is 1 and the corresponding interrupt event occurs, the interrupt is not
serviced by the CPU. If the mask bit is 0, the interrupt is serviced upon a request.
If the global mask bit is set to 1, all interrupt requests are not serviced, and the INTPND register is set to 1.
If the INTMSK is changed in ISR(interrupt service routine) and the vectored interrupt is used, an INTMSK bit can not
mask an interrupt event, which had been latched in INTPND before the INTMSK bit was set. To clear this problem,
clear the corresponding pending bit(INTPND) after changing INTMSK.
The 26 interrupt sources and global mask bit are summarized as follows:
IMPORTANT NOTES
1. INTMSK register can be masked only when it is sure that the corresponding interrupt does not be
requested. If your application should mask any interrupt mask bit(INTMSK) just when the
corresponding interrupt is issued, please contact our FAE (field application engineer).
2. If you need that all interrupt is masked, we recommend that I/F bits in CPSR are set using MRS, MSR
instructions. The I, F bit in CPSR can be masked even when any interrupt is issued.
11-13
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
11-14
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
The priority generating block consists of five units, 1 master unit and 4 slave units. Each slave priority generating unit
manages six interrupt sources. The master priority generating unit manages 4 slave units and 2 interrupt sources.
Each slave unit has 4 programmable priority source (sGn) and 2 fixed priority sources (kn). The priority among the 4
sources in each slave unit is determined the I_PSLV register. The other 2 fixed priorities have the lowest priority
among the 6 sources.
The master priority generating unit determines the priority between 4 slave units and 2 interrupt sources using the
I_PMST register. The 2 interrupt sources,INT_RTC and INT_ADC, have the lowest priority among the 26 interrupt
sources.
If several interrupts are requested at the same time, the I_ISPR register shows only the requested interrupt source
with the highest priority.
IMPORTANT NOTE
In FIQ mode, there is no service pending register like I_ISPR, users must check INTPND resister.
11-15
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
I_PSLV determines the interrupt priorities among the 4 interrupt sources of each slave group.
11-16
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
NOTE: The items in I_PSLAVE must be configured with different priorities even if the corresponding interrupt source
is not used.
11-17
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
NOTE: The items in I_PMST must be configured with different priorities even if the corresponding interrupt source is not
used.
11-18
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
I_CSLV indicates the current priority status among the sources in each slave group. The I_CSLV may differ from
I_PSLV if the round-robin mode is enabled.
11-19
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
I_CMST indicates the current priority status among the slave groups
11-20
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
I_ISPR indicates the interrupt being currently serviced. Although the several interrupt pending bits are all turned on,
only one bit will be turned on.
11-21
INTERRUPT CONTROLLER S3C44B0X RISC MICROPROCESSOR
I_ISPC/F_ISPC clears the interrupt pending bit (INTPND). I_ISPC/F_ISPC also informs the interrupt controller of the
end of corresponding ISR (interrupt service routine). At the end of ISR(interrupt service routine), the corresponding
pending bit must be cleared.
The bit of INTPND bit is cleared to zero by writing '1' on I_ISPC/F_ISPC. This feature reduces the code size to clear
the INTPND. The corresponding INTPND bit is cleared automatically by I_ISPC/F_ISPC, INTPND register can not be
cleared directly.
NOTE
To clear the I_ISPC/F_ISPC, the following two rules has to be obeyed.
1) The I_ISPC/F_ISPC registers are accessed only once in ISR(interrupt service routine).
2) The pending bit in I_ISPR/INTPND register should be cleared by writing I_ISPC register.
If these two rules are not followed, I_ISPR and INTPND register may be 0 although the interrupt has been
requested.
11-22
S3C44B0X RISC MICROPROCESSOR INTERRUPT CONTROLLER
11-23
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
12 LCD CONTROLLER
OVERVIEW
The LCD controller within S3C44B0X consists of logic for transferring LCD image data from a video buffer located in
system memory to an external LCD driver.
The LCD controller supports monochrome, 2-bit per pixel (4-level gray scale) or 4-bit per pixel (16-level gray scale)
mode on a monochrome LCD, using a time-based dithering algorithm and FRC (Frame Rate Control) method. It can
support 8-bit per pixel (256 level color) for interfacing with a color LCD panel, also.
The LCD controller can be programmed to support the different requirements on the screen related to the number of
horizontal and vertical pixels, data line width for the data interface, interface timing, and refresh rate.
FEATURES
12-1
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
VFRAME: This is the frame synchronous signal between the LCD controller and LCD driver. It signals the
LCD panel of the start of a new frame. The LCD controller asserts VFRAME after a full frame of
display as shown in Fig. 12-3.
VLINE: This is the line synchronous pulse signal between LCD controller and LCD driver, and it is used
by the LCD driver to transfer the contents of it's horizontal line shift register to the LCD panel for
display. The LCD controller asserts VLINE after an entire horizontal line of data has been shifted
into the LCD driver.
VCLK: This pin is the pixel clock signal between the LCD controller and LCD driver, and data is sent by
the LCD controller on the rising edge of VCLK and sampled by LCD driver on the falling edge of
VCLK.
VM: This is the AC signal for the LCD driver. The VM signal is used by the LCD driver to alternate
the polarity of the row and column voltage used to turn the pixel on and off. The VM signal can
be toggled on every frame or toggled on the programmable number of the VLINE signal.
VD[3:0]: These are LCD pixel data output ports. For a 4-bit or 8-bit single scan display, these 4-bit data
are used as the display data as shown in Fig. 12-4. In case of 4-bit dual scan display, these
4-bit
plays into its role of the upper display data as shown in Fig. 12-4.
VD[7:4]: These are LCD pixel data output ports. For a 8-bit single scan display, these data are used as
upper dispaly data as shown in Fig. 12-4. For a 4-bit dual scan display, these data are used
as lower display data as shown in Fig. 12-4.
12-2
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
BLOCK DIAGRAM
System Bus
VCLK
VLINE
REGBANK TIMEGEN VFRAME
VM
VD[3:0]
32
LCDCDMA VIDPRCS
32 32 VD[7:4]
The LCD controller within S3C44B0X is used to transfer the video data and to generate the necessary control signals
such as, VFRAME, VLINE, VCLK, and VM. As well as the control signals, S3C44B0X has the data ports of video
data, which are VD[7:0] as shown in Fig. 12-1. The LCD controller consists of a REGBANK, LCDCDMA, VIDPRCS,
and TIMEGEN (See Figure 12-1 LCD Controller Block Diagram). The REGBANK has 18 programmable register sets
which are used to configure the LCD controller. The LCDCDMA is a dedicated DMA, which it can transfer the video
data in frame memory to LCD driver, automatically. By using this special DMA, the video data can be displayed on
the screen without CPU intervention. The VIDPRCS receives the video data from LCDCDMA and sends the video
data through the VD[7:0] data ports to the LCD driver after changing them into a suitable data format, for example
4/8-bit single scan or 4-bit dual scan display mode. The TIMEGEN consists of programmable logic to support the
variable requirement of interface timing and rates commonly found in different LCD drivers. The TIMEGEN block
generates VFRAME, VLINE, VCLK, VM, and so on.
FIFO memory is present in the LCDCDMA. When FIFO is empty or partially empty, LCDCDMA requests data
fetching from the frame memory based on the burst memory transfer mode(Consecutive memory fetching of 4
words(16 bytes) per one burst request without allowing the bus mastership to another bus master during the bus
transfer). When this kind of transfer request is accepted by bus arbitrator in the memory controller, there will be four
successive word data transfers from system memory to internal FIFO. The total size of FIFO is 24 words, which
consists of FIFOL and FIFOH of 12 words. The S3C44B0X has two FIFOs because it needs to support the dual scan
display mode. In case of single scan mode, one of them can only be used.
12-3
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
TIMING GENERATOR
The TIMEGEN generates the control signals for LCD driver such as, VFRAME, VLINE, VCLK, and VM. These control
signals are closely related to the configuration on the LCDCON1/2 register in the REGBANK. Based on these
programmable configurations on the LCD control registers in REGBANK, the TIMEGEN can generate the
programmable control signals suitable to support many different types of LCD drivers.
The VFRAME pulse is asserted for a duration of the entire first line at a frequency of once per frame.
The VFRAME signal is asserted to bring the LCD's line pointer to the top of the display to start over.
The VM signal is used by the LCD driver to alternate the polarity of the row and column voltage used to turn the pixel
on and off. The toggle rate of VM signal can be controlled by using the MMODE bit of LCDCON 1 register and
MVAL[7:0] field of LCDSADDR 2 register. If the MMODE bit is 0, the VM signal is configured to toggle on every
frame. If the MMODE bit is 1, the VM signal is configured to toggle on the every number of VLINE signal by the
MVAL[7:0] value. Figure 12-3 shows an example for MMODE=0 and for MMODE=1 with the value of MVAL[7:0]=0x2.
When MMODE=1, the VM rate is related to MVAL[7:0], as shown below:
The VFRAME and VLINE pulse generation is controlled by the configurations of the HOZVAL field and the LINEVAL
field in the LCDCON2 register. Each field is related to the LCD size and display mode. In other words, the HOZVAL
and LINEVAL can be determined by the size of the LCD panel and the display mode according to the following
equation:
In case of 4-bit dual scan display the number of valid VD data line should be 4 and in case of 8-bit signal scan
display mode, the number of valid VD data lines should be 8.
LINEVAL = (Vertical display size) -1: In case of single scan display type
LINEVAL = (Vertical display size / 2) -1: In case of dual scan display type
The rate of VCLK signal can be controlled by the CLKVAL field in the LCDCON1 register. The Table 12-1 defines the
relationship of VCLK and CLKVAL. The minimum value of CLKVAL is 2.
VCLK(Hz)=MCLK/(CLKVAL x 2)
The frame rate is the VFRAM signal frequency. The frame rate is closely related to the field of WLH(VLINE pulse
width), WHLY(the delay width of VCLK after VLINE pulse), HOZVAL, VLINEBLANK, and LINEVAL in LCDCON1 and
LCDCON2 registers as well as VCLK and MCLK. Most LCD drivers need their own adequate frame rate. The frame
rate is calculated as follows;
12-4
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
VIDEO OPERATION
The LCD controller within S3C44B0X supports 8-bit color mode(256 color mode), 4 level gray scale mode, 16 level
gray scale mode as well as the monochrome mode. When the gray or color mode is needed, the time-based
dithering algorithm and FRC(Frame Rate Control) method can be used to implement the shades of gray or color from
which selection can be made by using a programmable lockup table, which will be explained later. The monochrome
mode bypasses these modules(FRC and lookup table) and basically serializes the data in FIFOH (and FIFOL if a
dual scan display type is used) into 4-bit (or 8-bit if a 4-bit dual scan or 8-bit single scan display type is used)
streams by shifting the video data to the LCD driver.
The following sections describe the operation on gray mode and color mode in terms of the lookup table and FRC.
Lookup Table
The S3C44B0X can support the palette table for various selection of color or gray level mapping. This kind of
selection gives users flexibility. The lookup table is the palette which allows the selection on the level of color or
gray(Selection on 4-gray levels among 16 gray levels in case of gray mode, selection on 8 red levels among 16
levels, 8 green levels among 16 levels and 4 blue levels among 16 levels in case of color mode). In other words, users
can select 4 gray levels among 16 gray levels by using the lookup table in the 4 gray level mode.The gray levels
cannot be selected in the 16 gray level mode; all 16 gray levels must be chosen among the possible 16 gray levels.
In case of 256 color mode, 3 bits are allocated for red, 3 bits for green and 2 bits for blue. The 256 colors mean that
the colors are formed from the combination of 8 red, 8 green and 4 blue levels(8x8x4 = 256). In the color mode, the
lookup table can be used for suitable selections. Eight red levels can be selected among 16 possible red levels, 8
green levels among 16 green levels, and 4 blue levels among 16 blue levels.
12-5
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
Similarly with the gray level display, 8 group or field of 4 bits in the REDLUR register, i.e., REDVAL[31:28],
REDLUT[27:24], REDLUT[23:20], REDLUT[19:16], REDLUT[15:12], REDLUT[11:8], REDLUT[7:4], and REDLUT[3:0],
are assigned to each red level. The possible combination of 4 bits(each field) is 16, and each red level should be
assigned to one level among possible 16 cases. In other words, the user can select the suitable red level by using
this type of lookup table. For green color, the GREENVAL[31:0] of the GREENLUT register is assigned as the
lookup table, as was done in the case of red color. Similarly, the BLUEVAL[15:0] of the BLUELUT register is also
assigned as a lookup table. For blue color, we need 16bit for a lookup table because 2 bits are allocated for 4 blue
levels, different from the 8 red or green levels.
12-6
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
The DITHFRC block has two functions, such as a Time-based Dithering Algorithm for reducing flicker and FRC(Frame
Rate Control) for displaying gray level on the STN panel. The main principle of gray level display on the STN panel
based on FRC is described. For example, to display the third gray(3/16) level from a total of 16 levels, the 3 times
pixel should be on and 13 times pixel off. In other words, 3 frames should be selected among the 16 frames, of which
3 frames should have a pixel-on on a specific pixel while the remaining 13 frames should have a pixel-off on a specific
pixel. These 16 frames should be displayed periodically. This is basic principle on how to display the gray level on
the screen, so-called gray level display by FRC(Frame Rate Control). The actual example is shown in Table 12-2. To
represent the 14th gray level in the table, we should have a 6/7 duty cycle, which mean that there are 6 times pixel-on
and one time pixel-off. The other cases for all gray levels are also shown in Table 12-2.
In the STN LCD display, we should be reminded of one item, i.e., Flicker Noise due to the simultaneous pixel-on and
-off on adjacent frames. For example, if all pixels on first frame are turned on and all pixels on next frame are turned
off, the Flicker Noise will be maximized. To reduce the Flicker Noise on the screen, the average probability of pixel-
on and -off between frames should be as same as possible. In order to realize this, the Time-based Dithering
Algorithm, which varies the pattern of adjacent pixels on every frame, should be used. This is explained in detail. For
the 16 gray level, FRC should have the following relationship between gray level and FRC. The 15th gray level should
always have pixel-on, and the 14th gray level should have 6 times pixel-on and one times pixel-off, and the 13th gray
level should have 4 times pixel-on and one times pixel-off, ,,,,,,,, , and the 0th gray level should always have pixel-off
as shown in Table 12-2. In Table 12-3, the DP1_2 corresponds to the 7th gray level because it has half the duty cycle
from having 2 times pixel-on and 2 times pixel-off. Also, the DP4_7 corresponds to 8th gray level because it has (4/7)
duty cycle from having 4 times pixel-on and 3 times pixel-off. Using the same methodology, the DP3_5, DP2_3,
DP5_7, DP3_4, DP4_5, and DP6_7 are made to correspond to 9th, 10th, 11th, 12th, 13th, and 14th gray level,
respectively. For the gray level from 1st to 6th, the reverse sequence of DP6_7, DP4_5, DP3_4, DP2_3, DP3_5, and
DP4_7 should be used; this way, new tables for gray level of 1st to 6th are not needed. The Table 12-7 shows that the
same pixel value can not have the same FRC sequence. For example, if the Pi pixel has half gray level in Nth frame,
and if adjacent pixel of Pi+1 also has half gray level in Nth frame, and if adjacent pixel of Pi+2 also has half gray level
in Nth frame, and if adjacent pixel of Pi+3 also has half gray level in Nth frame, the Pi, Pi+1, Pi+2, and Pi+3 pixel
should be 1, 0, 1, and 0 in Nth frame. In (N+1)th frame, the Pi, Pi+1, Pi+2, and Pi+3 pixel should be 0, 1, 0, and 1 as
shown in Table 12-3. In case of arbitrary pixel values on arbitrary position, the H/W will select a suitable display value
by referring to the corresponding frame number and pixel position. This type of display methodology can randomize
the pixel display to reduce the Flicker Noise. The value of table 12-3 is just only reference, and users can specify
their own value suitable for the LCD display.
12-7
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
DP1_2. The pre-dithered data 1111b has a dithering data '1' because the duty rate is 1. The pre-dithered data 0000b
has a dithering data 0 because the duty rate is 0. The pre-dithered data from 0001b to 1110b refer to DP6_7, DP4_5,
DP5_7, DP3_4, DP2_3, DP3_5, DP4_7, and DP1_2 registers for dithering data.(The dithering data are used to do
FRC.)
The DP6_7, DP4_5, DP5_7, DP3_4, DP2_3, DP3_5, DP4_7, and DP1_2, registers can also determine the duty
rates, such as 6/7, 4/5, 5/7, 3/4, 2/3, 3/5, and 4/7, respectively. For examples, 1/7 can be made by inverting 6/7.
1 1 1 1 5th FRAME
10th FRAME
.
0 1 0 1 4th FRAME .
9th FRAME .
.
1 0 1 0 3rd FRAME .
8th FRAME .
.
0 1 0 1 2nd FRAME .
7th FRAME .
.
1 0 1 0 1st FRAME .
6th FRAME .
11th FRAME
.
. NOTE: This figure is only explanation.
. The real operation is some different.
12-8
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
If the SELFREF bit is set to 1, the LCD controller enters into the self refresh mode from the next line. When the LCD
controller enters into the self refresh mode, the signal of VCLK and VD should be fixed as Low and last VD value, but
the signal of VM, VFRAME, and VLINE will be generated continuously. To exit the self refresh mode, the user should
execute the following path, 1) disable the ENVID bit in LCDCON 1 register , 2) disable SELFREF bit in LCDCON 3
register and 3) enable ENVID bit again in LCDCON 1 register.
Timing Requirements
Image data should be transferred from the memory to the LCD driver using the VD[7:0] signal. VCLK signal is used
to clock the data into the LCD driver's shift register. After each horizontal line of data has been shifted into the LCD
driver's shift register, the VLINE signal is asserted to display the line on the panel.
The VM signal provides an AC signal for the display. It is used by the LCD to alternate the polarity of the row and
column voltages, used to turn the pixels on and off, because the LCD plasma tends to deteriorate whenever
subjected to a DC voltage. It can be configured to toggle on every frame or to toggle every programmable number of
VLINE signals.
Figure 12-3 shows the timing requirements for the LCD driver interface.
12-9
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
VM
VM
VM LINECNT decreases
&
VLINE Display the last line of the previous Display the 1st line
frame
LINECNT
LINEBLANK
VCLK
WDLY WDLY
VM
VLINE WLH
VCLK
VD[7:0]
WDLY
12-10
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
Display Types
The LCD controller supports 3 types of LCD drivers: 4-bit dual scan, 4-bit single scan, and 8-bit single scan display
mode. Figure 12-4 shows these 3 different display types for monochrome displays, and figure 12-5 shows these 3
different display types for color displays.
Color displays
Color displays require 3 bits (Red, Green, Blue) of image data per pixel, resulting in a horizontal shift register of
length 3 times the number of pixels per horizontal line. This RGB is shifted to the LCD driver as consecutive bits via
the parallel data lines. Figure 12-5 shows the RGB and order of the pixels in the parallel data lines for the 3 types of
color displays.
12-11
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
12-12
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
1 Pixel
1 Pixel
1 Pixel
12-13
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
Address Data
0000H A[31:0]
0004H B[31:0]
L[31] L[30] ...... L[0] M[31] M[30] ...... M[0] ......
•
•
•
1000H L[31:0]
1004H M[31:0]
•
•
•
LCD Panel
A[31] A[30] A[29] ...... A[0] B[31] B[30] ...... B[0] C[31] ...... C[0] ......
Address Data
0000H A[31:0]
0004H B[31:0]
0008H C[31:0]
•
•
•
In color mode, 8 bits (3 bits of red, 3 bits of green, 2 bits of blue) of video data correspond to 1 pixel. The color data
format in a byte is as follows;
12-14
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
VIRTUAL DISPLAY
The S3C44B0X supports hardware horizontal or vertical scrolling. If the screen is scrolled, the fields of LCDBASEU
and LCDBASEL in LCDSADDR1/2 registers need to be changed(refer to Fig. 12-6) but not the values of
PAGEWIDTH and OFFSIZE.
The size of video buffer in which the image is stored should be larger than LCD panel screen size.
PAGEWIDTH OFFSIZE
This is the data of line 1 of virtual screen. This is the data of line 1 of virtual screen.
This is the data of line 2 of virtual screen. This is the data of line 2 of virtual screen.
This is the data of line 3 of virtual screen. This is the data of line 3 of virtual screen.
This is the data of line 4 of virtual screen. This is the data of line 4 of virtual screen. LINEVAL + 1
This is the data of line 5 of virtual screen. This is the data of line 5 of virtual screen.
This is the data of line 6 of virtual screen. This is the data of line 6 of virtual screen.
This is the data of line 7 of virtual screen. This is the data of line 7 of virtual screen.
This is the data of line 8 of virtual screen. This is the data of line 8 of virtual screen.
View Port
This is the data of line 9 of virtual screen. This is the data of line 9 of virtual screen. (The same size
of LCD panel)
This is the data of line 10 of virtual screen. This is the data of line 10 of virtual screen.
This is the data of line 11 of virtual screen. This is the data of line 11 of virtual screen.
LCDBASEU .
.
. Before Scrolling
LCDBASEL
This is the data of line 1 of virtual screen. This is the data of line 1 of virtual screen.
This is the data of line 2 of virtual screen. This is the data of line 2 of virtual screen.
This is the data of line 3 of virtual screen. This is the data of line 3 of virtual screen.
This is the data of line 4 of virtual screen. This is the data of line 4 of virtual screen.
This is the data of line 5 of virtual screen. This is the data of line 5 of virtual screen.
This is the data of line 6 of virtual screen. This is the data of line 6 of virtual screen.
This is the data of line 7 of virtual screen. This is the data of line 7 of virtual screen.
This is the data of line 8 of virtual screen. This is the data of line 8 of virtual screen.
This is the data of line 9 of virtual screen. This is the data of line 9 of virtual screen.
This is the data of line 10 of virtual screen. This is the data of line 10 of virtual screen.
This is the data of line 11 of virtual screen. This is the data of line 11 of virtual screen.
.
.
. After Scrolling
12-15
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
12-16
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
12-17
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
NOTES:
1. LCDBANK can't be changed while ENVID=1
2. If LCDBASEU,LCDBASEL is changed during ENVID=1, the new value will be used next frame. If you use serveral frame
buffer for better display quality and if you write the previous frame memory just after changing LCDBASEU,LCDBASEL,
the items drawn on the previous frame memory may be shown. To avoid th is undesirable phenomen, you may have to
check LINECNT.
12-18
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
NOTE: Users can change the LCDBASEU and LCDBASEL values for scrolling while LCD controller is turned on. But,
users
must not change the LCDBASEU and LCDBASEL registers at the end of FRAME by referring to the LINECNT field
in LCDCON1 register. Because of the LCD FIFO fetches the next frame data prior to the change in the frame.
So, if you change the frame, the pre-fetched FIFO data will be obsolete and LCD controller will display the incorrect
screen. To check the LINECNT, interrutpt should be masked. If any interrupt is executed just after reading
LINECNT, the read LINECNT value may be obsolete because of the execution time of ISR(interrupt service routine).
12-19
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
NOTE: The values of PAGEWIDTH and OFFSIZE must be changed when ENVID bit is 0.
12-20
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
12-21
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
12-22
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
12-23
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
12-24
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
The CLKVAL value determines the frequency of VCLK. The data transmission rate for the VD port of the LCD
controller should be calculated, in order to determine the value of CLKVAL register.
CLKVAL has to be determined, such that the VCLK value is greater than the data transmission rate.
Mode MV Value
Mono, 4-bit single scan display 1/4
Mono, 8-bit single scan display or 4-bit dual scan display 1/8
4 level gray, 4-bit single scan display 1/4
4 level gray, 8-bit single scan display or 4-bit dual scan display 1/8
16 level gray, 4-bit single scan display 1/4
16 level gray, 8-bit single scan display or 4-bit dual scan display 1/8
Color, 4-bit single scan display 3/4
Color, 8-bit single scan display or 4-bit dual scan display 3/8
12-25
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
The LCDBASEU register value is the first address value of the frame buffer. The lowest 4 bits must be eliminated for
burst 4 word access. The LCDBASEL register value is determined by LCD size and LCDBASEU. The LCDBASEL
value is given by the following equation:
Example 1:
160 x 160pixel, 4-level gray, 80 frame/sec, 4-bit single scan display, system clock frequency = 66 MHz,
WLH = 1, WDLY = 1, LCD frame buffer = SDRAM, Bus width = 16bit.
System bus occupation = (LCD data transmission frequency) / (System clock frequency)
LCD data transmission frequency = (Total LCD data during 1sec) x (Transmission cycle / 1byte)
Total LCD data during 1sec = Total LCD data x frame rate
= 160 x 160pixel x (2bit / 1pixel) x 80Hz x (1byte / 8bit) = 512Kbyte
Transmission clock per 4word = Trp(=2clk) + Trcd(=2clk) + C/L(=2clk) + Burst cycle(=8clk) = 14clk
NOTE: The higher the system load is, the lower the CPU performance is.
4 -level gray, 4-bit single scan display, Vertual screen size = 1024 x 1024, LCD size = 320 x 240,
LCDBASEU = 0x64.
LCDBASEL = LCDBASEU + (PAGEWIDTH + OFFSIZE) x (LINEVAL +1) = 100 + (40 +88) x 240 = 0x3C64
12-26
S3C44B0X RISC MICROPROCESSOR LCD CONTROLLER
S3C44B0X LCD controller can generate 16 gray level using FRC(frame rate control). The FRC characteristics may
cause unexpected patterns in gray level. These unwanted erronous patterns may be shown in fast response LCD or
at lower frame rates.
Because the quality of LCD gray levels depends on LCD's own characteristics, the user may have to select the good
gray levels after viewing all gray levels on user's own LCD.
Please select the gray level quality through the following procedures.
12-27
LCD CONTROLLER S3C44B0X RISC MICROPROCESSOR
NOTES
12-28
S3C44B0X RISC MICROPROCESSOR A/D CONVERTER
13 A/D CONVERTER
OVERVIEW
The 10-bit CMOS ADC(Analog to Digital Converter) of S3C44B0X consists of a 8-channel analog input multiplexer,
auto-zeroing comparator, clock generator, 10 bit successive approximation register (SAR), and output register. This
ADC provides software-selection power-down(sleep) mode.
FEATURES
— Resolution: 10-bit
— Differential Linearity Error: ± 1 LSB
— Integral Linearity Error: ± 2 LSB ( Max. ± 3 LSB)
— Maximum Conversion Rate: 100 KSPS
— Input voltage range: 0-2.5V
— Input bandwidth: 0-100 Hz (without S/H(sample&hold) circuit)
— Low Power Consumption
13-1
A/D CONVERTER S3C44B0X RISC MICROPROCESSOR
BLOCK DIAGRAM
Figure 13-1 shows the functional block diagram of S3C440BX A/D converter. Note that the reference positive voltage
REFT and reference negative voltage RETB are applied internally by A/D converter power supply and ground, so no
power is applied to REFT and REFB pins. Also REFT, REFB, and analog common voltage VCOM should be
connected to bypass capacitors respectively because of voltage level stability.
AMUX
8 +
AIN[7:0]
DAC COMP
-
VCOM
FUNCTION DESCRIPTIONS
66 MHz / 2(20+1) / 16(at least 16 cycle by 10-bit operation) = 98.2 KHz = 10.2 us
NOTE: Because this A/D converter has no sample-and-hold circuit, analog input frequency should not exceed
100Hz for accurate conversion although the maximum conversion rate is 100KSPS.
13-2
S3C44B0X RISC MICROPROCESSOR A/D CONVERTER
Sleep Mode
The ADC sleep mode is activated by setting the SLEEP bit, ADCCON[5], to '1'. In this mode, the conversion clock is
disabled and A/D conversion operation is halted. The A/D converter data register contains the previous data in sleep
mode.
NOTE: After the ADC exits the sleep mode(ADCCON[5]=1? 0 ), there is 10ms wait for the ADC reference voltage
stabilization before the first AD conversion.
a) The FLAG will be 1 for one ADC clock time just after the ADC conversion is started. This is not correct.
b) The FLAG will be 1 one ADC clock time ago than the ADC conversion is completed. This is not correct.
This problem will be shown conspicuously only if the ADCPSR is large. To read ADC converted data correctly ,
please refer to the following codes;
13-3
A/D CONVERTER S3C44B0X RISC MICROPROCESSOR
1. There is no sample & hold circuit on the ADC input pin. So, The small current will flow in/out from AINn input
pins because of the ADC internal operation. If the output impedance of source signal is high, this current will
change the signal voltage. The current is about 7.6uA in the following condition.
1) This ADC error will be decreased if the output impedance of the signal source is reduced. For example, If
the output impedance of the signal source is 1Kohm, the induced ADC error by the ADC input current is
3(1/10).
2) The current will be also decreased if ADCPSR is large. If the ADC conversion rate is 30KSPS,
the current will be about 1.2uA. The ADCPSR value is higher, the current is lower.
2. The ADC conversion error is decreased if the ADCPSR is large beside the above ADC conversion error. If you
want accurate ADC conversion, you let the ADCPSR as large as possible.
3. Because our ADC have no sample&hold circuit, the input frequency bandwidth is 0~100Hz. This limitation is
because there is no internal sample&hold circuit. But, If you can ignore the small ADC error(or an external S/H
circuit is used), the higher frequency signal can be converted.
4. If the ADC channel is changed, the channel setup time(min. 15us) is needed. So, If the ADC channel is
changed, you must wait for 15us and then start AD conversion.
5. After the ADC exits the sleep mode(the initial state is the sleep mode), there is 10ms wait for the ADC reference
voltage stabilization before the first AD conversion.
6. Our ADC has ADC start-by-read feature. This feature can be used for DMA to move the ADC data to memory.
7. If you read the ADCDAT by polling method, you must apply the work-around for ADC data reading problem.
13-4
S3C44B0X RISC MICROPROCESSOR A/D CONVERTER
NOTES:
1. The ADCCON register can be accessed by halfword and word unit using STRB/STRH/STR and LDRB/LDRH/LDR
instructions or char/short int/int type pointer in the Little/Big endian mode.
2. (Li/B/HW/W): Access by char/halfword/word unit when the endian mode is Little.
(Bi/B/HW/W): Access by char/halfword/word unit when the endian mode is Big.
13-5
A/D CONVERTER S3C44B0X RISC MICROPROCESSOR
NOTES:
1. The ADCPSR register can be accessed by halfword and word unit using STRB/STRH/STR and LDRB/LDRH/LDR
instructions or char/short int/int type pointer in Little/Big endian mode.
2. (Li/HW/W): Access by char/halfword/word unit when the endian mode is Little.
(Bi/HW/W): Access by char/halfword/word unit when the endian mode is Big.
After A/D conversion is completed, the ADCDAT reads the converted data. ADCDAT has to be read after the
conversion has been completed.
NOTES:
1. The ADCDAT register can be accessed by halfword and word unit using STRH/STR and LDRH/LDR instructions or
short int/int type pointer in Little/Big endian mode.
2. (Li/HW/W): Access by halfword/word unit when the endian mode is Little.
(Bi/HW/W): Access by halfword/word unit when the endian mode is Big.
13-6
S3C44B0X RISC MICROPROCESSOR REAL TIME CLOCK
OVERVIEW
The RTC (Real Time Clock) unit can be operated by the backup battery while the system power is off. The RTC can
transmit 8-bit data to CPU as BCD (Binary Coded Decimal) values using the STRB/LDRB ARM operation. The data
include second, minute, hour, date, day, month, and year. The RTC unit works with an external 32.768 KHz crystal
and also can perform the alarm function.
FEATURES
14-1
REAL TIME CLOCK S3C44B0X RISC MICROPROCESSOR
TIME TICK
TICNT Time Tick Generator
128 Hz RTCRST
215 Clock Divider Reset Register Leap Year Generator
XTAL
1Hz
RTCCON RTCALM
This block can determine whether the last date of each month is 28, 29, 30, or 31, based on data from BCDDAY,
BCDMON, and BCDYEAR. This block considers the leap year in deciding on the last date. An 8-bit counter can only
represent 2 BCD digits, so it cannot decide whether 00 year is a leap year or not. For example, it can not
discriminate between 1900 and 2000. To solve this problem, the RTC block in S3C44B0X has hard-wired logic to
support the leap year in 2000. Please note 1900 is not leap year while 2000 is leap year. Therefore, two digits of 00
in S3C44B0X denote 2000, not 1900.
READ/WRITE REGISTERS
Bit 0 of the RTCCON register must be set in order to read and write the register in RTC block. To display the sec.,
min., hour, date, month, and year, the CPU should read the data in BCDSEC, BCDMIN, BCDHOUR, BCDDAY,
BCDDATE, BCDMON, and BCDYEAR registers, respectively, in the RTC block. However, a one second deviation
may exist because multiple registers are read. For example, when the user reads the registers from BCDYEAR to
BCDMIN, the result is assumed to be 1959(Year), 12(Month), 31(Date), 23(Hour) and 59(Minute). When the user
read the BCDSEC register and the result is a value from 1 to 59(Second), there is no problem, but, if the result is 0
sec., the year, month, date, hour, and minute may be changed to 1960(Year), 1(Month), 1(Date), 0(Hour) and
0(Minute) because of the one second deviation that was mentioned. In this case, user should re-read from
BCDYEAR to BCDSEC if BCDSEC is zero.
The RTC logic can be driven by the backup battery, which supplies the power through the RTCVDD pin into RTC
block, even if the system power is off. When the system off, the interfaces of the CPU and RTC logic should be
blocked, and the backup battery only drives the oscillation circuit and the BCD counters to minimize power
dissipation.
14-2
S3C44B0X RISC MICROPROCESSOR REAL TIME CLOCK
ALARM FUNCTION
The RTC generates an alarm signal at a specified time in the power down mode or normal operation mode. In normal
operation mode, the alarm interrupt (ALMINT) is activated. In the power down mode the power management wakeup
(PMWKUP) signal is activated as well as the ALMINT. The RTC alarm register, RTCALM, determines the alarm
enable/disable and the condition of the alarm time setting.
The RTC tick time is used for interrupt request. The TICNT register has an interrupt enable bit and the count value for
the interrupt. The count value reaches '0' when the tick time interrupt occurs. Then the period of interrupt is as follow:
This RTC time tick may be used for RTOS(real time operating system) kernel time tick. If time tick is generated by
RTC time tick, the time related function of RTOS will always synchronized with real time.
The round reset function can be performed by the RTC round reset register, RTCRST. The round boundary (30, 40, or
50 sec) of the second carry generation can be selected, and the second value is rounded to zero in the round reset.
For example, when the current time is 23:37:47 and the round boundary is selected to 40 sec, the round reset
changes the current time to 23:38:00.
NOTE
All RTC registers have to be accessed by the byte unit using the STRB,LDRB instructions or char type
pointer.
The Figure 14-2 is an example circuit of the RTC unit oscillation at 32.768Khz.
15-22 pF
XTAL1
32,768 Hz
EXTAL1
14-3
REAL TIME CLOCK S3C44B0X RISC MICROPROCESSOR
The RTCCON register consists of 4 bits such as the RTCEN, which controls the read/write enable of the BCD
registers, CLKSEL, CNTSEL, and CLKRST for testing.
RTCEN bit can control all interfaces between the CPU and the RTC, so it should be set to 1 in an RTC control
routine to enable data read/write after a system reset. Also before power off, the RTCEN bit should be cleared to 0 to
prevent inadvertent writing into RTC registers.
NOTES:
1. All RTC registers have to be accessed by byte unit using STRB and LDRB instructions or char type pointer.
2. (L): When the endian mode is little endian.
(B): When the endian mode is Big endian.
14-4
S3C44B0X RISC MICROPROCESSOR REAL TIME CLOCK
RTCALM register determines the alarm enable and the alarm time. Note that the RTCALM register generates the
alarm signal through both ALMINT and PMWKUP in power down mode, but only through ALMINT in the normal
operation mode.
14-5
REAL TIME CLOCK S3C44B0X RISC MICROPROCESSOR
14-6
S3C44B0X RISC MICROPROCESSOR REAL TIME CLOCK
14-7
REAL TIME CLOCK S3C44B0X RISC MICROPROCESSOR
14-8
S3C44B0X RISC MICROPROCESSOR REAL TIME CLOCK
14-9
REAL TIME CLOCK S3C44B0X RISC MICROPROCESSOR
14-10
S3C44B0X RISC MICROPROCESSOR WATCHDOG TIMER
15 WATCHDOG TIMER
OVERVIEW
The S3C44B0X watchdog timer is used to resume the controller operation when it had been disturbed by
malfunctions such as noise and system errors. It can be used as a normal 16-bit interval timer to request interrupt
service. The watchdog timer generates the reset signal for 128 MCLK cycles.
FEATURES
15-1
WATCHDOG TIMER S3C44B0X RISC MICROPROCESSOR
The functional block diagram of the watchdog timer is shown in Figure 15-1. The watchdog timer uses MCLK as its
only source clock. To generate the corresponding watchdog timer clock, the MCLK frequency is prescaled first, and
the resulting frequency is divided again.
WTDAT
MUX
1/16 Interrupt
1/32
MCLK 8-bit Prescaler WTCNT
Reset Signal Generator RESET
1/64 (Down Counter)
1/128
The prescaler value and the frequency division factor are specified in the watchdog timer control register, WTCON.
The valid prescaler values range from 0 to 28-1. The frequency division factor can be selected as 16, 32, 64, or 128.
Use the following equation to calculate the watchdog timer clock frequency and the duration of each timer clock
cycle:
When the watchdog timer is enabled first, the value of WTDAT (watchdog timer data register) cannot be
automatically reloaded into the WTCNT (timer counter). For this reason, an initial value must be written to the
watchdog timer count register, WTCNT, before the watchdog timer starts.
When S3C44B0X is in debug mode using Embedded ICE, the watchdog timer must not operate.
The watchdog timer can determine whether or not the current mode is the debug mode from the CPU core signal
(DBGACK signal). Once the DBGACK signal is asserted, the reset output of the watchdog timer is not activated
when the watchdog timer is expired.
15-2
S3C44B0X RISC MICROPROCESSOR WATCHDOG TIMER
Using the watchdog Timer Control register, WTCON, you can enable/disable the watchdog timer, select the clock
signal from 4 different sources, enable/disable interrupts, and enable/disable the watchdog timer output.
The watchdog timer is used to resume the S3C44B0X restart on mal-function after power-on; if controller restart is
not desired, the watchdog timer should be disabled.
If the user wants to use the normal timer provided by the watchdog timer, please enable the interrupt and disable the
watchdog timer.
15-3
WATCHDOG TIMER S3C44B0X RISC MICROPROCESSOR
The watchdog timer data register, WTDAT is used to specify the time-out duration. The content of WTDAT can not
be automatically loaded into the timer counter at initial watchdog timer operation. However, the first time-out occurs
by using 0x8000(initial value), after then the value of WTDAT will be automatically reloaded into WTCNT.
The watchdog timer count register, WTCNT, contains the current count values for the watchdog timer during normal
operation. Note that the content of the watchdog timer data register cannot be automatically loaded into the timer
count register when the watchdog timer is enabled initially, so the watchdog timer count register must be set to an
initial value before enabling it.
15-4
S3C44B0X RISC MICROPROCESSOR IIC-BUS INTERFACE
16 IIC-BUS INTERFACE
OVERVIEW
The S3C44B0X RISC microprocessor can support a multi-master IIC-bus serial interface. A dedicated serial data
line(SDA) and a serial clock line (SCL) carry information between bus masters and peripheral devices which are
connected to the IIC-bus. The SDA and SCL lines are bi-directional.
In multi-master IIC-bus mode, multiple S3C44B0X RISC microprocessors can receive or transmit serial data to or
from slave devices. The master S3C44B0X, which can initiate a data transfer over the IIC-bus, is responsible for
terminating the transfer. Standard bus arbitration procedure is used in this IIC-bus in S3C44B0X.
To control multi-master IIC-bus operations, values must be written to the following registers:
When the IIC-bus is free, the SDA and SCL lines should be both at High level. A High-to-Low transition of SDA can
initiate a Start condition. A Low-to-High transition of SDA can initiate a Stop condition while SCL remains steady at
High Level.
The Start and Stop conditions can always be generated by the master devices. A 7-bit address value in the first data
byte, which is put onto the bus after the Start condition has been initiated, can determine the slave device which the
bus master device has selected. The 8th bit determines the direction of the transfer (read or write).
Every data byte put onto the SDA line should total eight bits. The number of bytes which can be sent or received
during the bus transfer operation is unlimited. Data is always sent from most-significant bit (MSB) first, and every
byte should be immediately followed by an acknowledge (ACK) bit.
16-1
IIC-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
Address Register
Comparator
IIC-Bus Control Logic
SCL
MCLK IICCON IICSTAT 4-bit Prescaler Shift Register SDA
Shift Register
(IICDS)
Data Bus
Note: The IIC data hold time (tSDAH) is minimum 0ns. (Refer to figure 19-52.)
1. The IIC data hold time (tSDAH) is minimum 0ns.
Please check the data hold time of your IIC device.
(IIC data hold time is minimum 0ns for standard/fast bus mode in IIC specification v2.1.)
2. The IIC controller supports only IIC bus device (standard/ fast bus mode), not C bus device.
16-2
S3C44B0X RISC MICROPROCESSOR IIC-BUS INTERFACE
When the IIC-bus interface is inactive, it is usually in slave mode. In other words, the interface should be in slave
mode before detecting a Start condition on the SDA line.(A Start condition can be initiated with a High-to-Low
transition of the SDA line while the clock signal of SCL is High) When the interface state is changed to the master
mode, a data transfer on the SDA line can be initiated and SCL signal generated.
A Start condition can transfer a one-byte serial data over the SDA line, and a stop condition can terminate the data
transfer. A stop condition is a Low-to-High transition of the SDA line while SCL is High. Start and Stop conditions are
always generated by the master. The IIC-bus is busy when a Start condition is generated. A few clocks after a Stop
condition, the IIC-bus will be free, again.
When a master initiates a Start condition, it should send a slave address to notify the slave device. The one byte of
address field consist of a 7-bit address and a 1-bit transfer direction indicator (that is, write or read).
If bit 8 is 0, it indicates a write operation(transmit operation); if bit 8 is 1, it indicates a request for data read(receive
operation).
The master will finish the transfer operation by transmitting a Stop condition. If the master wants to continue the data
transmission to the bus, it should generate another Start condition as well as a slave address. In this way, the read-
write operation can be performed in various formats.
SDA SDA
SCL SCL
Start Stop
Condition Condition
16-3
IIC-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
Every byte placed on the SDA line should be eight bits in length. The number of bytes which can be transmitted per
transfer is unlimited. The first byte following a Start condition should have the address field. The address field can be
transmitted by the master when the IIC-bus is operating in master mode. Each byte should be followed by an
acknowledgement (ACK) bit. The MSB bit of the serial data and addresses are always sent first.
"0"
(Write) Data Transferred
(Data + Acknowledge)
Write Mode Format with 10-bit Addresses
Slave Address Slave Address
S R/W A A DATA A P
1st 7 bits 2nd Byte
11110XX "0"
(Write) Data Transferred
(Data + Acknowledge)
Read Mode Format with 7-bit Addresses
"1"
(Read) Data Transferred
(Data + Acknowledge)
NOTES:
1. S: Start, rS: Repeat Start, P: Stop, A: Acknowledge
2. : From Master to Slave, : from Slave to Master
16-4
S3C44B0X RISC MICROPROCESSOR IIC-BUS INTERFACE
SDA
SCL 1 2 7 8 9 1 2 9
S ACK
To finish a one-byte transfer operation completely, the receiver should send an ACK bit to the transmitter. The ACK
pulse should occur at the ninth clock of the SCL line. Eight clocks are required for the one-byte data transfer. The
master should generate the clock pulse required to transmit the ACK bit.
The transmitter should release the SDA line by making the SDA line High when the ACK clock pulse is received. The
receiver should also drive the SDA line Low during the ACK clock pulse so that the SDA is Low during the High
period of the ninth SCL pulse.
The ACK bit transmit function can be enabled or disabled by software (IICSTAT). However, the ACK pulse on the
ninth clock of SCL is required to complete a one-byte data transfer operation.
Clock to Output
Data Output by
Transmitter
Data Output by
Receiver
SCL from 1 2 7 8 9
Master S
Start
Condition
Clock Pulse for Acknowledgment
16-5
IIC-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
READ-WRITE OPERATION
In the transmitter mode, after the data is transferred, the IIC-bus interface will wait until IICDS(IIC-bus Data Shift
Register) is written by a new data. Until the new data is written, the SCL line will be held low. After the new data is
written to IICDS register, the SCL line will be released. The S3C44B0X should hold the interrupt to identify the
completion of current data transfer. After the CPU receives the interrupt request, it should write a new data into
IICDS, again.
In the receive mode, after a data is received, the IIC-bus interface will wait until IICDS register is read. Until the new
data is read out, the SCL line will be held low. After the new data is read out from IICDS register, the SCL line will be
released. The S3C44B0X should hold the interrupt to identify the completion of the new data reception. After the CPU
receives the interrupt request, it should read the data from IICDS.
Arbitration takes place on the SDA line to prevent the contention on the bus between two masters. If a master with a
SDA High level detects another master with a SDA active Low level, it will not initiate a data transfer because the
current level on the bus does not correspond to its own. The arbitration procedure will be extended until the SDA line
turns High.
However when the masters simultaneously lower the SDA line, each master should evaluate whether or not the
mastership is allocated to itself. For the purpose of evaluation, each master should detect the address bits. While
each master generates the slaver address, it should also detect the address bit on the SDA line because the
lowering of SDA line is stronger than maintaining High on the line. For example, one master generates a Low as first
address bit, while the other master is maintaining High. In this case, both masters will detect Low on the bus
because Low is stronger than High even if first master is trying to maintain High on the line. When this happens,
Low(as the first bit of address) -generating master will get the mastership and High(as the first bit of address) -
generating master should withdraw the mastership. If both masters generate Low as the first bit of address, there
should be an arbitration for second address bit, again. This arbitration will continue to the end of last address bit.
ABORT CONDITIONS
If a slave receiver can not acknowledge the confirmation of the slave address, it should hold the level of the SDA line
High. In this case, the master should generate a Stop condition and to abort the transfer.
If a master receiver is involved in the aborted transfer, it should signal the end of the slave transmit operation by
canceling the generation of an ACK after the last data byte received from the slave. The slave transmitter should then
release the SDA to allow a master to generate a Stop condition.
To control the frequency of the serial clock (SCL), the 4-bit prescaler value can be programmed in the IICCON
register. The IIC-bus interface address is stored in the IIC-bus address register, IICADD. (By default, the IIC-bus
interface address is an unknown value.)
16-6
S3C44B0X RISC MICROPROCESSOR IIC-BUS INTERFACE
The following steps must be executed before any IIC tx/rx operations.
START
Y
Stop?
N
Write new data Write 0xD0 (M/T Stop) to
transmitted to IICDS IICSTAT
END
16-7
IIC-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
START
Y
Stop?
N
Read new data from Write 0x90 (M/R Stop) to
IICDS IICSTAT
END
16-8
S3C44B0X RISC MICROPROCESSOR IIC-BUS INTERFACE
START
N
Matched?
Y
The IIC address match
interrupt is generated
Y
Stop?
N
The data of the IICDS is END
shifted to SDA
Interrupt is pending
16-9
IIC-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
START
N
Matched?
Y
The IIC address match
interrupt is generated
Read IICDS
Y
Stop?
Interrupt is pending
16-10
S3C44B0X RISC MICROPROCESSOR IIC-BUS INTERFACE
NOTES:
1. Interfacing with EEPROM, the ack generation may be disabled before reading the last data in order to generate the
STOP condition in Rx mode.
2. A IIC-bus interrupt occurs 1)when a 1 -byte transmit or receive operation is completed, 2)when a general call or a slave
address match occurs, or 3) if bus arbitration fails.
3. To time the setup time of IICSDA before IISSCL rising edge, IICDS has to be written before clearing the IIC interrupt
pending bit.
4. IICCLK is determined by IICCON[6].
Tx clock can vary by SCL transition time.
When IICCON[6]=0, IICCON[3:0]=0x0 or 0x1 is not available.
5. If the IICON[5]=0, IICON[4] does not operate correctly.
So, It is recommended to set IICCON[5]=1, although you does not use the IIC interrupt.
16-11
IIC-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
16-12
S3C44B0X RISC MICROPROCESSOR IIC-BUS INTERFACE
16-13
IIC-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
NOTES
16-14
S3C44B0X RISC MICROPROCESSOR IIS-BUS INTERFACE
17 IIS-BUS INTERFACE
OVERVIEW
Many digital audio systems are introduced into the consumer audio market, including compact disc, digital audio
tapes, digital sound processors, and digital TV sound. The S3C44B0X IIS(Inter-IC Sound) bus interface can be used
to implement a CODEC interface to an external 8/16-bit stereo audio CODEC IC for mini-disc and portable
applications. It supports the IIS bus data format and MSB-justified data format. IIS bus interface provides DMA
transfer mode for FIFO access instead of an interrupt. It can transmit or receive data simultaneously as well as
transmit or receive only.
FEATURES
17-1
IIS-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
BLOCK DIAGRAM
ADDR TxFIFO
DATA IISDI
BRFC SFTR
CNTL IISDO
RxFIFO CHNC
IISCLK
IPSR_A
MCLK SCLKG IISLRCK
IPSR_B
CODECLK
FUNCTIONAL DESCRIPTIONS
Bus interface, register bank, and state machine(BRFC) - Bus interface logic and FIFO access are controlled by the
state machine.
3-bit dual prescaler(IPSR) - One prescaler is used as the master clock generator of the IIS bus interface and the
other is used as the external CODEC clock generator.
16-byte FIFOs(TXFIFO, RXFIFO) - In transmit data transfer, data are written to TXFIFO, and, in the receive data
transfer, data are read from RXFIFO.
Master IISCLK generaor(SCLKG) - In master mode, serial bit clock is generated from the master clock.
Channel generator and state machine(CHNC) - IISCLK and IISLRCK are generated and controlled by the channel
state machine.
16-bit shift register(SFTR) - Parallel data is shifted to serial data output in the transmit mode, and serial data input is
shifted to parallel data in the receive mode.
Normal transfer
IIS control register has FIFO ready flag bits for transmit and receive FIFO. When FIFO is ready to transmit data, the
FIFO ready flag is set to '1' if transmit FIFO is not empty.
If transmit FIFO is empty, FIFO ready flag is set to '0'. When receive FIFO is not full, the FIFO ready flag for receive
FIFO is set to '1' ; it indicates that FIFO is ready to receive data. If receive FIFO is full, FIFO ready flag is set to '0'.
These flags can determine the time that CPU is to write or read FIFOs. Serial data can be transmitted or received
while CPU is accessing transmit and receive FIFOs in this way.
17-2
S3C44B0X RISC MICROPROCESSOR IIS-BUS INTERFACE
DMA transfer
In this mode, transmit or receive FIFO access is made by the DMA controller. DMA service request in transmit or
receive mode is made by the FIFO ready flag automatically.
In this mode, IIS bus interface can transmit and receive data simultaneously. Because one DMA source is assigned,
normal FIFO write is done in the transmit channel, and DMA receive FIFO read is done in the receive channel and
vice versa.
IIS-BUS FORMAT
The IIS bus has four lines, serial data input(IISDI), serial data output(IISDO), left/right channel select(IISLRCK), and
serial bit clock(IISCLK); the device generating IISLRCK and IISCLK is the master.
Serial data is transmitted in 2's complement with the MSB first. The MSB is transmitted first because the transmitter
and receiver may have different word lengths. It is not necessary for the transmitter to know how many bits the
receiver can handle, nor does the receiver need to know how many bits are being transmitted.
When the system word length is greater than the transmitter word length, the word is truncated(least significant data
bits are set to '0') for data transmission. If the receiver is sent more bits than its word length, the bits after the LSB
are ignored. On the other hand, if the receiver is sent fewer bits than its word length, the missing bits are set to zero
internally. And so, the MSB has a fixed position, whereas the position of the LSB depends on the word length. The
transmitter always sends the MSB of the next word at one clock period after the IISLRCK change.
Serial data sent by the transmitter may be synchronized with either the trailing (HIGH to LOW) or the leading (LOW
to HIGH) edge of the clock signal. However, the serial data must be latched into the receiver on the leading edge of
the serial clock signal, and so there are some restrictions when transmitting data that is synchronized with the
leading edge.
The LR channel select line indicates the channel being transmitted. IISLRCK may change either on a trailing or
leading edge of the serial clock, but it does not need to be symmetrical. In the slave, this signal is latched on the
leading edge of the clock signal. The IISLRCK line changes one clock period before the MSB is transmitted. This
allows the slave transmitter to derive synchronous timing of the serial data that will be set up for transmission.
Furthermore, it enables the receiver to store the previous word and clear the input for the next word.
MSB(LEFT) JUSTIFIED
MSB/left justified bus has the same lines as the IIS format. It is only different with the IIS bus that transmitter always
sends the MSB of the next word when the IISLRCK change.
17-3
IIS-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
SCLK
SCLK
Master clock frequency(MCLK) can be selected by sampling frequency as shown in Table 17-1. Because MCLK is
made by IIS prescaler, the prescaler value and MCLK type(256 or 384fs) should be determined properly. Serial bit
clock frequency type(16/32/48fs) can be selected by the serial bit per channel and MCLK as shown in Table 17-2.
IISLRCK 8.000 11.025 16.000 22.050 32.000 44.100 48.000 64.000 88.200 96.000
(fs) KHz KHz KHz KHz KHz KHz KHz KHz KHz KHz
256fs
CODECLK 2.0480 2.8224 4.0960 5.6448 8.1920 11.2896 12.2880 16.3840 22.5792 24.5760
(MHz) 384fs
3.0720 4.2336 6.1440 8.4672 12.2880 16.9344 18.4320 24.5760 33.8688 36.8640
17-4
S3C44B0X RISC MICROPROCESSOR IIS-BUS INTERFACE
NOTES:
1. The IISCON register can be accessed by halfword and word unit using STRH/STR and LDRH/LDR
instructions or char/short int/int type pointer in Little/Big endian mode.
2. (Li/HW/W): Access by halfword/word unit when the endian mode is Little.
(Bi/HW/W): Access by halfword/word unit when the endian mode is Big.
17-5
IIS-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
NOTES:
1. The IISMOD register can be accessed by halfword and word unit using STRH/STR and LDRH/LDR instructions or short
int/int type pointer in Little/Big endian mode.
2. (Li/HW/W): Access by halfword/word unit when the endian mode is Little.
(Bi/HW/W): Access by halfword/word unit when the endian mode is Big.
17-6
S3C44B0X RISC MICROPROCESSOR IIS-BUS INTERFACE
0000b 2 1000b 1
0001b 4 1001b –
0010b 6 1010b 3*
0011b 8 1011b –
0100b 10 1100b 5*
0101b 12 1101b –
0110b 14 1110b 7*
0111b 16 1111b –
NOTES:
1. If the prescaler value is 3,5,7, the duty is not 50%. In this case, the H duration is 0.5 MCLK.
2. The IISPSR register can be accessed by byte, halfword and word unit using STRB/STRH/STR and LDRB/LDRH/LDR
instructions or char/short int/int type pointer in Little/Big endian mode.
3. (Li/B/HW/W): Access by byte/halfword/word unit when the endian mode is Little.
(Bi/B/HW/W): Access by byte/halfword/word unit when the endian mode is Big.
17-7
IIS-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
1) Disable the FIFO. If you want to transmit the data remained in FIFO, you must not disable the FIFO and skip
this stop 1.
2) Disable DMA request in IISCON register.
3) Disable IIS interface start in IISCON register.
NOTES:
1. The IISFCON register can be accessed by halfword and word unit using STRH/STR and LDRH/LDR instructions or
short
int/int type pointer in Little/Big endian mode.
2. (Li/HW/W): Access by halfword/word unit when the endian mode is Little.
(Bi/HW/W): Access by halfword/word unit when the endian mode is Big.
17-8
S3C44B0X RISC MICROPROCESSOR IIS-BUS INTERFACE
IIS bus interface contains two 16-byte FIFO for the transmit and receive mode. Each FIFO has 16-width and 8-depth
form, which allows the FIFO to handles data by halfword unit regardless of valid data size. Transmit and receive FIFO
access is performed through FIFO entry; the address of FENTRY is 0x01D18010.
NOTES:
1. The IISFIF register can be accessed by halfword and word unit using STRH and LDRH instructions or short int type
pointer in Little/Big endian mode.
2. (Li/HW): Access by halfword unit when the endian mode is Little.
(Bi/HW): Access by halfword unit when the endian mode is Big.
17-9
IIS-BUS INTERFACE S3C44B0X RISC MICROPROCESSOR
NOTES
17-10
S3C44B0X RISC MICROPROCESSOR SIO
OVERVIEW
The S3C44B0X SIO (synchronous IO) can interface with various types of external devices that requires serial data
transfer. The SIO module can transmit or receive 8bit serial data at a frequency determined by its corresponding
control register settings. To ensure flexible data transmission rates, you can select an internal or external clock
source.
FEATURES
SIORDY
SIO Control Logic
SIOCK
MUX
SIORXD
Data Bus
18-1
SIO S3C44B0X RISC MICROPROCESSOR
The serial output data comes through a serial input pin(SIORXD) and goes out through a serial output pin,
synchronously by serial clock pin (SIOCK). After transmitting or receiving data, the SIO interrupt request is activated
if a programmer enables an interrupt source.
Transmitting always occurs with reception. If you want only to transmit, you may treat the received data as dummy.
The transmission frequency is controlled by making the appropriate bit settings to the SIOCON and SBRDR
registers. The serial interface can be operated by an internal or external clock source. If the internal clock signal is
used, you can modify its frequency to adjust the baud rate data register value.
Programming Procedure
When a byte data is written into the SIODAT register, SIO starts to transmit if the SIO run bit is set and the transmit
mode bit is enabled.
18-2
S3C44B0X RISC MICROPROCESSOR SIO
START
DCNTZ[n] = 0
Setting SIOCON
(SIOCON = xx 1xxx00b)
BDMA Setting
SIOCON =
xxxxxx 10b or xxxxxx 11b
(auto start)
N
DMAcount == 0
DCNTZ[n] = 1
END
18-3
SIO S3C44B0X RISC MICROPROCESSOR
1. DCNTZ[n] is cleared to 0, which allows the SIO to request the DMA service. The SIO is configured properly. But
the value of SIOCON[1:0] has to be 00b.
2. DMA is configured properly.
3. The SIO is configured in DMA receive only mode.
4. Set SIOCON[3] (SIO start bit) to start the receiving operation.
5. The SIO requests the DMA service after 8-bit data has been received.
6. Go to step 5 until DMA count is 0.
7. DCNTZ[n] is set to 1, which stops the SIO from requesting further DMA service.
START
DCNTZ[n] = 0
Setting SIOCON
(SIOCON = xxxxxx 00b)
BDMA Setting
SIOCON =
xxxxx 110 or xxxxx 111
(manual start)
N
DMAcount == 0
DCNTZ[n] = 1
END
18-4
S3C44B0X RISC MICROPROCESSOR SIO
SIOCLK
SIOCON Transmit
Start Bit Complete
SIOCLK
SIOCON Transmit
Start Bit Complete
18-5
SIO S3C44B0X RISC MICROPROCESSOR
Interval Time
~
~
SIOCLK
~
~
SIOTXD
SIORXD
~ ~
~ ~
SIOCON Transmit
Start Bit Complete
18-6
S3C44B0X RISC MICROPROCESSOR SIO
18-7
SIO S3C44B0X RISC MICROPROCESSOR
Before transmitting, the SIO data register (SIODAT) contains an 8-bit data value to be transmitted. After transmitting
is completed, the SIODAT has the received data or dummy data.
The baud rate prescaler register (SBRDR) determines SIO clock rate (baud rate) as follows.
In the auto run mode, the SIO inserts this interval after transmitting every 8-bit data.
18-8
S3C44B0X RISC MICROPROCESSOR SIO
When SIO operates in DMA mode, the corresponding DCNTZ bit has to be 0 initially. When DMA terminal count is
reached, the corresponding DCNTZ bit has to be set to 1.
18-9
SIO S3C44B0X RISC MICROPROCESSOR
NOTES
18-10
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
19 ELECTRICAL DATA
19-1
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
Type B6 IOH = -6 mA
Type B4 IOL = 4 mA
Type B6 IOL = 6 mA
NOTE: Type B4 means 4mA output driver cell, and Type B8 means 8mA output driver cells.
19-2
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
Peri IIS IIC ADC RTC UART1 SIO ZDMA0/1 Timer012345 LCD Total
Current saving 1.3% 1.6% 0.7% 0.8% 3.8% 0.9% 2.2% 2.2% 3.2% 16.7
NOTE: This table includes each power consumption of each peripherals. For example, If you do not use IIS and you turned
off IIS block by CLKCON register, you can save the 1.3% portion from total power consumption.
19-3
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
MCLK(MHz)
80
75
70
66
60
50
40 Spec. Guranteed
Area
30
20
10
1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7
VDDCPU(V)
19-4
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
tXTALCYC
t EXTCYC
tEXTHIGH tEXTLOW
19-5
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
EXTCLK
tEX2CK
CLKout
tEX2SCK
tSCK2CK
SCLK
Figure 19-4. EXTCLK/CLKout/SCLK in the case that EXTCLK is used without the PLL
MCLK
tEX2CK
CLKout
tEX2SCK
tSCK2CK
SCLK
Figure 19-5. MCLK/CLKout/SCLK in the case that EXTCLK is used with the PLL
EXTCLK
t RESW
nRESET
tMDRH
OM[3:0]
19-6
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
Power
PLL can operate after OM[3:2] is latched.
nRESET
...
OSC
Clock tOSC1
Disable
VCO is adapted to new clock frequency.
VCO ...
output
t RST2RUN
...
Fout
MCU operates by OSC clcok. Fout is new frequency.
19-7
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
OSC
Wake-up
Clock
Disable t OSC2
VCO
Output
16 OSC clocks
Fout
19-8
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
tRAD
tRDH
tRCD
tRDS
tROD
tRAD
tRDH
tRDS
tRAD
tRDH
tRDS
tRAD
tRDH
tRDS
tRDH
tRAD
tRDS
tRAD
tRDH
tRDS
tRAD
tRDH
tRDS
tRAD
tRDH
tRDS
tRCD
tROD
tRAD
Tacc
'1'
EXTCLK
nGCSx
ADDR
DATA
nBEx
nOE
19-9
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
tRBED
tRAD
tRDH
tRCD
tRDS
tROD
tRAD
tRDH
tRDS
tRAD
tRDH
tRDS
tRAD
tRDH
tRDS
tRDH
tRAD
tRDS
tRAD
tRDH
tRDS
tRAD
tRDH
tRDS
tRAD
tRDH
tRDS
tRBED
tRCD
tROD
tRAD
Tacc
EXTCLK
nGCSx
ADDR
DATA
nBEx
nOE
19-10
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
EXTCLK
tHZD
ADDR
'HZ'
tHZD
nGS
'HZ'
tHZD
nOE
'HZ'
tXnBRQH
tXnBRQS
XnBREQ
tXnBACKD tXnBACKD
XnBACK
19-11
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
EXTCLK
tRAD tRAD
ADDR
tRCD tRCD
nGS
Tacs
Tcah
tROD tROD
nOE
Tcos
Tacc Toch
nBE '1'
tRDS
DATA
tRDH
EXTCLK
tRAD tRAD
ADDR
tRCD tRCD
nGCSx
Tacs
Tcah
tROD tROD
nOE
Tcos
Tacc Toch
tRBED tRBED
nBEx
Tcos
Toch
tRDS
DATA
tRDH
19-12
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
EXTCLK
tRAD tRAD
ADDR
tRCD tRCD
nGCSx
Tacs
Tcah
tRWD tRWD
nWE
Tcos
Tacc Toch
tRWBED tRWBED
nBEx
Tcos
Toch
tRDD tRDD
DATA
EXTCLK
tRAD tRAD
ADDR
tRCD tRCD
nGCSx
Tacs
Tcah
tRWD tRWD
nWE
Tcos
Tacc Toch
tRBED tRBED
nBEx
Tcos
Toch
tRDD tRDD
DATA
19-13
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
EXTCLK
tRC
ADDR
nGCSx
Tacs
delayed
Tacc = 6cycle
nOE
Tcos
sampling nWait
nWait
DATA
EXTCLK
ADDR
nGCSx
tWH
tWS
nWait
tRDD
DATA
tRDD
19-14
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
Tcas Tcp
Tcas Tcp Tcas Tcp
Tcas Tcp
Tcas Tcp
Tcas Tcp
Tcas Tcp
tDDH
tDDS
Tcas Tcp
tDRCD
tDRD
Trcd
tDAD
tDOD
EXTCLK
nRASx
nCASx
ADDR
DATA
nOE
19-15
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
EXTCLK
tHZD
ADDR
'HZ'
tHZD
nRASx
'HZ'
tHZD
nCASx
'HZ'
tHZD
nOE
'HZ'
tXnBRQS tXnBRQH
XnBREQ tXnBRQL
tXnBACKD tXnBACKD
XnBACK
Figure 19-19. External Bus Request in DRAM Cycle (Trcd=3, Tcas=2, Tcp=1, Trp=4.5)
EXTCLK
tDRD tDRD
nRASx
nCASx
nOE
tDDS
DATA
tDDH
Figure 19-20. DRAM(FP) Single READ Timing (Trcd=3, Tcas=2, Tcp=1, Trp=4.5, MT=01b)
19-16
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
EXTCLK
tDRD tDRD
nRASx
nCASx
nOE
tDDS
DATA
tDDH
Figure 19-21. DRAM(EDO) Single READ Timing (Trcd=3, Tcas=2, Tcp=1, Trp=4.5, MT=10b)
EXTCLK
ADDR
tDRD tDRD
nRASx
Trp
tDCCD tDCCD
nCASx
Tchr
nOE/nWE '1'
19-17
19-18
ELECTRICAL DATA
EXTCLK
Trp Trcd
Trcd tDRCD tDRCD
tDRCD tDRCD tDRCD tDRCD tDRCD
nCASx
nOE
Figure 19-23. DRAM(EDO) Page Hit-Miss READ Timing (Trcd=2, Tcas=2, Tcp=1, Trp=3.5, MT=10b)
S3C44B0X RISC MICROPROCESSOR
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
EXTCLK
ADDR
tDRD tDRD
nRASx
Trp
tDCCD tDCCD
nCASx
EXTCLK
tDRD tDRD
nRASx
nCASx
nWE
tDDD tDDD
DATA
19-19
19-20
ELECTRICAL DATA
EXTCLK
Trp Trcd
Trcd tDWCD tDWCD tDWCD
tDWCD tDWCD tDWCD tDWCD
nCASx
nWE
EXTCLK
tRAD tRAD
ADDR
tRCD
nGCSx
Tacs
tROD
nOE
Tcos
Tacc
tRDS
DATA
tRDH
Figure 19-27. Masked-ROM Single READ Timing (Tacs=2, Tcos=2, Tacc=8, PMC=01/10/11b)
EXTCLK
tRCD
nGCSx
tROD
nOE
DATA
19-21
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
tSDH
tSDS
Tcl
tSBED
tSCD
Trcd
Trp
tSCSD
tSWD
tSRD
tSAD
tSAD
'1'
ADDR/BA
A10/AP
nSRAS
nSCAS
nGCSx
SCKE
DATA
SCLK
nBEx
nWE
Figure 19-29. SDRAM Single Burst READ Timing (Trp=2, Trcd=2, Tcl=2, DW=16bit)
19-22
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
EXTCLK
tHZD
SCLK 'HZ'
tHZD
SCKE '1'
tHZD 'HZ'
ADDR/
BA 'HZ'
tHZD
A10/AP
'HZ'
tHZD
nGCSx
'HZ'
tHZD
nSRAS
'HZ'
tHZD
nSCAS
'HZ'
tHZD
nBEx
'HZ'
tHZD
nWE
'HZ'
tXnBRQS tXnBRQH
XnBREQ tXnBRQL
XnBACK
tXnBACKD tXnBACKD
Figure 19-30. External Bus Request in SDRAM Timing (Trp=2, Trcd=2, Tcl=2)
19-23
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
SCLK
SCKE '1'
tSAD tSAD
ADDR/BA
tSAD
A10/AP
tSCSD tSCSD
nGCSx
tSRD tSRD
nSRAS
tSCD
nSCAS
nBEx '1'
tSWD tSWD
nWE
DATA
'HZ'
19-24
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
SCLK
SCKE '1'
tSAD tSAD tSAD tSAD
ADDR/BA
tSAD tSAD
A10/AP
nGCSx
tSRD tSRD
nSRAS
Trp Trcd
tSCD
nSCAS
tSBED
nBEx
Tcl
tSWD
nWE
tSDS
DATA
tSDH
19-25
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
SCLK
SCKE '1'
tSAD tSAD tSAD tSAD
ADDR/BA
tSAD tSAD
A10/AP
nGCSx
tSRD tSRD
nSRAS
Trp Trcd
tSCD
nSCAS
tSBED
nBEx
Tcl
tSWD
nWE
tSDS
DATA
tSDH
19-26
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
SCLK
SCKE '1'
tSAD tSAD
ADDR/BA
tSAD
A10/AP
tSCSD tSCSD
nGCSx
tSRD tSRD
nSRAS
'1'
Trp Trc
tSCD
nSCAS
nBEx '1'
tSWD
nWE
DATA
'HZ'
NOTE: Before executing auto/self refresh command, all banks must be idle state.
19-27
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
Tcl
tSDH
tSDS
Tcl
Tcl
tSBED
tSCD
Trcd
Trp
tSCSD
tSWD
tSAD
tSRD
tSAD
'1'
ADDR/BA
A10/AP
nSRAS
nSCAS
nGCSx
SCKE
DATA
SCLK
nBEx
nWE
Figure 19-35. SDRAM Page Hit-Miss READ Timing (Trp=2, Trcd=2, Tcl=2)
19-28
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
SCLK
tCKED tCKED
SCKE
tSAD tSAD
ADDR/BA
tSAD
A10/AP
tSCSD tSCSD
nGCSx '1'
tSRD tSRD
nSRAS '1'
'1'
Trc
Trp
tSCD
nSCAS '1'
tSWD
nWE '1'
DATA
'HZ' 'HZ'
NOTE: Before executing auto/self refresh command, all banks must be idle state.
19-29
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
SCLK
SCKE '1'
tSAD tSAD tSAD tSAD
ADDR/BA
tSAD tSAD
A10/AP
nGCSx
tSRD tSRD
nSRAS
Trp Trcd
tSCD
nSCAS
tSBED
nBEx
tSWD
nWE
tSDD
DATA
tSDD
19-30
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
tSDD
tSBED
tSCD
tSDD
Trcd
Trp
tSCSD
tSWD
tSAD
tSRD
tSAD
'1'
ADDR/BA
A10/AP
nSRAS
nSCAS
nGCSx
SCKE
DATA
SCLK
nBEx
nWE
Figure 19-38. SDRAM Page Hit-Miss Write Timing (Trp=2, Trcd=2, Tcl=2)
19-31
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
MCLK
tXRS
tXAS
XnDREQ
tCADL tCADH
XnDACK
tACCR tACCW
tXAD
MCLK
tXAS
XnDREQ
tCADH
XnDACK
tACCW tWAH
Figure 19-40. External DMA Timing (Handshake, Unit transfer/Block mode II)
MCLK
tXRS
tXAS
XnDREQ
tCADL tCADH
XnDACK
19-32
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
MCLK
XnDREQ
tCADL tCADH
XnDACK
tACCR
tXAD
MCLK
tXRS tXRH
XnDREQ
tCADL tCADH
XnDACK
Figure 19-43. External DMA Timing (Single Step , Unit /Block/On-the-fly mode II)
MCLK
tXRS
XnDREQ
tCADL tCADH
XnDACK
Figure 19-44. External DMA Timing (Single Step , Unit /Block/On-the-fly mode III)
19-33
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
MCLK
tXRS
XnDREQ
tCADL tCADH
XnDACK
MCLK
tXRS
XnDREQ
tCADL tCADH
XnDACK
Figure 19-46. External DMA Timing (Demand, On The Fly mode II)
19-34
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
MCLK
tXRS tXRS
XnDREQ
tCADL tCADH
XnDACK
tACCR tACCW
tXAD
MCLK
tXRS
XnDREQ
tCADL tCADH
XnDACK
Figure 19-48. External DMA Timing (Demand, Unit transfer/Block mode II)
19-35
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
MCLK
tXRS
XnDREQ
tCADL tCADH
XnDACK
MCLK
tXRS
XnDREQ
tCADL tCADH
XnDACK
19-36
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
t F2CDLY
VFRAME
t M2CDLY
VM
VLINE
tVCLKCYC
VCLK
tC2DDLY
VD
tSCL
tSCLHIGH tSCLLOW
IICSCL
tSTOPH
tBUF tSDAS tSDAH
tSTARTS
IICSDA
19-37
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
EXTCLK
tRDYIS t RDYIH
nXWAIT t RDYIW
tSIOCKO
SIOCK
tSIOTXD
SIOTXD
CODECLK
IISCLK
IISLRCK
tLRCK
IISDO
tSDO
IISDI
tSDIS tSDIH
19-38
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
the interval before CPU runs after nRESET is tRST2RUN – 132 – MCLK
released.
19-39
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
19-40
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
19-41
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
HZ Delay tHZD – 7 – ns
19-42
S3C44B0X RISC MICROPROCESSOR ELECTRICAL DATA
NOTE: Std. means Standard Mode and fast means Fast Mode.
19-43
ELECTRICAL DATA S3C44B0X RISC MICROPROCESSOR
NOTES
19-44
S3C44B0X RISC MICROPROCESSOR MECHANICAL DATA
20 MECHANICAL DATA
PACKAGE DIMENSIONS
26.00 ± 0.20
0-7
24.00 ± 0.10 + 0.073
0.127 - 0.037
26.00± 0.20
24.00 ± 0.10
0.45-0.75
#160
#1 + 0.07
0.20 - 0.03
0.05-0.15
0.50 0.08 MAX (2.25)
1.40 ± 0.05
1.60 MAX
NOTE: Dimensions are in millimeters.
20-1
MECHANICAL DATA S3C44B0X RISC MICROPROCESSOR
20-2
S3C44B0X RISC MICROPROCESSOR MECHANICAL DATA
NOTE: To get more specific information for testing the FBGA/TQFP package using JTAG, Please contact us.
20-3
MECHANICAL DATA S3C44B0X RISC MICROPROCESSOR
NOTES
20-4