S3C4510B01-QER0 [SAMSUNG]

Micro Peripheral IC, PQFP208,;
S3C4510B01-QER0
型号: S3C4510B01-QER0
厂家: SAMSUNG    SAMSUNG
描述:

Micro Peripheral IC, PQFP208,

文件: 总422页 (文件大小:2160K)
中文:  中文翻译
下载:  下载PDF数据表文档文件
S3C4510B  
PRODUCT OVERVIEW  
1
PRODUCT OVERVIEW  
OVERVIEW  
Samsung's S3C4510B 16/32-bit RISC microcontroller is a cost-effective, high-performance microcontroller  
solution for Ethernet-based systems. An integrated Ethernet controller, the S3C4510B, is designed for use in  
managed communication hubs and routers.  
The S3C4510B is built around an outstanding CPU core: the 16/32-bit ARM7TDMI RISC processor designed by  
Advanced RISC Machines, Ltd. The ARM7TDMI core is a low-power, general purpose microprocessor macro-cell  
that was developed for use in application-specific and custom-specific integrated circuits. Its simple, elegant, and  
fully static design is particularly suitable for cost-sensitive and power-sensitive applications.  
The S3C4510B offers a configurable 8K-byte unified cache/SRAM and Ethernet controller which reduces total  
system cost. Most of the on-chip function blocks have been designed using an HDL synthesizer and the  
S3C4510B has been fully verified in Samsung's state-of-the-art ASIC test environment.  
Important peripheral functions include two HDLC channels with buffer descriptor, two UART channels, 2-channel  
GDMA, two 32-bit timers, and 18 programmable I/O ports. On-board logic includes an interrupt controller, DRAM/  
SDRAM controller, and a controller for ROM/SRAM and flash memory. The System Manager includes an internal  
32-bit system bus arbiter and an external memory controller.  
The following integrated on-chip functions are described in detail in this user's manual:  
— 8K-byte unified cache/SRAM  
— I2C interface  
— Ethernet controller  
— HDLC  
— GDMA  
— UART  
— Timers  
— Programmable I/O ports  
— Interrupt controller  
1-1  
PRODUCT OVERVIEW  
S3C4510B  
FEATURES  
Architecture  
·
·
·
·
·
·
·
·
·
·
Data alignment logic  
·
Integrated system for embedded ethernet  
applications  
Endian translation  
100/10-Mbit per second operation  
·
·
Fully 16/32-bit RISC architecture  
Full compliance with IEEE standard 802.3  
MII and 7-wire 10-Mbps interface  
Station management signaling  
On-chip CAM (up to 21 destination addresses)  
Full-duplex mode with PAUSE feature  
Long/short packet modes  
Little/Big-Endian mode supported basically, the  
internal architecture is big-endian.  
So, the little-endian mode only support for  
external memory.  
·
·
·
Efficient and powerful ARM7TDMI core  
Cost-effective JTAG-based debug solution  
Boundary scan  
PAD generation  
System Manager  
HDLCs  
·
8/16/32-bit external bus support for  
ROM/SRAM, flash memory, DRAM, and  
external I/O  
·
HDLC protocol features:  
— Flag detection and synchronization  
— Zero insertion and deletion  
·
One external bus master with bus request/  
acknowledge pins  
— Idle detection and transmission  
— FCS generation and detection (16-bit)  
— Abort detection and transmission  
·
·
·
·
Support for EDO/normal or SDRAM  
Programmable access cycle (0-7 wait cycles)  
Four-word depth write buffer  
·
·
·
·
·
·
Address search mode (expandable to 4 bytes)  
Selectable CRC or No CRC mode  
Automatic CRC generator preset  
Digital PLL block for clock recovery  
Baud rate generator  
Cost-effective memory-to-peripheral DMA  
interface  
Unified Instruction/Data Cache  
·
·
·
Two-way, set-associative, unified 8K-byte cache  
Support for LRU (least recently used) protocol  
Cache is configurable as an internal SRAM  
NRZ/NRZI/FM/Manchester data formats for  
Tx/Rx  
·
·
·
·
·
·
·
·
·
·
Loop-back and auto-echo modes  
Tx/Rx FIFOs have 8-word (8 ´ 32-bit) depth  
Selectable 1-word or 4-word data transfer mode  
Data alignment logic  
I2C Serial Interface  
·
·
Master mode operation only  
Baud rate generator for serial clock generation  
Endian translation  
Programmable interrupts  
Ethernet Controller  
Modem interface  
·
·
DMA engine with burst mode  
Up to 10 Mbps operation  
DMA Tx/Rx buffers (256 bytes Tx, 256 bytes  
Rx)  
HDLC frame length based on octets  
·
MAC Tx/Rx FIFO buffers (80 bytes Tx, 16 bytes  
Rx)  
2-channel DMA buffer descriptor for Tx/Rx on  
each HDLC  
1-2  
S3C4510B  
PRODUCT OVERVIEW  
DMA Controller  
Programmable I/O  
·
2-channel General DMA for memory-to-  
memory, memory-to-UART, UART-to-memory  
data transfers without CPU intervention  
·
·
18 programmable I/O ports  
Pins individually configurable to input, output, or  
I/O mode for dedicated signals  
·
·
Initiated by a software or external DMA request  
Interrupt Controller  
Increments or decrements a source or  
destination address in 8-bit, 16-bit or 32-bit data  
transfers  
·
21 interrupt sources, including 4 external  
interrupt sources  
·
4-data burst mode  
·
·
Normal or fast interrupt mode (IRQ, FIQ)  
Prioritized interrupt handling  
UARTs  
·
Two UART (serial I/O) blocks with DMA-based  
or interrupt-based operation  
PLL  
·
The external clock can be multiplied by on-chip  
·
Support for 5-bit, 6-bit, 7-bit, or 8-bit serial data  
transmit and receive  
PLL to provide high frequency system clock  
·
·
The input frequency range is 10–40 MHz  
·
·
·
·
·
·
·
Programmable baud rates  
1 or 2 stop bits  
The output frequency is 5 times of input clock.  
To get 50 MHz, input clock frequency should be  
10 MHz.  
Odd or even parity  
Break generation and detection  
Parity, overrun, and framing error detection  
´ 16 clock mode  
Operating Voltage Range  
3.3 V ± 5 %  
·
Infra-red (IR) Tx/Rx support (IrDA)  
Operating Temperature Range  
° °  
0 C to + 70 C  
·
Timers  
·
·
Two programmable 32-bit timers  
Interval mode or toggle mode operation  
Operating Frequency  
Up to 50 MHz  
·
Package Type  
208-Pin QFP  
·
1-3  
PRODUCT OVERVIEW  
S3C4510B  
ARM7TDMI  
32-bit RISE CPU  
ICE-  
Breaker  
6-bank  
ROM  
SRAM  
FLASH  
32-Bit  
Sytem  
Bus  
CPU Interface  
4-bank  
DRAM  
Memory  
Controller  
with  
Refresh  
Control  
8-Kbyte  
Unified  
Cache  
4-bank  
External  
I/O  
Device  
4-Word  
Write  
Buffer  
Ext Bus  
REQ/ACK  
External  
Bus  
Master  
System  
Bus  
Arbiter  
Bus Rounter  
I2C  
2-Channel HDLCs  
with DMAs  
Remote  
port A,B  
SCL  
SDA  
Ethernet Controller  
2-channel BDMA  
18 I/O Ports including  
4: Ext INT req.  
2: Timer out (0,1)  
2: Ext DMA REQ.  
2: Ext DMA ACK  
18 General I/O ports  
Interruput Controller  
UART 0,1  
BDMA RAMs  
Tx Buffer (256 bytes)  
Rx Buffer (256 bytes)  
CAM (128 bytes)  
Console  
32-bit Timer 0,1  
GDMA 0,1  
MAC  
Tx FIFO (80 bytes)  
Rx FIFO (16 bytes)  
MII or  
7-wire  
PLL  
Xtal OSC  
TAP Controller for JTAG  
Figure 1-1. S3C4510B Block Diagram  
1-4  
S3C4510B  
PRODUCT OVERVIEW  
156  
155  
154  
153  
152  
151  
150  
149  
148  
147  
146  
145  
144  
143  
142  
141  
140  
139  
138  
137  
136  
135  
134  
133  
132  
131  
130  
129  
128  
127  
126  
125  
124  
123  
122  
121  
120  
119  
118  
117  
116  
115  
114  
113  
112  
111  
110  
109  
VDD  
VSS  
VDD  
VSS  
1
2
3
4
5
6
7
8
XDATA<16>  
XDATA<15>  
XDATA<14>  
XDATA<13>  
XDATA<12>  
XDATA<11>  
XDATA<10>  
XDATA<9>  
XDATA<8>  
XDATA<7>  
XDATA<6>  
VSS  
nUADTR1  
UATXD1  
nUADSR1  
nDTRA  
RXDA  
nRTSA  
TXDA  
nCTSA  
VDD  
VSS  
nDCDA  
RXCA  
nSYNCA  
TXCA  
nDTRB  
RTDB  
nRTSB  
TXDB  
VDD  
VSS  
nCTSB  
nDCDB  
RXCB  
nSYNCB  
TXCB  
9
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
VDD  
XDATA<5>  
XDATA<4>  
XDATA<3>  
XDATA<2>  
XDATA<1>  
XDATA<0>  
XDATA<21>  
XDATA<20>  
XDATA<19>  
XDATA<18>  
VSS  
S3C4510B  
208-QFP  
VDD  
ADDR<17>  
ADDR<16>  
ADDR<15>  
ADDR<14>  
ADDR<13>  
ADDR<12>  
ADDR<11>  
ADDR<10>/AP  
ADDR<9>  
ADDR<8>  
VSS  
CRS/CRS_ 10M  
RX DV/LINK_10M  
RXD<0>/RXD_10M  
VDD  
VSS  
RXD<1>  
RXD<2>  
RXD<3>  
RX ERR  
RX_CLK/RXCLK_10M  
COL/COL_10M  
TXD<0>/TXD_10M  
TXD<1>/LOOP_10M  
VDD  
VDD  
ADDR<7>  
ADDR<6>  
ADDR<5>  
ADDR<4>  
ADDR<3>  
ADDR<2>  
ADDR<1>  
ADDR<0>  
ExtMACK  
VSS  
TXD<2>  
TXD<3>  
TX_ERR/POCMP_10M  
TX_CLK/TXCLK_10M  
TX_EN/TXEN_10M  
MDIO  
108  
107  
106  
105  
ExtMREQ  
nWBE<3>/DQM<3>  
VSS  
LITTLE  
MDC  
VDD  
49  
50  
51  
52  
VDD  
VSS  
Figure 1-2. S3C4510B Pin Assignment Diagram  
1-5  
PRODUCT OVERVIEW  
S3C4510B  
SIGNAL DESCRIPTIONS  
Table 1-1. S3C4510B Signal Descriptions  
Signal  
Pin No.  
Type  
Description  
XCLK  
80  
I
S3C4510B system clock source. If CLKSEL is Low, PLL output  
clock is used as the S3C4510B internal system clock. If  
CLKSEL is High, XCLK is used as the S3C4510B internal  
system clock.  
MCLKO/SDCLK (note)  
CLKSEL  
77  
83  
82  
O
I
System clock out. MCLKO is monitored with some delay as the  
same phase of internal system clock, MCLK(SCLK).  
SDCLK is system clock for SDRAM.  
Clock select. When CLKSEL is '0'(low level), PLL output clock  
can be used as the master clock. When CLKSEL is '1'(high  
level), the XCLK is used as the master clock.  
nRESET  
I
Not reset. nRESET is the global reset input for the S3C4510B.  
To allow a system reset, and for internal digital filtering,  
nRESET must be held to low level for at least 64 master clock  
cycles. Refer to "Figure 3. S3C4510B reset timing diagram" for  
more details about reset timing.  
CLKOEN  
TMODE  
76  
63  
I
I
Clock out enable/disable. (see the pin description for MCLKO.)  
Test Mode. The TMODE bit settings are interpreted as follows:  
'0' = normal operating mode, '1' = chip test mode.  
This TMODE pin also can be used to change MF of PLL.  
To get 5 times internal system clock from external clock, '0'(low  
level) should be assigned to TMODE. If '1'(high level), MF will  
be changed to 6.6  
FILTER  
TCK  
55  
58  
AI  
I
If the PLL is used, 820pF ceramic capacitor should be  
connected between the pin and analog ground(pin # 54).  
JTAG Test Clock. The JTAG test clock shifts state information  
and test data into, and out of, the S3C4510B during JTAG test  
operations. This pin is internally connected pull-down.  
TMS  
TDI  
59  
60  
I
I
JTAG Test Mode Select. This pin controls JTAG test operations  
in the S3C4510B. This pin is internally connected pull-up.  
JTAG Test Data In. The TDI level is used to serially shift test  
data and instructions into the S3C4510B during JTAG test  
operations. This pin is internally connected pull-up.  
TDO  
61  
62  
O
I
JTAG Test Data Out. The TDO level is used to serially shift test  
data and instructions out of the S3C4510B during JTAG test  
operations.  
nTRST  
JTAG Not Reset. Asynchronous reset of the JTAG logic.  
This pin is internally connected pull-up.  
1-6  
S3C4510B  
PRODUCT OVERVIEW  
Table 1-1. S3C4510B Signal Descriptions (Continued)  
Signal  
Pin No.  
Type  
Description  
ADDR[21:0]/  
ADDR[10]/AP (note)  
117–110,  
129–120,  
135–132  
O
Address Bus. The 22-bit address bus, ADDR[21:0], covers the full  
4M word address range of each ROM/SRAM, flash memory,  
DRAM, and the external I/O banks.  
The 23-bit internal address bus used to generate DRAM address.  
The number of column address bits in DRAM bank can be  
programmed 8bits to 11bits use by DRAMCON registers.  
ADDR[10]/AP is the auto precharge control pin. The auto  
precharge command is issued at the same time as burst read or  
burst write by asserting high on ADDR[10]/AP.  
XDATA[31:0]  
141–136,  
154–144,  
166–159,  
175–169  
I/O  
External (bi-directional, 32-bit) Data Bus. The S3C4510B data  
bus supports external 8-bit, 16-bit, and 32-bit bus sizes.  
nRAS[3:0]/  
94, 91, 90,  
89  
O
O
Not Row Address Strobe for DRAM. The S3C4510B supports up  
to four DRAM banks. One nRAS output is provided for each  
bank. nSDCS[3:0] are chip select pins for SDRAM.  
nSDCS[3:0] (note)  
nCAS[3:0]  
98, 97, 96,  
95  
Not column address strobe for DRAM. The four nCAS outputs  
indicate the byte selections whenenver a DRAM bank is  
accessed. nSDRAS is row address strobe signal for SDRAM.  
Latches row addresses on the positive going edge of the SDCLK  
with nSDRAS low. Enable row access and precharge. nSDCAS is  
column address strobe for SDRAM. Latches column addresses  
on the positive going edge of the SDCLK with nSDCAS low.  
Enables column access. CKE is clock enable signal for SDRAM.  
Masks SDRAM system clock, SDCLK to freeze operation from  
the next clock cycle. SDCLK should be enabled at least one cycle  
prior to new command. Disable input buffers of SDRAM for  
power down in standby.  
nCAS[0]/nSDRAS  
nCAS[1]/nSDCAS  
nCAS[2]/CKE (note)  
nDWE  
99  
O
O
DRAM Not Write Enable. This pin is provided for DRAM bank  
write operations. (nWBE[3:0] is used for write operations to the  
ROM/ SRAM/flash memory banks.) .  
nECS[3:0]  
70, 69, 68,  
67  
Not External I/O Chip Select. Four external I/O banks are  
provided for external memory-mapped I/O operations. Each I/O  
bank stores up to 16 Kbytes. nECS signals indicate which of the  
four external I/O banks is selected.  
nEWAIT  
71  
I
Not External Wait. This signal is activated when an external I/O  
device or ROM/SRAM/flash bank 5 needs more access cycles  
than those defined in the corresponding control register.  
When de-assert the nEWAIT, you must synchronize the nEWAIT  
with MCLKO rising edge. If not, memory state machine can get  
into the Wrong State.  
1-7  
PRODUCT OVERVIEW  
S3C4510B  
Table 1-1. S3C4510B Signal Descriptions (Continued)  
Signal  
Pin No.  
Type  
Description  
nRCS[5:0]  
88-84, 75  
O
Not ROM/SRAM/Flash Chip Select. The S3C4510B can access  
up to six external ROM/SRAM/Flash banks. By controlling the  
nRCS signals, you can map CPU addresses into the physical  
memory banks.  
B0SIZE[1:0]  
nOE  
74, 73  
72  
I
Bank 0 Data Bus Access Size. Bank 0 is used for the boot  
program. You use these pins to set the size of the bank 0 data  
bus as follows: '01' = one byte, '10' = half-word, '11' = one word,  
and '00' = reserved.  
O
O
Not Output Enable. Whenever a memory access occurs, the nOE  
output controls the output enable port of the specific memory  
device.  
nWBE[3:0]/  
DQM[3:0] (note)  
107,  
102–100  
Not Write Byte Enable. Whenever a memory write access  
occurs, the nWBE output controls the write enable port of the  
specific memory device (except for DRAM). For DRAM banks,  
CAS[3:0] and nDWE are used for the write operation.  
DQM is data input/output mask signal for SDRAM.  
ExtMREQ  
108  
I
External Bus Master Request. An external bus master uses this  
pin to request the external bus. When it activates the ExtMREQ  
signal, the S3C4510B drives the state of external bus pins to high  
impedance. This lets the external bus master take control of the  
external bus. When it has the control, the external bus master  
assumes responsibility for DRAM refresh operations. The  
ExtMREQ signal is deactivated when the external bus master  
releases the external bus. When this occurs, ExtMACK goes Low  
level and the S3C4510B assumes the control of the bus.  
ExtMACK  
MDC  
109  
50  
O
O
External Bus Acknowledge. (See the ExtMREQ pin description.)  
Management Data Clock. The signal level at the MDC pin is used  
as a timing reference for data transfers that are controlled by the  
MDIO signal.  
MDIO  
48  
I/O  
Management Data I/O. When a read command is being  
executed, data that is clocked out of the PHY is presented on this  
pin. When a write command is being executed, data that is  
clocked out of the controller is presented on this pin for the  
Physical Layer Entity, PHY.  
LITTLE  
49  
38  
I
I
Little endian mode select pin. If LITTLE is High, S3C4510B  
operate in little endian mode. If Low, then in Big endian mode.  
Default value is low because this pin is pull-downed internally.  
COL/COL_10M  
Collision Detected/Collision Detected for 10M. COL is asserted  
asynchronously with minimum delay from the start of a collision  
on the medium in MII mode. COL_10M is asserted when a 10-  
Mbit/s PHY detects a collision.  
TX_CLK/  
TXCLK_10M  
46  
I
Transmit Clock/Transmit Clock for 10M. The controller drives  
TXD[3:0] and TX_EN from the rising edge of TX_CLK. In MII  
mode, the PHY samples TXD[3:0] and TX_EN on the rising edge  
of TX_CLK. For data transfers, TXCLK_10M is provided by the  
10-Mbit/s PHY.  
1-8  
S3C4510B  
PRODUCT OVERVIEW  
Table 1-1. S3C4510B Signal Descriptions (Continued)  
Signal  
Pin No.  
Type  
Description  
TXD[3:0]  
LOOP_10M  
TXD_10M  
44, 43, 40,  
39  
O
Transmit Data/Transmit Data for 10 M/Loop-back for 10M.  
Transmit data is aligned on nibble boundaries. TXD[0]  
corresponds to the first bit to be transmitted on the physical  
medium, which is the LSB of the first byte and the fifth bit of that  
byte during the next clock. TXD_10M is shared with TXD[0] and  
is a data line for transmitting to the 10-Mbit/s PHY. LOOP_10M is  
shared with TXD[1] and is driven by the loop-back bit in the  
control register.  
TX_EN/  
TXEN_10M  
47  
45  
O
O
Transmit Enable/Transmit Enable for 10M. TX_EN provides  
precise framing for the data carried on TXD[3:0]. This pin is  
active during the clock periods in which TXD[3:0] contains valid  
data to be transmitted from the preamble stage through CRC.  
When the controller is ready to transfer data, it asserts  
TXEN_10M.  
TX_ERR/  
PCOMP_10M  
Transmit Error/Packet Compression Enable for 10M. TX_ERR is  
driven synchronously to TX_CLK and sampled continuously by  
the Physical Layer Entity, PHY. If asserted for one or more  
TX_CLK periods, TX_ERR causes the PHY to emit one or more  
symbols which are not part of the valid data, or delimiter set  
located somewhere in the frame that is being transmitted.  
PCOMP_10M is asserted immediately after the packet's DA field  
is received. PCOMP_10M is used with the Management Bus of  
the DP83950 Repeater Interface Controller (from National  
Semiconductor). The MAC can be programmed to assert  
PCOMP if there is a CAM match, or if there is not a match. The  
RIC (Repeater Interface Controller) uses this signal to compress  
(shorten) the packet received for management purposes and to  
reduce memory usage. (See the DP83950 Data Sheet, published  
by National Semiconductor, for details on the RIC Management  
Bus.). This pin is controlled by a special register, with which you  
can define the polarity and assertion method (CAM match active  
or not match active) of the PCOMP signal.  
CRS/CRS_10M  
28  
37  
I
I
Carrier Sense/Carrier Sense for 10M. CRS is asserted  
asynchronously with minimum delay from the detection of a non-  
idle medium in MII mode. CRS_10M is asserted when a 10-  
Mbit/s PHY has data to transfer. A 10-Mbit/s transmission also  
uses this signal.  
RX_CLK/  
RXCLK_10M  
Receive Clock/Receive Clock for 10M. RX_CLK is a continuous  
clock signal. Its frequency is 25 MHz for 100-Mbit/s operation,  
and 2.5 MHz for 10-Mbit/s. RXD[3:0], RX_DV, and RX_ERR are  
driven by the PHY off the falling edge of RX_CLK, and sampled  
on the rising edge of RX_CLK. To receive data, the TXCLK_10 M  
clock comes from the 10-Mbit/s PHY.  
RXD[3:0]/  
RXD_10M  
35, 34, 33,  
30  
I
Receive Data/Receive Data for 10M. RXD is aligned on nibble  
boundaries. RXD[0] corresponds to the first bit received on the  
physical medium, which is the LSB of the byte in one clock  
period and the fifth bit of that byte in the next clock. RXD_10M is  
shared with RXD[0] and it is a line for receiving data from the 10-  
Mbit/s PHY.  
1-9  
PRODUCT OVERVIEW  
S3C4510B  
Table 1-1. S3C4510B Signal Descriptions (Continued)  
Signal  
Pin No.  
Type  
Description  
RX_DV/LINK_10M  
29  
I
Receive Data Valid/Link Status for 10M. PHY asserts RX_DV  
synchronously, holding it active during the clock periods in which  
RXD[3:0] contains valid data received. PHY asserts RX_DV no  
later than the clock period when it places the first nibble of the  
start frame delimiter (SFD) on RXD[3:0]. If PHY asserts RX_DV  
prior to the first nibble of the SFD, then RXD[3:0] carries valid  
preamble symbols. LINK_10M is shared with RX_DV and used to  
convey the link status of the 10-Mbit/s endec. The value is stored  
in a status register.  
RX_ERR  
36  
I
Receive Error. PHY asserts RX_ERR synchronously whenever it  
detects a physical medium error (e.g., a coding violation). PHY  
asserts RX_ERR only when it asserts RX_DV.  
TXDA  
RXDA  
9
7
O
I
HDLC Ch-A Transmit Data. The serial output data from the  
transmitter is coded in NRZ/NRZI/FM/Manchester data format.  
HDLC Ch-A Receive Data. The serial input data received by the  
device should be coded in NRZ/NRZI/FM/Manchester data  
format. The data rate should not exceed the rate of the  
S3C4510B internal master clock.  
nDTRA  
nRTSA  
6
8
O
O
HDLC Ch-A Data Terminal Ready. nDTRA output indicates that  
the data terminal device is ready for transmission and reception.  
HDLC Ch-A Request To Send. The nRTSA output goes low when  
there is exist data to be sent in TxFIFO. The data to be sent is  
transmitted when the nCTS is active(Low) state.  
nCTSA  
nDCDA  
10  
13  
I
I
HDLC Ch-A Clear To Send. The S3C4510B stores each  
transition of nCTS to ensure that its occurrence would be  
acknowledged by the system.  
HDLC Ch-A Data Carrier Detected. A High level on this pin resets  
and inhibits the receiver register. Data from a previous frame that  
may remain in the RxFIFO is retained. The S3C4510B stores  
each transition of nDCD.  
nSYNCA  
RXCA  
15  
14  
O
I
HDLC Ch-A Sync is detected. This indicates the reception of a  
flag. The nSYNC output goes low for one bit time beginning at  
the last bit of the flag.  
HDLC Ch-A Receiver Clock. When this clock input is used as the  
receiver clock, the receiver samples the data on the positive  
edge of RXCA clock. This clock can be the source clock of the  
receiver, the baud rate generator, or the DPLL.  
TXCA  
16  
I/O  
HDLC Ch-A Transmitter Clock. When this clock input is used as  
the transmitter clock, the transmitter shifts data on the negative  
transition of the TXCA clock . If you do not use TXCA as the  
transmitter clock, you can use it as an output pin for monitoring  
internal clocks such as the transmitter clock, receiver clock, and  
baud rate generator output clocks.  
TXDB  
RXDB  
20  
18  
O
I
HDLC Ch-B transmit data. See the TXDA pin description.  
HDLC Ch-B receive data. See the RXDA pin description.  
1-10  
S3C4510B  
PRODUCT OVERVIEW  
Table 1-1. S3C4510B Signal Descriptions (Continued)  
Signal  
Pin No.  
17  
Type  
Description  
nDTRB  
nRTSB  
nCTSB  
nDCDB  
O
O
I
HDLC Ch-B data terminal ready. See the nDTRA pin description.  
HDLC Ch-B request to send. See the nRTSA pin description.  
HDLC Ch-B clear to send. See the nCTSA pin description.  
19  
23  
24  
I
HDLC Ch-B data carrier detected. See the nDCDA pin  
description.  
nSYNCB  
RXCB  
TXCB  
26  
25  
27  
64  
O
I
HDLC Ch-B sync is detected. See the nSYNCA pin description.  
HDLC Ch-B receiver clock. See the RXCA pin description.  
HDLC Ch-B transmitter clock. See the TXCA pin description.  
I/O  
I
UCLK  
The external UART clock input. MCLK or PLL generated clock  
can be used as the UART clock. You can use UCLK, with an  
appropriate divided by factor, if a very precious baud rate clock is  
required.  
UARXD0  
UATXD0  
nUADTR0  
202  
204  
203  
I
O
I
UART0 receive data. RXD0 is the UART 0 input signal for  
receiving serial data.  
UART0 transmit data. TXD0 is the UART 0 output signal for  
transmitting serial data.  
Not UART0 data terminal ready. This input signals the S3C4510B  
that the peripheral (or host) is ready to transmit or receive serial  
data.  
nUADSR0  
205  
O
Not UART0 data set ready. This output signals the host  
(or peripheral) that UART 0 is ready to transmit or receive serial  
data.  
UARXD1  
UATXD1  
nUADTR1  
nUADSR1  
P[7:0]  
206  
4
I
O
I
UART1 receive data. See the RXD0 pin description.  
UART1 transmit data. See the TXD0 pin description.  
Not UART1 data terminal ready. See the DTR0 pin description.  
Not UART1 data set ready. See the DSR0 pin description.  
General I/O ports. See the I/O ports, chapter 12.  
3
5
O
I/O  
185–179,  
176  
XINTREQ[3:0]  
P[11:8]  
191–189,  
186  
I/O  
I/O  
I/O  
External interrupt request lines or general I/O ports.  
See the I/O ports, chapter 12.  
nXDREQ[1:0]/  
P[13:12]  
193, 192  
Not external DMA requests for GDMA or general I/O ports.  
See the I/O ports, chapter 12.  
nXDACK[1:0]  
P[15:14]  
195, 194  
Not external DMA acknowledge from GDMA or general I/O ports.  
See the I/O ports, chapter 12.  
TOUT0/P[16]  
TOUT1/P[17]  
SCL  
196  
199  
200  
201  
I/O  
I/O  
I/O  
I/O  
Timer 0 out or general I/O port. See the I/O ports, chapter 12.  
Timer 1 out or general I/O port. See the I/O ports, chapter 12.  
I2C serial clock.  
SDA  
I2C serial data.  
1-11  
PRODUCT OVERVIEW  
S3C4510B  
Table 1-1. S3C4510B Signal Descriptions (Continued)  
Signal  
Pin No.  
Type  
Description  
VDDP  
1, 21, 41, 56, 78,  
92, 105, 118, 130,  
155, 167, 177, 197  
Power  
I/O pad power  
VDDI  
11, 31, 51, 65,  
103, 142, 157,  
187, 207  
Power  
GND  
Internal core power  
I/O pad ground  
VSSP  
2, 22, 42, 57, 79,  
81, 93, 106, 119,  
131, 156, 168,  
178, 198  
VSSI  
12, 32, 52, 66,  
104, 143, 158,  
188, 208  
GND  
Internal core ground  
VDDA  
53  
54  
Power  
GND  
Analog power for PLL  
VSSA/VBBA  
Analog/bulk ground for PLL  
NOTE: SDRAM or EDO/normal DRAM interface signal pins are shared functions. It's functions will be configured by  
SYSCFG[31].  
1-12  
S3C4510B  
PRODUCT OVERVIEW  
Table 1-2. S3C4510B Pin List and PAD Type  
Group  
Pin Name Pin Counts I/O Type  
Pad Type  
ptic  
Description  
System  
XCLK  
1
1
1
1
1
1
1
1
1
1
1
1
1
22  
32  
4
4
1
4
1
6
2
1
4
1
1
I
O
I
S3C4510B system source clock.  
System clock out.  
Configuration MCLKO  
pob4  
ptic  
(8)  
CLKSEL  
nRESET  
CLKOEN  
TMODE  
LITTLE  
Clock select.  
I
ptis  
Not reset  
I
ptic  
Clock out enable/disable.  
Test mode.  
I
ptic  
I
pticd  
pia_bb  
ptic  
Little endian mode select pin  
PLL filter pin  
FILTER  
I
TAP Control TCK  
I
JTAG test clock.  
(5)  
TMS  
I
pticu  
pticu  
ptot2  
pticu  
ptot6  
ptbsut6  
ptot4  
ptot4  
ptot4  
ptot4  
ptic  
JTAG test mode select.  
JTAG test data in.  
TDI  
I
TDO  
O
I
JTAG test data out.  
nTRST  
JTAG not reset.  
Memory  
Interface  
(83)  
ADDR[21:0]  
XDATA[31:0]  
nRAS[3:0]  
nCAS[3:0]  
nDWE  
O
I/O  
O
O
O
O
I
Address bus.  
External, bi-directional, 32-bit data bus.  
Not row address strobe for DRAM.  
Not column address strobe for DRAM.  
Not write enable  
nECS[3:0]  
nEWAIT  
nRCS[5:0]  
B0SIZE[1:0]  
nOE  
Not external I/O chip select.  
Not external wait signal.  
Not ROM/SRAM/flash chip select.  
Bank 0 data bus access size.  
Not output enable.  
O
I
ptot4  
ptic  
O
O
I
ptot4  
ptot4  
ptic  
nWBE[3:0]  
ExtMREQ  
ExtMACK  
Not write byte enable.  
External master bus request.  
External bus acknowledge.  
O
pob1  
1-13  
PRODUCT OVERVIEW  
S3C4510B  
Table 1-2. S3C4510B Pin List and PAD Type (Continued)  
Group  
Ethernet  
Controller  
(18)  
Pin Name Pin Counts I/O Type  
Pad Type  
pob4  
Description  
MDC  
1
1
1
O
I/O  
I
Management data clock.  
Management data I/O.  
MDIO  
ptbcut4  
ptis  
COL/  
Collision detected/collision detected for  
10 M.  
COL_10M  
TX_CLK/  
TXCLK_10M  
1
4
I
ptis  
Transmit data/transmit data for 10 M.  
TXD[3:0]/  
O
pob4  
Transmit data/transmit data for 10 M.  
TXD_10M  
LOOP_10M  
TX_EN/  
TXEN_10M  
I
O
O
I
pob4  
pob4  
ptis  
Transmit enable or transmit enable for 10  
M.  
TX_ERR/  
PCOMP_10M  
1
1
1
4
1
Transmit error/packet compression  
enable for 10 M.  
CRS/  
CRS_10M  
Carrier sense/carrier sense for 10 M.  
Receive clock/receive clock for 10 M.  
Receive data/receive data for 10 M.  
Receive data valid.  
RX_CLK/  
RXCLK_10M  
I
ptis  
RXD[3:0]/  
RXD_10M  
1
I
ptis  
RX_DV/  
ptis  
LINK_10M  
RX_ERR  
TXDA  
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
I
O
I
ptis  
pob4  
ptis  
Receive error.  
HDLC  
Channel A  
(9)  
HDLC channel A transmit data.  
HDLC channel A receive data.  
HDLC channel A data terminal ready.  
HDLC channel A request to send.  
HDLC channel A clear to send.  
HDLC channel A data carrier detected.  
HDLC channel A sync is detected.  
HDLC channel A receiver clock.  
HDLC channel A transmitter clock.  
HDLC channel B transmit data.  
HDLC channel B receive data.  
HDLC channel B data terminal ready.  
HDLC channel B request to send.  
HDLC channel B clear to send.  
HDLC channel B data carrier detected.  
HDLC channel B sync is detected.  
HDLC channel B receiver clock.  
HDLC channel B transmitter clock.  
RXDA  
nDTRA  
nRTSA  
nCTSA  
nDCDA  
nSYNCA  
RXCA  
O
O
I
pob4  
pob4  
ptis  
I
ptis  
O
I
pob4  
ptis  
TXCA  
I/O  
O
I
ptbsut1  
pob4  
ptis  
HDLC  
Channel B  
(9)  
TXDB  
RXDB  
nDTRB  
nRTSB  
nCTSB  
nDCDB  
nSYNCB  
RXCB  
O
O
I
pob4  
pob4  
ptis  
I
ptis  
O
I
pob4  
ptis  
TXCB  
I/O  
ptbsut1  
1-14  
S3C4510B  
PRODUCT OVERVIEW  
Table 1-2. S3C4510B Pin List and PAD Type (Continued)  
Group  
UART 0  
(5)  
Pin Name Pin Counts I/O Type  
Pad Type  
ptis  
Description  
UCLK  
1
1
1
1
1
1
1
1
1
8
4
I
I
UART External Clock for UART0/UART1  
UART 0 receive data.  
UARXD0  
UATXD0  
nUADTR0  
nUADSR0  
UARXD1  
UATXD1  
nUADTR1  
NUADSR1  
P[7:0]  
ptic  
O
I
pob4  
ptic  
UART 0 transmit data.  
Not UART 0 data terminal ready.  
Not UART 0 data set ready.  
UART 1 receive data.  
O
I
pob4  
ptic  
UART 1  
(4)  
O
I
pob4  
ptic  
UART 1 transmit data.  
Not UART 1 data terminal ready.  
Not UART 1 data set ready.  
O
I/O  
I/O  
pob4  
General-  
ptbst4sm General I/O ports.  
Purpose I/O xINTREQ  
(xINTREQ,  
ptbst4sm External interrupt requests or general I/O  
ports.  
[3:0]/P[11:8]  
nXDREQ,  
nXDACK  
2
2
1
1
I/O  
I/O  
I/O  
I/O  
ptbst4sm External DMA requests for GDMA or  
general I/O ports.  
xXDREQ  
[1:0]/P[13:12]  
Timer 0, 1)  
(18)  
ptbst4sm External DMA acknowledge from GDMA  
or general I/O ports.  
nXDACK[1:0]  
/ P[15:14]  
ptbst4sm Timer 0 out or general I/O port.  
TIMER0/P  
[16]  
ptbst4sm Timer 1 out or general I/O port.  
TIMER1/P  
[17]  
I2C  
(2)  
SCL  
SDA  
1
1
I/O  
I/O  
ptbcd4  
ptbcd4  
I2C serial clock.  
I2C serial data.  
1-15  
PRODUCT OVERVIEW  
Pad Type I/O Type  
S3C4510B  
Table 1-3. S3C4510B PAD Type  
Cell Type  
Current  
Drive  
Feature  
Slew-Rate  
Control  
ptic  
I
I
I
LVCMOS level  
5 V-tolerant  
5 V-tolerant  
ptis  
LVCMOS schmit trigger level  
LVCMOS level  
pticu  
5 V-tolerant  
Pull-up register  
pticd  
I
LVCMOS level  
5 V-tolerant  
Pull-down register  
pia_bb  
pob1  
I
O
Analog input with seperate bulk bias  
Normal buffer  
1 mA  
2 mA  
4 mA  
4 mA  
6 mA  
1 mA  
ptot2  
O
Tri-state buffer  
5 V-tolerant  
pob4  
O
Normal buffer  
ptot4  
O
Tri-state buffer  
5 V-tolerant  
5 V-tolerant  
ptot6  
O
Tri-state buffer  
ptbsut1  
I/O  
LVCMOS schmit trigger level  
Tri-state buffer  
5 V-tolerant  
Pull-up register  
ptbcut4  
ptbcd4  
I/O  
I/O  
I/O  
I/O  
4 mA  
4 mA  
4 mA  
6 mA  
LVCMOS level Tri-state buffer  
LVCMOS level open drain buffer  
LVCMOS schmit trigger level  
LVCMOS schmit trigger level  
5 V-tolerant  
5 V-tolerant  
5 V-tolerant  
Medium  
Medium  
ptbst4sm  
Ptbsut6  
5 V-tolerant  
Pull-up register  
NOTE: pticu and pticd provides 100K Ohm Pull-up(down) register. For detail information about the pad type, see Chapter 4.  
Input/Output Cells of the "STD90/MDL90 0.35 um 3.3 V Standard Cell Library Data Book", produced by Samsung  
Electrionic Co., Ltd, ASIC Team.  
nRESET  
64*fMCLK  
512*fMCLK  
nRSCO  
NOTE: After the falling edge of nRESET, the S3C4510B count 64 cycles for a system reset  
and needs further 512 cycles for a TAG RAM clear of cache.  
After these cycles, the S3C4510B asserts nRCS0 when the nRESET is released.  
Figure 1-3. Reset Timing Diagram  
1-16  
S3C4510B  
PRODUCT OVERVIEW  
CPU CORE OVERVIEW  
The S3C4510B CPU core is a general purpose 32-bit ARM7TDMI microprocessor, developed by Advanced RISC  
Machines, Ltd. (ARM). The core architecture is based on Reduced Instruction Set Computer (RISC) principles.  
The RISC architecture makes the instruction set and its related decoding mechanism simpler and more efficient  
than those with microprogrammed Complex Instruction Set Computer (CISC) systems. High instruction  
throughput and impressive real-time interrupt response are among the major beneifts of the architecture.  
Pipelining is also employed so that all components of the processing and memory systems can operate  
continuously. The ARM7TDMI has a 32-bit address bus.  
An important feature of the ARM7TDMI processor that makes itself distinct from the ARM7 processor is a unique  
architectural strategy called THUMB. The THUMB strategy is an extension of the basic ARM architecture  
consisting of 36 instruction formats. These formats are based on the standard 32-bit ARM instruction set, while  
having been re-coded using 16-bit wide opcodes.  
As THUMB instructions are one-half the bit width of normal ARM instructions, they produce very high-density  
codes. When a THUMB instruction is executed, its 16-bit opcode is decoded by the processor into its equivalent  
instruction in the standard ARM instruction set. The ARM core then processes the 16-bit instruction as it would a  
normal 32-bit instruction. In other words, the THUMB architecture gives 16-bit systems a way to access the 32-bit  
performance of the ARM core without requiring the full overhead of 32-bit processing.  
As the ARM7TDMI core can execute both standard 32-bit ARM instructions and 16-bit THUMB instructions, it  
allows you to mix the routines of THUMB instructions and ARM code in the same address space. In this way, you  
can adjust code size and performance, routine by routine, to find the best programming solution for a specific  
application.  
Address  
Register  
Address  
Incrementer  
Instruction  
Register Bank  
Decoder and  
Logic Controll  
Multiplier  
Barrel  
Shifter  
32-Bit ALU  
Instruction  
Pipeline and Read  
Data Register  
Write Data  
Register  
Figure 1-4. ARM7TDMI Core Block Diagram  
1-17  
PRODUCT OVERVIEW  
S3C4510B  
INSTRUCTION SET  
The S3C4510B instruction set is divided into two subsets: a standard 32-bit ARM instruction set and a 16-bit  
THUMB instruction set.  
The 32-bit ARM instruction set is comprised of thirteen basic instruction types, which can, in turn, be divided into  
four broad classes:  
·
·
·
Four types of branch instructions which control program execution flow, instruction privilege levels, and  
switching between an ARM code and a THUMB code.  
Three types of data processing instructions which use the on-chip ALU, barrel shifter, and multiplier to  
perform high-speed data operations in a bank of 31 registers (all with 32-bit register widths).  
Three types of load and store instructions which control data transfer between memory locations and the  
registers. One type is optimized for flexible addressing, another for rapid context switching, and the third for  
swapping data.  
·
Three types of co-processor instructions which are dedicated to controlling external co-processors. These  
instructions extend the off-chip functionality of the instruction set in an open and uniform way.  
NOTE  
All 32-bit ARM instructions can be executed conditionally.  
The 16-bit THUMB instruction set contains 36 instruction formats drawn from the standard 32-bit ARM instruction  
set. The THUMB instructions can be divided into four functional groups:  
·
·
·
·
Four branch instructions.  
Twelve data processing instructions, which are a subset of the standard ARM data processing instructions.  
Eight load and store register instructions.  
Four load and store multiple instructions.  
NOTE  
Each 16-bit THUMB instruction has a corresponding 32-bit ARM instruction with an identical  
processing model.  
The 32-bit ARM instruction set and the 16-bit THUMB instruction set are good targets for compilers of many  
different high-level languages. When an assembly code is required for critical code segments, the ARM  
programming technique is straightforward, unlike that of some RISC processors which depend on sophisticated  
compiler technology to manage complicated instruction interdependencies.  
Pipelining is employed so that all parts of the processor and memory systems can operate continuously.  
Typically, while one instruction is being executed, its successor is being decoded, and the third instruction is  
being fetched from memory.  
1-18  
S3C4510B  
PRODUCT OVERVIEW  
MEMORY INTERFACE  
The CPU memory interface has been designed to help the highest performance potential to be realized without  
incurring high costs in the memory system. Speed-critical control signals are pipelined so that system control  
functions can be implemented in standard low-power logic. These pipelined control signals allow you to fully  
exploit the fast local access modes, offered by industry standard dynamic RAMs.  
OPERATING STATES  
From a programmer¢s point of view, the ARM7TDMI core is always in one of two operating states. These states,  
which can be switched by software or by exception processing, are:  
·
·
ARM state (when executing 32-bit, word-aligned, ARM instructions), and  
THUMB state (when executing 16-bit, half-word aligned THUMB instructions).  
OPERATING MODES  
The ARM7TDMI core supports seven operating modes:  
·
·
·
·
·
·
·
User mode: a normal program execution state  
FIQ (Fast Interrupt Request) mode: for supporting a specific data transfer or channel processing  
IRQ (Interrupt ReQuest) mode: for general purpose interrupt handling  
Supervisor mode: a protected mode for the operating system  
Abort mode: entered when a data or instruction pre-fetch is aborted  
System mode: a privileged user mode for the operating system  
Undefined mode: entered when an undefined instruction is executed  
Operating mode changes can be controlled by software. They can also be caused by external interrupts or  
exception processing. Most application programs execute in user mode. Privileged modes (that is, all modes  
other than User mode) are entered to service interrupts or exceptions, or to access protected resources.  
1-19  
PRODUCT OVERVIEW  
S3C4510B  
REGISTERS  
The S3C4510B CPU core has a total of 37 registers: 31 general-purpose 32-bit registers, and 6 status registers.  
Not all of these registers are always available. Whether a registers is available to the programmer at any given  
time depends on the current processor operating state and mode.  
NOTE  
When the S3C4510B is operating in ARM state, 16 general registers and one or two status registers can  
be accessed at any time. In privileged mode, mode-specific banked registers are switched in.  
Two register sets, or banks, can also be accessed, depending on the core¢s current state, the ARM state register  
set and the THUMB state register set:  
·
The ARM state register set contains 16 directly accessible registers: R0-R15. All of these registers, except for  
R15, are for general-purpose use, and can hold either data or address values. An additional (17th) register,  
the CPSR (Current Program Status Register), is used to store status information.  
·
The THUMB state register set is a subset of the ARM state set. You can access 8 general registers, R0-R7,  
as well as the program counter (PC), a stack pointer register (SP), a link register (LR), and the CPSR. Each  
privileged mode has a corresponding banked stack pointer, link register, and saved process status register  
(SPSR).  
The THUMB state registers are related to the ARM state registers as follows:  
·
·
·
THUMB state R0-R7 registers and ARM state R0–R7 registers are identical  
THUMB state CPSR and SPSRs and ARM state CPSR and SPSRs are identical  
THUMB state SP, LR, and PC are mapped directly to ARM state registers R13, R14, and R15, respectively  
In THUMB state, registers R8-R15 are not part of the standard register set. However, you can access them for  
assembly language programming and use them for fast temporary storage, if necessary.  
1-20  
S3C4510B  
PRODUCT OVERVIEW  
EXCEPTIONS  
An exception arises when the normal flow of program execution is interrupted, e.g., when processing is diverted  
to handle an interrupt from a peripheral. The processor state just prior to handling the exception must be  
preserved so that the program flow can be resumed when the exception routine is completed. Multiple exceptions  
may arise simultaneously.  
To process exceptions, the S3C4510B uses the banked core registers to save the current state. The old PC value  
and the CPSR contents are copied into the appropriate R14 (LR) and SPSR registers. The PC and mode bits in  
the CPSR are adjusted to the value corresponding to the type of exception being processed.  
The S3C4510B core supports seven types of exceptions. Each exception has a fixed priority and a corresponding  
privileged processor mode, as shown in Table 1-4.  
Table 1-4. S3C4510B CPU Exceptions  
Exception  
Mode on Entry  
Supervisor mode  
Priority  
Reset  
1 (highest)  
Data abort  
Abort mode  
2
FIQ  
FIQ mode  
3
IRQ  
IRQ mode  
4
Prefetch abort  
Undefined instruction  
SWI  
Abort mode  
5
6
Undefined mode  
Supervisor mode  
6 (lowest)  
1-21  
PRODUCT OVERVIEW  
S3C4510B  
SPECIAL REGISTERS  
Table 1-5. S3C4510B Special Registers  
R/W Description  
Group  
Registers  
Offset  
0x0000  
0x3000  
0x3008  
0x300C  
0x3010  
0x3014  
0x3018  
0x301C  
0x3020  
0x3024  
0x3028  
0x302C  
0x3030  
0x3034  
0x3038  
0x303C  
0x9000  
0x9004  
Reset/Value  
0x37FFFF91  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x20000060  
0x00000060  
0x00000060  
0x00000060  
0x00000060  
0x00000060  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x000083FD  
0x00000000  
0x00000000  
System  
SYSCFG  
R/W System configuration register  
Manager CLKCON  
EXTACON0  
EXTACON1  
EXTDBWTH  
ROMCON0  
R/W Clock control register  
R/W External I/O timing register 1  
R/W External I/O timing register 2  
R/W Data bus width for each memory bank  
R/W ROM/SRAM/Flash bank 0 control register  
R/W ROM/SRAM/Flash bank 1 control register  
R/W ROM/SRAM/Flash bank 2 control register  
R/W ROM/SRAM/Flash bank 3 control register  
R/W ROM/SRAM/Flash bank 4 control register  
R/W ROM/SRAM/Flash bank 5 control register  
R/W DRAM bank 0 control register  
ROMCON1  
ROMCON2  
ROMCON3  
ROMCON4  
ROMCON5  
DRAMCON0  
DRAMCON1  
DRAMCON2  
DRAMCON3  
REFEXTCON  
R/W DRAM bank 1 control register  
R/W DRAM bank 2 control register  
R/W DRAM bank 3 control register  
R/W Refresh and external I/O control register  
R/W Buffered DMA receive control register  
R/W Buffered DMA transmit control register  
Ethernet  
(BDMA)  
BDMATXCON  
BDMARXCO  
N
BDMATXPTR  
BDMARXPTR  
BDMARXLSZ  
BDMASTAT  
CAM  
0x9008  
0x900C  
0x9010  
0x9014  
R/W Transmit frame descriptor start address  
R/W Receive frame descriptor start address  
R/W Receive frame maximum size  
R/W Buffered DMA status  
0x00000000  
0x00000000  
Undefined  
0x00000000  
Undefined  
0x9100–  
0x917C  
W
CAM content (32 words)  
BDMATXBUF  
BDMARXBUF  
0x9200–  
0x92FC  
R/W BDMA Tx buffer (64 words) for test mode  
addressing  
Undefined  
Undefined  
0x9800–  
0x99FC  
R/W BDMA Rx buffer (64 words) for test mode  
addressing  
1-22  
S3C4510B  
PRODUCT OVERVIEW  
Table 1-5. S3C4510B Special Registers (Continued)  
Group  
Ethernet  
(MAC)  
Registers  
MACON  
Offset  
0xA000  
0xA004  
0xA008  
0xA00C  
0xA010  
0xA014  
0xA018  
0xA01C  
0xA028  
0xA03C  
0xA040  
0xA044  
0x9040  
0x7000  
0x7004  
0x7008  
0x700C  
0x7010  
0x7014  
0x7018  
0x701C  
0x7020  
0x7024  
0x7028  
0x702C  
0x7030  
0x7034  
0x7038  
0x703C  
0x7040  
0x7040  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
Description  
Ethernet MAC control register  
CAM control register  
Reset/Value  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
CAMCON  
MACTXCON  
MACTXSTAT  
MACRXCON  
MACRXSTAT  
STADATA  
STACON  
MAC transmit control register  
MAC transmit status register  
MAC receive control register  
MAC receive status register  
R/W Station management data  
R/W Station management control and address  
R/W CAM enable register  
0x00006000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00010400  
0x00000000  
CAMEN  
EMISSCNT  
EPZCNT  
R/W Missed error count register  
R
R
R
Pause count register  
ERMPZCNT  
ETXSTAT  
HMODE  
Remote pause count register  
Transmit control frame status  
HDLC  
R/W HDLC mode register  
Channel A HCON  
HSTAT  
R/W HDLC control register  
R/W HDLC status register  
R/W HDLC interrupt enable register  
HINTEN  
HTXFIFOC  
W
W
R
TxFIFO frame continue register  
TxFIFO frame terminate register  
HDLC RxFIFO entry register  
HTXFIFOT  
HRXFIFO  
HBRGTC  
HPRMB  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0xFFFFFFFF  
0xFFFFFFFF  
0xXXXX0000  
0xXXXX0000  
R/W HDLC baud rate generate time constant  
R/W HDLC preamble constant  
R/W HDLC station address 0  
HSAR0  
HSAR1  
R/W HDLC station address 1  
HSAR2  
R/W HDLC station address 2  
HSAR3  
R/W HDLC station address 3  
HMASK  
R/W HDLC mask register  
DMATxPTR  
DMARxPTR  
HMFLR  
R/W DMA Tx buffer descriptor pointer  
R/W DMA Rx buffer descriptor pointer  
R/W Maximum frame length register  
R/W DMA receive buffer size register  
HRBSR  
1-23  
PRODUCT OVERVIEW  
S3C4510B  
Table 1-5. S3C4510B Special Registers (Continued)  
R/W Description  
Group  
HDLC  
Registers  
HMODE  
Offset  
0x8000  
0x8004  
0x8008  
0x800C  
0x8010  
0x8014  
0x8018  
0x801C  
0xA020  
0x8024  
0x8028  
0x802C  
0x8030  
0x8034  
0x8038  
0x803C  
0x8040  
0x8044  
0x5000  
0x5004  
0x5008  
0x4000  
0x4004  
0x4008  
0x400C  
0x4010  
0x4014  
0x4018  
0x401C  
0x4020  
0x4024  
0x4030  
0x4034  
0XF000  
0xF004  
0xF008  
0xF00C  
Reset/Value  
0x00000000  
0x00000000  
0x00010400  
0x00000000  
R/W HDLC mode register  
Channel B HCON  
HSTAT  
R/W HDLC control register  
R/W HDLC status register  
R/W HDLC interrupt enable register  
HINTEN  
HTXFIFOC  
W
W
R
TxFIFO frame continue register  
TxFIFO frame terminate register  
HDLC RxFIFO entry register  
HTXFIFOT  
HRXFIFO  
HBRGTC  
HPRMB  
0x00000000  
0x00000000  
0x00000000  
0x00006000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0xFFFFFFFF  
0xFFFFFFFF  
0xXXXX0000  
0xXXXX0000  
0x00000000  
0x00000000  
Undefined  
R/W HDLC baud rate generate time constant  
R/W HDLC preamble constant  
R/W HDLC station address 0  
HSAR0  
HSAR1  
R/W HDLC station address 1  
HSAR2  
R/W HDLC station address 2  
HSAR3  
R
R
R
HDLC station address 3  
HDLC mask register  
HMASK  
DMATxPTR  
DMARxPTR  
HMFLR  
DMA Tx buffer descriptor pointer  
R/W DMA Rx buffer descriptor pointer  
R/W Maximum frame length register  
R/W DMA receive buffer size register  
R/W I/O port mode register  
HRBSR  
I/O Ports  
IOPMOD  
IOPCON  
IOPDATA  
INTMOD  
INTPND  
R/W I/O port control register  
R/W Input port data register  
Interrupt  
R/W Interrupt mode register  
0x00000000  
0x00000000  
0x003FFFFF  
0x03020100  
0x07060504  
0x0B0A0908  
0x0F0E0D0C  
0x13121110  
0x00000014  
0x00000054  
0x00000054  
0x00000054  
0x00000054  
Undefined  
Controller  
R/W Interrupt pending register  
R/W Interrupt mask register  
INTMSK  
INTPRI0  
INTPRI1  
INTPRI2  
INTPRI3  
INTPRI4  
INTPRI5  
INTOFFSET  
INTOSET_FIQ  
INTOSET_IRQ  
IICCON  
R/W Interrupt priority register 0  
R/W Interrupt priority register 1  
R/W Interrupt priority register 2  
R/W Interrupt priority register 3  
R/W Interrupt priority register 4  
R/W Interrupt priority register 5  
R
R
R
Interrupt offset address register  
FIQ interrupt offset register  
IRQ interrupt offset register  
I2C Bus  
R/W I2C bus control status register  
R/W I2C bus shift buffer register  
R/W I2C bus prescaler register  
IICBUF  
IICPS  
0x00000000  
0x00000000  
IICCOUNT  
R
I2C bus prescaler counter register  
1-24  
S3C4510B  
PRODUCT OVERVIEW  
Table 1-5. S3C4510BC Special Registers (Continued)  
R/W Description  
Group  
Registers  
GDMACON0  
GDMACON1  
GDMASRC0  
GDMADST0  
GDMASRC1  
GDMADST1  
GDMACNT0  
GDMACNT1  
ULCON0  
Offset  
0xB000  
0xC000  
0xB004  
0xB008  
0xC004  
0xC008  
0xB00C  
0xC00C  
0xD000  
0xE000  
0xD004  
0xE004  
0xD008  
0xE008  
0xD00C  
0xE00C  
0xD010  
0xE010  
0xD014  
0xE014  
0x6000  
0x6004  
0x6008  
0x600C  
0x6010  
Reset/Value  
0x00000000  
0x00000000  
Undefined  
Undefined  
Undefined  
Undefined  
GDMA  
R/W GDMA channel 0 control register  
R/W GDMA channel 1 control register  
R/W GDMA source address register 0  
R/W GDMA destination address register 0  
R/W GDMA source address register 1  
R/W GDMA destination address register 1  
R/W GDMA channel 0 transfer count register  
R/W GDMA channel 1 transfer count register  
R/W UART channel 0 line control register  
R/W UART channel 1 line control register  
R/W UART channel 0 control register  
Undefined  
Undefined  
0x00  
UART  
ULCON1  
0x00  
UCON0  
0x00  
UCON1  
R/W UART channel 1 control register  
0x00  
USTAT0  
R
R
UART channel 0 status register  
0xC0  
USTAT1  
UART channel 1 status register  
0xC0  
UTXBUF0  
UTXBUF1  
URXBUF0  
URXBUF1  
UBRDIV0  
UBRDIV1  
TMOD  
W
W
R
UART channel 0 transmit holding register  
UART channel 1 transmit holding register  
UART channel 0 receive buffer register  
UART channel 1 receive buffer register  
Undefined  
Undefined  
Undefined  
Undefined  
0x00  
R
R/W Baud rate divisor register 0  
R/W Baud rate divisor register 1  
R/W Timer mode register  
R/W Timer 0 data register  
R/W Timer 1 data register  
R/W Timer 0 count register  
R/W Timer 1 count register  
0x00  
Timers  
0x00000000  
0x00000000  
0x00000000  
0xFFFFFFFF  
0xFFFFFFFF  
TDATA0  
TDATA1  
TCNT0  
TCNT1  
1-25  
PRODUCT OVERVIEW  
S3C4510B  
NOTES  
1-26  
S3C4510B  
PROGRAMMER'S MODEL  
2
PROGRAMMER¢S MODEL  
OVERVIEW  
S3C4510B was developed using the advanced ARM7TDMI core designed by advanced RISC machines, Ltd.  
Processor Operating States  
From the programmer¢s point of view, the ARM7TDMI can be in one of two states:  
— ARM state which executes 32-bit, word-aligned ARM instructions.  
— THUMB state which operates with 16-bit, half-word-aligned THUMB instructions. In this state, the PC uses bit  
1 to select between alternate half-words.  
NOTE  
Transition between these two states does not affect the processor mode or the contents of the registers.  
SWITCHING STATE  
Entering THUMB State  
Entry into THUMB state can be achieved by executing a BX instruction with the state bit (bit 0) set in the operand  
register.  
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.  
Entering ARM State  
Entry into ARM state happens:  
1. On execution of the BX instruction with the state bit clear in the operand register.  
2. 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  
BIG-ENDIAN FORMAT  
S3C4510B  
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.  
Higher address 31  
24  
9
5
15  
8
7
0
Word address  
8
4
0
9
5
1
10  
6
11  
7
8
4
0
2
3
Lower address  
w
w
Most significant byte is at lowest address  
Word is addressed by byte address of most signficant byte  
Figure 2-1. Big-Endian Addresses of Bytes within Words  
NOTE  
The data locations in the external memory are different with Figure 2-1 in the S3C4620. Please refer to  
the chapter 4, system manager.  
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.  
Word address  
Higher address 31  
24  
23  
16  
15  
8
7
0
11  
7
10  
6
9
5
1
8
4
0
8
4
0
3
2
Lower address  
w
w
Most significant byte is at lowest address  
Word is addressed by byte address of least signficant byte  
Figure 2-2. Little-Endian Addresses of Bytes Words  
2-2  
S3C4510B  
PROGRAMMER'S MODEL  
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), half-word (16-bit) and word (32-bit) data types. Words must be aligned to four-  
byte boundaries and half words to two-byte boundaries.  
OPERATING MODES  
ARM7TDMI supports seven modes of operation:  
— User (usr):  
— FIQ (fiq):  
— IRQ (irq):  
The normal ARM program execution state  
Designed to support a data transfer or channel process  
Used for general-purpose interrupt handling  
— Supervisor (svc): Protected mode for the operating system  
— Abort mode (abt): Entered after a data or instruction prefetch abort  
— System (sys):  
A privileged user mode for the operating system  
— Undefined (und): Entered when an undefined instruction is executed  
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.  
2-3  
PROGRAMMER'S MODEL  
REGISTERS  
S3C4510B  
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  
In ARM state, 16 general registers and one or two status registers are visible at any one time. In privileged (non-  
User) modes, mode-specific banked registers are switched in. Figure 2-3 shows which registers are available in  
each mode: the banked registers are marked with a shaded triangle.  
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  
Register 16  
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.  
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-4  
S3C4510B  
PROGRAMMER'S MODEL  
ARM State General Registers and Program Counter  
System & User  
FIQ  
Supervisor  
About  
R0  
IRG  
R0  
Undefined  
R0  
R1  
R2  
R3  
R4  
R5  
R6  
R7  
R0  
R0  
R0  
R1  
R1  
R1  
R1  
R1  
R2  
R2  
R2  
R2  
R2  
R3  
R3  
R3  
R3  
R3  
R4  
R4  
R4  
R4  
R4  
R5  
R5  
R5  
R5  
R5  
R6  
R6  
R6  
R6  
R6  
R7  
R7  
R7  
R7  
R7  
R8  
R8  
R8  
R8  
R8_fiq  
R8  
R9  
R9  
R9  
R9  
R9_fiq  
R9  
R10  
R11  
R12  
R13_svc  
R14_svc  
R15 (PC)  
R10  
R11  
R12  
R13_abt  
R14_abt  
R15 (PC)  
R10  
R11  
R12  
R13_irq  
R14_irq  
R15 (PC)  
R10  
R11  
R12  
R13_und  
R14_und  
R15 (PC)  
R10_fiq  
R11_fiq  
R12_fiq  
R13_fiq  
R14_fiq  
R15 (PC)  
R10  
R11  
R12  
R13  
R14  
R15 (PC)  
ARM State Program Status Register  
CPSR  
CPSR  
CPSR  
CPSR  
CPSR  
CPSR  
SPSR_fiq  
SPSR_svc  
SPSR_abt  
SPSR_irq  
SPSR_und  
= banked register  
Figure 2-3. Register Organization in ARM State  
2-5  
PROGRAMMER'S MODEL  
S3C4510B  
The THUMB State Register Set  
The THUMB state register set is a subset of the ARM state set. The programmer has direct access to eight  
general registers, R0–R7, as well as the Program Counter (PC), a stack pointer register (SP), a link register (LR),  
and the CPSR. There are banked stack pointers, link registers and Saved Process Status Registers (SPSRs) for  
each privileged mode. This is shown in Figure 2-4.  
THUMB State General Registers and Program Counter  
System & User  
FIQ  
R0  
Supervisor  
About  
IRG  
R0  
Undefined  
R0  
R1  
R2  
R3  
R4  
R5  
R6  
R7  
SP  
LR  
PC  
R0  
R0  
R0  
R1  
R1  
R1  
R1  
R1  
R2  
R2  
R2  
R2  
R2  
R3  
R3  
R3  
R3  
R3  
R4  
R4  
R4  
R4  
R4  
R5  
R5  
R5  
R5  
R5  
R6  
R6  
R6  
R6  
R6  
R7  
R7  
R7  
R7  
R7  
SP_fiq  
LR_fiq  
PC  
SP_svg  
LR_svc  
PC  
SP_abt  
LR_abt  
PC  
SP_irq  
LR_irq  
PC  
SP_und  
LR_und  
PC  
THUMB State Program Status Registers  
CPSR  
CPSR  
CPSR  
CPSR  
CPSR  
CPSR  
SPSR_fiq  
SPSR_svc  
SPSR_abt  
SPSR_irq  
SPSR_und  
= banked register  
Figure 2-4. Register Organization in THUMB State  
2-6  
S3C4510B  
PROGRAMMER'S MODEL  
The Relationship between ARM and THUMB State Registers  
The THUMB state registers relate to the ARM state registers in the following way:  
— THUMB state R0–R7 and ARM state R0–R7 are identical  
— THUMB state CPSR and SPSRs and ARM state CPSR and SPSRs are identical  
— THUMB state SP maps onto ARM state R13  
— THUMB state LR maps onto ARM state R14  
— The THUMB state program counter maps onto the ARM state program counter (R15)  
This relationship is shown in Figure 2-5.  
THUMB State  
ARM State  
R0  
R1  
R2  
R3  
R4  
R5  
R6  
R7  
R0  
R1  
R2  
R3  
R4  
R5  
R6  
R7  
R8  
R9  
R10  
R11  
R12  
Stack Pointer (SP)  
Link Register (LR)  
Program Counter (PC)  
CPSR  
Stack Pointer (R13)  
Link Register (R14)  
Program Counter (R15)  
CPSR  
SPSR  
SPSR  
Figure 2-5. Mapping of THUMB State Registers onto ARM State Registers  
2-7  
PROGRAMMER'S MODEL  
S3C4510B  
Accessing Hi-Registers in THUMB State  
In THUMB state, registers R8–R15 (the Hi registers) are not part of the standard register set. However, the  
assembly language programmer has limited access to them, and can use them for fast temporary storage.  
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 PROGRAM STATUS REGISTERS  
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:  
— Hold information about the most recently performed ALU operation  
— Control the enabling and disabling of interrupts  
— Set the processor operating mode  
The arrangement of bits is shown in Figure 2-6.  
Control Bits  
Condition Code Flags  
(Reserved)  
31  
30  
29  
28  
27  
26  
25  
24  
8
7
6
5
4
3
2
1
0
N
Z
C
V
.
.
.
.
.
.
I
F
T
M4  
M3  
M2  
M1  
M0  
Overflow  
Mode bits  
State bit  
Carry/Borrow/Extend  
Zero  
FIQ disable  
IRQ disable  
Negative/Less Than  
Figure 2-6. Program Status Register Format  
2-8  
S3C4510B  
PROGRAMMER'S MODEL  
The Condition Code Flags  
The N, Z, C and V bits are the condition code flags. These may be changed as a result of arithmetic and logical  
operations, and may be tested to determine whether an instruction should be executed.  
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 Control Bits  
The bottom 8 bits of a PSR (incorporating I, F, T and M[4:0]) are known collectively as the control bits. These will  
change when an exception arises. If the processor is operating in a privileged mode, they can also be  
manipulated by software.  
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 mode bits  
The I and F bits are the interrupt disable bits. When set, these disable the IRQ and  
FIQ interrupts respectively.  
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.  
2-9  
PROGRAMMER'S MODEL  
S3C4510B  
Table 2-1. PSR Mode. Bit Values  
Visible THUMB State Registers  
M[4:0]  
10000  
Mode  
User  
Visible ARM State Registers  
R14..R0,  
R7..R0,  
LR, SP  
PC, CPSR  
PC, CPSR  
10001  
10010  
10011  
10111  
11011  
11111  
FIQ  
R7..R0,  
R7..R0,  
LR_fiq, SP_fiq  
PC, CPSR, SPSR_fiq  
R7..R0,  
R14_fiq..R8_fiq,  
PC, CPSR, SPSR_fiq  
R12..R0,  
IRQ  
LR_irq, SP_irq  
PC, CPSR, SPSR_irq  
R7..R0,  
R14_irq..R13_irq,  
PC, CPSR, SPSR_irq  
R12..R0,  
Supervisor  
Abort  
LR_svc, SP_svc,  
PC, CPSR, SPSR_svc  
R7..R0,  
R14_svc..R13_svc,  
PC, CPSR, SPSR_svc  
R12..R0,  
LR_abt, SP_abt,  
PC, CPSR, SPSR_abt  
R7..R0  
R14_abt..R13_abt,  
PC, CPSR, SPSR_abt  
R12..R0,  
Undefined  
System  
LR_und, SP_und,  
PC, CPSR, SPSR_und  
R7..R0,  
R14_und..R13_und,  
PC, CPSR  
R14..R0,  
LR, SP  
PC, CPSR  
PC, CPSR  
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-10  
S3C4510B  
PROGRAMMER'S MODEL  
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.  
Action on Entering an Exception  
When handling an exception, the ARM7TDMI:  
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 nesting 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.  
Action on Leaving an Exception  
On completion, the exception handler:  
1. Moves the Link Register, minus an offset where appropriate, to the PC. (The offset will vary depending on the  
type of exception.)  
2. Copies the SPSR back to the CPSR  
3. Clears the interrupt disable flags, if they were set on entry  
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-11  
PROGRAMMER'S MODEL  
S3C4510B  
Exception Entry/Exit Summary  
Table 2-2 summarizes the PC value preserved in the relevant R14 on exception entry, and the recommended  
instruction for exiting the exception handler.  
Table 2-2. Exception Entry/Exit  
Return Instruction  
Previous State  
ARM R14_x  
Notes  
THUMB R14_x  
PC + 2  
PC + 2  
PC + 2  
PC + 4  
PC + 4  
PC + 4  
PC + 8  
BL  
MOV PC, R14  
PC + 4  
PC + 4  
PC + 4  
PC + 4  
PC + 4  
PC + 4  
PC + 8  
1
1
1
2
2
1
3
4
SWI  
MOVS PC, R14_svc  
MOVS PC, R14_und  
SUBS PC, R14_fiq, #4  
SUBS PC, R14_irq, #4  
SUBS PC, R14_abt, #4  
SUBS PC, R14_abt, #8  
NA  
UDEF  
FIQ  
IRQ  
PABT  
DABT  
RESET  
NOTES:  
1. Where PC is the address of the BL/SWI/Undefined Instruction fetch which had the prefetch abort.  
2. Where PC is the address of the instruction which did not get executed since the FIQ or IRQ took priority.  
3. Where PC is the address of the Load or Store instruction which generated the data abort.  
4. The value saved in R14_svc upon reset is unpredictable.  
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 minimizing 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-12  
S3C4510B  
IRQ  
PROGRAMMER'S MODEL  
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.  
There are two types of abort:  
Prefetch abort: occurs during an instruction prefetch.  
— Data abort: occurs during a data access.  
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):  
SUBS  
SUBS  
PC,R14_abt,#4  
PC,R14_abt,#8  
; for a prefetch abort, or  
; for a data abort  
This restores both the PC and the CPSR, and retries the aborted instruction.  
2-13  
PROGRAMMER'S MODEL  
Software Interrupt  
S3C4510B  
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.  
Table 2-3. Exception Vectors  
Address  
Exception  
Mode in Entry  
Supervisor  
0x00000000  
0x00000004  
0x00000008  
0x0000000C  
0x00000010  
0x00000014  
0x00000018  
0x0000001C  
Reset  
Undefined instruction  
Software Interrupt  
Abort (prefetch)  
Abort (data)  
Reserved  
Undefined  
Supervisor  
Abort  
Abort  
Reserved  
IRQ  
IRQ  
FIQ  
FIQ  
2-14  
S3C4510B  
PROGRAMMER¢S MODEL  
Exception Priorities  
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:  
6. Undefined Instruction, Software interrupt.  
Not All Exceptions Can Occur at Once:  
Undefined Instruction and Software Interrupt are mutually exclusive, since they each correspond to particular  
(non-overlapping) decoding of the current instruction.  
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-15  
PROGRAMMER¢S MODEL  
S3C4510B  
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.  
When nRESET goes HIGH again, ARM7TDMI:  
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-16  
S3C4510B  
INSTRUCTION SET  
3
INSTRUCTION SET  
INSTRUCTION SET SUMMAY  
This chapter describes the ARM instruction set and the THUMB instruction set in the ARM7TDMI core.  
FORMAT SUMMARY  
The ARM instruction set formats are shown below.  
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  
Data processing/  
PSR Transfer  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
Cond  
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
0
0
0
0
0
0
0
1
1
0
0
1
1
1
1
1
0
0
0
0
0
0
1
1
0
1
0
1
1
1
Opcode  
S
S
S
0
Rn  
Rd  
Rd  
Rn  
Operand2  
0
0
0
1
0
U
B
0
A
A
0
1
Rs  
Rn  
1
1
1
0
1
1
0
0
0
0
S
S
0
0
1
1
1
1
1
1
Rm  
Multiply  
RdHi  
Rn  
RnLo  
Rd  
Rm  
Rm  
Multiply Long  
1
0
0
1
0
0
0
1
0
0
1
0
0
Single data swap  
Branch and exchange  
1
0
0
1
1
1
1
1
1
1
1
1
0
0
Rn  
Halfword data transfer:  
register offset  
Halfword data transfer:  
immediate offset  
P
P
P
U
U
U
0
W L  
W L  
W L  
Rn  
Rd  
H
H
Rm  
1
Rn  
Rn  
Rd  
Rd  
Offset  
Offset  
B
Offset  
Single data transfer  
Undefined  
1
P
L
P
0
0
1
U
S
W L  
W L  
Rn  
Register List  
Block data transfer  
Branch  
Offset  
Coprocessor data  
transfer  
Coprocessor data  
Operation  
U
N
Rn  
CRd  
CRd  
Rd  
CP#  
Offset  
CP Opc  
CP Opc  
CRn  
CRn  
CP#  
CP#  
CP#  
CP#  
0
1
CRm  
CRm  
Coprocessor register  
Transfer  
L
Ignored by processor  
Software Interrupt  
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  
Figure 3-1. ARM Instruction Set Format  
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.  
3-1  
INSTRUCTION SET  
S3C4510B  
INSTRUCTION SUMMARY  
Table 3-1. The ARM Instruction Set  
Instruction  
Mnemonic  
Action  
ADC  
ADD  
AND  
B
Add with carry  
Rd: = Rn + Op2 + Carry  
Rd: = Rn + Op2  
Add  
AND  
Rd: = Rn AND Op2  
R15: = address  
Branch  
BIC  
BL  
Bit clear  
Rd: = Rn AND NOT Op2  
R14: = R15, R15: = address  
R15: = Rn,  
Branch with link  
Branch and exchange  
BX  
T bit: = Rn[0]  
CDP  
CMN  
CMP  
EOR  
Coprocessor data processing  
Compare negative  
Compare  
(coprocessor-specific)  
CPSR flags: = Rn + Op2  
CPSR flags: = Rn - Op2  
Rd: = (Rn AND NOT Op2)  
OR (op2 AND NOT Rn)  
Coprocessor load  
Exclusive OR  
LDC  
LDM  
LDR  
MCR  
MLA  
MOV  
MRC  
MRS  
MSR  
MUL  
MVN  
Load coprocessor from memory  
Load multiple registers  
Stack manipulation (Pop)  
Rd: = (address)  
Load register from memory  
Move CPU register to coprocessor register  
Multiply accumulate  
cRn: = rRn {<op>cRm}  
Rd: = (Rm * Rs) + Rn  
Rd: = Op2  
Move register or constant  
Move from coprocessor register to CPU register Rn: = cRn {<op>cRm}  
Move PSR status/flags to register  
Move register to PSR status/flags  
Multiply  
Rn: = PSR  
PSR: = Rm  
Rd: = Rm * Rs  
Move negative register  
Rd: = 0xFFFFFFFF EOR Op2  
3-2  
S3C4510B  
INSTRUCTION SET  
Table 3-1. The ARM Instruction Set (Continued)  
Instruction  
Mnemonic  
Action  
ORR  
RSB  
RSC  
SBC  
STC  
STM  
STR  
SUB  
SWI  
SWP  
TEQ  
TST  
OR  
Rd: = Rn OR Op2  
Rd: = Op2 - Rn  
Reverse subtract  
Reverse subtract with carry  
Subtract with carry  
Store coprocessor register to memory  
Store multiple  
Rd: = Op2 - Rn-1 + Carry  
Rd: = Rn - Op2-1 + Carry  
Address: = CRn  
Stack manipulation (push)  
<address>: = Rd  
Store register to memory  
Subtract  
Rd: = Rn - Op2  
Software Interrupt  
OS call  
Swap register with memory  
Test bit-wise equality  
Test bits  
Rd: = [Rn], [Rn] := Rm  
CPSR flags: = Rn EOR Op2  
CPSR flags: = Rn AND Op2  
3-3  
INSTRUCTION SET  
S3C4510B  
THE CONDITION FIELD  
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.  
Table 3-2. Condition Code Summary  
Code  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
1010  
1011  
1100  
1101  
1110  
Suffix  
EQ  
NE  
CS  
CC  
MI  
Flags  
Meaning  
Z set  
Equal  
Z clear  
C set  
Not equal  
Unsigned higher or same  
Unsigned lower  
Negative  
C clear  
N set  
PL  
N clear  
V set  
Positive or zero  
Overflow  
VS  
VC  
HI  
V clear  
No overflow  
C set and Z clear  
C clear or Z set  
Unsigned higher  
Unsigned lower or same  
Greater or equal  
Less than  
LS  
GE  
LT  
N equals V  
N not equal to V  
Z clear AND (N equals V)  
Z set OR (N not equal to V)  
(Ignored)  
GT  
LE  
Greater than  
Less than or equal  
Always  
AL  
3-4  
S3C4510B  
INSTRUCTION SET  
BRANCH AND EXCHANGE (BX)  
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
0
0
0
1
0
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
1
Cond  
Rn  
[3:0] Operand Register  
If bit0 of Rn = 1, subsequent instructions decoded as THUMB instructions  
If bit0 of Rn =0, subsequent instructions decoded as ARM instructions  
[31:28] Condition Field  
Figure 3-2. Branch and Exchange Instructions  
INSTRUCTION CYCLE TIMES  
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 - branch and exchange.  
BX {cond} Rn  
{cond}  
Rn  
Two character condition mnemonic. See Table 3-2.  
is an expression evaluating to a valid register number.  
USING R15 AS AN OPERAND  
If R15 is used as an operand, the behaviour is undefined.  
3-5  
INSTRUCTION SET  
S3C4510B  
Examples  
ADR  
R0, Into_THUMB + 1  
R0  
; Generate branch target address  
; and set bit 0 high - hence  
; arrive in THUMB state.  
; Branch and change to THUMB  
; state.  
BX  
CODE16  
Into_THUMB  
; Assemble subsequent code as  
; 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.  
; Branch and change back to ARM state.  
BX R5  
·
·
·
ALIGN  
; Word align  
CODE32  
Back_to_ARM  
; Assemble subsequent code as ARM instructions  
3-6  
S3C4510B  
INSTRUCTION SET  
BRANCH AND BRANCH WITH LINK (B, BL)  
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
L
Cond  
101  
Offset  
[24] Link Bit  
0 = Branch  
1 = Branch with link  
[31:28] Condition Field  
Figure 3-3. Branch Instructions  
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 pre-fetch operation, which causes the PC to be 2 words (8 bytes) ahead of the current  
instruction.  
THE LINK BIT  
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 pre-fetch, 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.  
INSTRUCTION CYCLE TIMES  
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  
INSTRUCTION SET  
S3C4510B  
ASSEMBLER SYNTAX  
Items in {} are optional. Items in < > must be present.  
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  
here  
BAL  
B
CMP  
here  
there  
R1,#0  
; Assembles to 0xEAFFFFFE (note effect of PC offset).  
; Always condition used as default.  
; Compare R1 with zero and branch to fred  
; if R1 was zero, otherwise continue.  
; Continue to next instruction.  
; Call subroutine at computed address.  
; Add 1 to register 1, setting CPSR flags  
; on the result then call subroutine if  
; the C flag is clear, which will be the  
; case unless R1 held 0xFFFFFFFF.  
BEQ  
BL  
ADDS  
fred  
sub+ROM  
R1,#1  
BLCC  
sub  
3-8  
S3C4510B  
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
00 Opcode  
L
S
Rn  
Rd  
Cond  
Operand2  
[15:12] Destination Register  
0 = Branch 1 = Branch with Link  
[19:16] 1st operand Register  
0 = Branch  
1 = Branch with Link  
[20] Set condition Codes  
0 = Do not after condition codes  
1 = Set condition codes  
[24:21] Operation Code  
0000 = AND-Rd: = Op1 AND Op2  
0001 = EOR-Rd: = Op1 EOR Op2  
0010 = SUB-Rd: = Op1-Op2  
0011 = RSB-Rd: = Op2-Op1  
0100 = ADD-Rd: = Op1+Op2  
0101 = ADC-Rd: = Op1+Op2+C  
0110 = SBC-Rd: = OP1-Op2+C-1  
0111 = RSC-Rd: = Op2-Op1+C-1  
1000 = TST-set condition codes on Op1 AND Op2  
1001 = TEO-set condition codes on OP1 EOR Op2  
1010 = CMP-set condition codes on Op1-Op2  
1011 = SMN-set condition codes on Op1+Op2  
1100 = ORR-Rd: = Op1 OR Op2  
1101 = MOV-Rd: =OP2  
1110 = BIC-Rd: = Op1 AND NOT Op2  
1111 = MVN-Rd: = NOT Op2  
[25] Immediate Operand  
0 = Operand 2 is a register  
1 = Operand 2 is an immediate Value  
[11:0] Operand 2 Type Selection  
11  
3 4  
0
Shift  
Rm  
[3:0] 2nd Operand Register  
11 8 7  
Rotate  
[11:4] Shift applied to Rm  
0
Imm  
[7:0] Unsigned 8 bit immediate value  
[11:8] Shift applied to Imm  
[31:28] Condition Field  
Figure 3-4. Data Processing Instructions  
3-9  
INSTRUCTION SET  
S3C4510B  
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  
S3C4510B  
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.  
Table 3-3. ARM Data Processing Instructions  
Assembler Mnemonic  
Opcode  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
1010  
1011  
1100  
1101  
1110  
1111  
Action  
Operand1 AND operand2  
AND  
EOR  
SUB  
RSB  
ADD  
ADC  
SBC  
RSC  
TST  
Operand1 EOR operand2  
Operand1 - operand2  
Operand2 - operand1  
Operand1 + operand2  
Operand1 + operand2 + carry  
Operand1 - operand2 + carry - 1  
Operand2 - operand1 + carry - 1  
As AND, but result is not written  
As EOR, but result is not written  
As SUB, but result is not written  
As ADD, but result is not written  
Operand1 OR operand2  
TEQ  
CMP  
CMN  
ORR  
MOV  
BIC  
Operand2 (operand1 is ignored)  
Operand1 AND NOT operand2 (Bit clear)  
NOT operand2 (operand1 is ignored)  
MVN  
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  
INSTRUCTION SET  
SHIFTS  
S3C4510B  
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
[6:5] Shift Type  
00 = logical left  
10 = arithmetic right  
[6:5] Shift Type  
00 = logical left  
10 = arithmetic right  
01 = logical right  
11 = rotate right  
01 = logical right  
11 = rotate right  
[11:7] Shift Amount  
5 bit unsigned integer  
[11:8] Shift Register  
Shift amount specified in bottom-byte of Rs  
Figure 3-5. ARM Shift Operations  
Instruction Specified Shift Amount  
When the shift amount is specified in the instruction, it is contained in a 5 bit field which may take any value from  
0 to 31. A logical shift left (LSL) takes the contents of Rm and moves each bit by the specified amount to a more  
significant position. The least significant bits of the result are filled with zeros, and the high bits of Rm which do  
not map into the result are discarded, except that the least significant discarded bit becomes the shifter carry  
output which may be latched into the C bit of the CPSR when the ALU operation is in the logical class (see  
above). For example, the effect of LSL #5 is shown in Figure 3-6.  
31  
27 26  
0
Contents of Rm  
carry out  
Value of Operand 2  
0
0
0
0
0
Figure 3-6. Logical Shift Left  
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  
S3C4510B  
INSTRUCTION SET  
31  
5
4
0
Contents of Rm  
carry out  
0
0
0
0
0
Value of Operand 2  
Figure 3-7. Logical Shift Right  
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  
Figure 3-8. Arithmetic Shift Right  
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  
INSTRUCTION SET  
S3C4510B  
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. The form of the shift field which might be expected to give ROR #0 is  
31  
5
4
0
Contents of Rm  
carry out  
Value of Operand 2  
Figure 3-9. Rotate Right  
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  
carry out  
C
in  
Value of Operand 2  
Figure 3-10. Rotate Right Extended  
3-14  
S3C4510B  
INSTRUCTION SET  
Register Specified Shift Amount  
Only the least significant byte of the contents of Rs is used to determine the shift amount. Rs can be any general  
register other than R15.  
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:  
1. LSL by 32 has result zero, carry out equal to bit 0 of Rm.  
2. LSL by more than 32 has result zero, carry out zero.  
3. LSR by 32 has result zero, carry out equal to bit 31 of Rm.  
4. LSR by more than 32 has result zero, carry out zero.  
5. ASR by 32 or more has result filled with and carry out equal to bit 31 of Rm.  
6. ROR by 32 has result equal to Rm, carry out equal to bit 31 of Rm.  
7. ROR by n where n is greater than 32 will give the same result and carry out as ROR by n-32; therefore  
repeatedly subtract 32 from n until the amount is in the range 1 to 32 and see 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  
INSTRUCTION SET  
S3C4510B  
IMMEDIATE OPERAND ROTATES  
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.  
USING R15 AS AN OPERAND  
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.  
TEQ, TST, CMP AND CMN OPCODES  
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.  
3-16  
S3C4510B  
INSTRUCTION SET  
INSTRUCTION CYCLE TIMES  
Data processing instructions vary in the number of incremental cycles taken as follows:  
Table 3-4. Incremental Cycle Times  
Processing Type  
Cycles  
Normal data processing  
1S  
Data processing with register specified shift  
Data processing with PC written  
1S + 1I  
2S + 1N  
Data processing with register specified shift and PC written  
2S + 1N + 1I  
NOTE: S, N and I are as defined sequential (S-cycle), non-sequential (N-cycle), and internal (I-cycle) respectively.  
ASSEMBLER SYNTAX  
MOV,MVN (single operand instructions).  
<opcode>{cond}{S} Rd,<Op2>  
— CMP,CMN,TEQ,TST (instructions which do not produce a result).  
<opcode>{cond} Rn,<Op2>  
— AND,EOR,SUB,RSB,ADD,ADC,SBC,RSC,ORR,BIC  
<opcode>{cond}{S} Rd,Rn,<Op2>  
where:  
<Op2>  
Rm{,<shift>} or,<#expression>  
{cond}  
A two-character condition mnemonic. See Table 3-2.  
Set condition codes if S present (implied for CMP, CMN, TEQ, TST).  
Expressions evaluating to a register number.  
{S}  
Rd, Rn and Rm  
<#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.)  
3-17  
INSTRUCTION SET  
Examples  
S3C4510B  
ADDEQ  
TEQS  
R2,R4,R5  
R4,#3  
; If the Z flag is set make R2: = R4 + R5  
; Test R4 for equality with 3.  
; (The S is in fact redundant as the  
; assembler inserts it automatically.)  
; Logical right shift R7 by the number in  
; the bottom byte of R2, subtract result  
; from R5, and put the answer into R4.  
; Return from subroutine.  
SUB  
R4,R5,R7,LSR R2  
MOV  
MOVS  
PC,R14  
PC,R14  
; Return from exception and restore CPSR  
; from SPSR_mode.  
3-18  
S3C4510B  
INSTRUCTION SET  
PSR TRANSFER (MRS, MSR)  
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-19  
INSTRUCTION SET  
S3C4510B  
MRS (Transfer PSR Contents to a Register)  
31  
28 27  
23 22 21  
16 15  
12 11  
0
Ps  
00010  
001111  
Rd  
Cond  
000000000000  
[15:21] Destination Register  
[19:16] Source PSR  
0 = CPSR  
1 = SPSR_<current mode>  
[31:28] Condition Field  
MRS (Transfer Register Contents to PSR)  
31  
28 27  
23 22 21  
12 11  
4
3
0
Pd  
00010  
101001111  
Cond  
00000000  
Rm  
[3:0] Source Register  
[22] Destination PSR  
0 = CPSR  
1 = SPSR_<current mode>  
[31:28] Condition Field  
MRS (Transfer Register Contents or Immediate Value to PSR Flag Bits Only)  
31 28 27 26 25 24 23 22 21 12 11  
Pd  
0
00  
I
10  
101001111  
Cond  
Soucer Operand  
[22] Destination PSR  
0 = CPSR 1 = SPSR_<current mode>  
[25] Immediate Operand  
0 = Source operand is a register  
1 = SPSR_<current mode>  
[11:0] Source Operand  
11  
4
3
0
00000000  
Rm  
[3:0] Source Register  
[11:4] Source operand is an immediate value  
11  
8
7
0
Rotate  
Imm  
[7:0] Unsigned 8 bit immediate value  
[11:8] Shift applied to Imm  
[31:28] Condition Field  
Figure 3-11. PSR Transfer  
3-20  
S3C4510B  
INSTRUCTION SET  
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  
The following sequence performs a mode change:  
MRS  
BIC  
ORR  
MSR  
R0,CPSR  
; Take a copy of the CPSR.  
; Clear the mode bits.  
; Select new mode  
R0,R0,#0x1F  
R0,R0,#new_mode  
CPSR,R0  
; Write back the modified CPSR.  
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.  
INSTRUCTION CYCLE TIMES  
PSR transfers take 1S incremental cycles, where S is defined as sequential (S-cycle).  
3-21  
INSTRUCTION SET  
S3C4510B  
ASSEMBLER SYNTAX  
— MRS - transfer PSR contents to a register  
MRS{cond} Rd,<psr>  
— MSR - transfer register contents to PSR  
MSR{cond} <psr>,Rm  
— MSR - transfer register contents to PSR flag bits only  
MSR{cond} <psrf>,Rm  
The most significant four bits of the register contents are written to the N,Z,C & V flags respectively.  
— MSR - transfer immediate value to PSR flag bits only  
MSR{cond} <psrf>, <#expression>  
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.  
Expressions evaluating to a register number other than R15  
CPSR, CPSR_all, SPSR or SPSR_all. (CPSR and CPSR_all are synonyms as are  
and SPSR_all)  
Rd and Rm  
<psr>  
SPSR  
<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  
In User mode the instructions behave as follows:  
MSR  
MSR  
MSR  
MRS  
CPSR_all,Rm  
CPSR_flg,Rm  
; CPSR[31:28] ¬ Rm[31:28]  
; CPSR[31:28] ¬ Rm[31:28]  
CPSR_flg,#0xA0000000 ; CPSR[31:28] ¬ 0xA (set N, C; clear Z, V)  
Rd,CPSR  
; Rd[31:0] ¬ CPSR[31:0]  
In privileged modes the instructions behave as follows:  
MSR  
MSR  
MSR  
MSR  
MSR  
MSR  
MRS  
CPSR_all,Rm  
CPSR_flg,Rm  
; CPSR[31:0] ¬ Rm[31:0]  
; CPSR[31:28] ¬ Rm[31:28]  
CPSR_flg,#0x50000000 ; CPSR[31:28] ¬ 0x5 (set Z, V; clear N, C)  
SPSR_all,Rm  
SPSR_flg,Rm  
SPSR_flg,#0xC0000000 ; SPSR_<mode>[31:28] ¬ 0xC (set N, Z; clear C, V)  
Rd,SPSR ; Rd[31:0] ¬ SPSR_<mode>[31:0]  
; SPSR_<mode>[31:0] ¬ Rm[31:0]  
; SPSR_<mode>[31:28] ¬ Rm[31:28]  
3-22  
S3C4510B  
INSTRUCTION SET  
MULTIPLY AND MULTIPLY-ACCUMULATE (MUL, MLA)  
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
0 0 0 0 0 0 A S  
Rd  
Rn  
Rs  
Rm  
Cond  
1 0 0 1  
[15:12][11:8][3:0] Operand Registers  
[19:16] Destination Register  
[20] Set Condition Code  
0 = Do not alter condition codes  
1 = Set condition codes  
[21] Accumulate  
0 = Multiply only  
1 = Multiply and accumulate  
[31:28] Condition Field  
Figure 3-12. Multiply Instructions  
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’ complement) or unsigned integers.  
The results of a signed multiply nd 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.  
For example consider the multiplication of the operands:  
Operand A  
Operand B  
Result  
0xFFFFFFF6 0x0000001  
0xFFFFFF38  
If the Operands are Interpreted as Signed  
Operand A has the value -10, operand B has the value 20, and the result is -200 which is correctly represented as  
0xFFFFFF38.  
If the Operands are Interpreted as Unsigned  
Operand A has the value 4294967286, operand B has the value 20 and the result is 85899345720, which is  
represented as 0x13FFFFFF38, so the least significant 32 bits are 0xFFFFFF38.  
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  
INSTRUCTION SET  
CPSR FLAGS  
S3C4510B  
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.  
INSTRUCTION CYCLE TIMES  
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
2
3
4
If bits [32:8] of the multiplier operand are all zero or all one.  
If bits [32:16] of the multiplier operand are all zero or all one.  
If bits [32:24] of the multiplier operand are all zero or all one.  
In all other cases.  
ASSEMBLER SYNTAX  
MUL{cond}{S} Rd,Rm,Rs  
MLA{cond}{S} Rd,Rm,Rs,Rn  
{cond}  
Two-character condition mnemonic. See Table 3-2.  
{S}  
Set condition codes if S present  
Rd, Rm, Rs and Rn  
Expressions evaluating to a register number other than R15.  
Examples  
MUL  
R1,R2,R3  
; R1: = R2 * R3  
MLAEQS  
R1,R2,R3,R4  
; Conditionally R1: = R2 * R3 + R4, setting condition  
codes.  
3-24  
S3C4510B  
INSTRUCTION SET  
MULTIPLY LONG AND MULTIPLY-ACCUMULATE LONG (MULL,MLAL)  
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
0 0 0 0 1 U A S  
RdHi  
RdLo  
Rs  
Rm  
Cond  
1 0 0 1  
[11:8][3:0] Operand Registers  
[19:16][15:12] Source Destination Registers  
[20] Set Condition Code  
0 = Do not alter condition codes  
1 = Set condition codes  
[21] Accumulate  
0 = Multiply only  
1 = Multiply and accumulate  
[22] Unsigned  
0 = Unsigned  
1 = Signed  
[31:28] Condition Field  
Figure 3-13. Multiply Long Instructions  
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.  
OPERAND RESTRICTIONS  
— R15 must not be used as an operand or as a destination register.  
— RdHi, RdLo, and Rm must all specify different registers.  
3-25  
INSTRUCTION SET  
CPSR FLAGS  
S3C4510B  
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.  
INSTRUCTION CYCLE TIMES  
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.  
Its possible values are as follows:  
For Signed Instructions SMULL, SMLAL:  
If bits [31:8] of the multiplier operand are all zero or all one.  
If bits [31:16] of the multiplier operand are all zero or all one.  
If bits [31:24] of the multiplier operand are all zero or all one.  
In all other cases.  
For Unsigned Instructions UMULL, UMLAL:  
If bits [31:8] of the multiplier operand are all zero.  
If bits [31:16] of the multiplier operand are all zero.  
If bits [31:24] of the multiplier operand are all zero.  
In all other cases.  
S and I are defined as sequential (S-cycle) and internal (I-cycle), respectively.  
3-26  
S3C4510B  
INSTRUCTION SET  
ASSEMBLER SYNTAX  
Table 3-5. Assembler Syntax Descriptions  
Description  
Mnemonic  
Purpose  
UMULL{cond}{S} RdLo, RdHi, Rm, Rs  
UMLAL{cond}{S} RdLo, RdHi, Rm, Rs  
SMULL{cond}{S} RdLo, RdHi, Rm, Rs  
SMLAL{cond}{S} RdLo, RdHi, Rm, Rs  
Unsigned multiply long  
32 x 32 = 64  
Unsigned multiply & Accumulate long  
Signed multiply long  
32 x 32 + 64 = 64  
32 x 32 = 64  
Signed multiply & Accumulate long  
32 x 32 + 64 = 64  
where:  
{cond}  
Two-character condition mnemonic. See Table 3-2.  
Set condition codes if S present  
{S}  
RdLo, RdHi, Rm, Rs  
Expressions evaluating to a register number other than R15.  
Examples  
UMULL  
UMLALS  
R1, R4, R2, R3  
R1, R5, R2, R3  
; R4, R1: = R2 * R3  
; R5, R1: = R2 * R3 + R5, R1 also setting condition codes  
3-27  
INSTRUCTION SET  
S3C4510B  
SINGLE DATA TRANSFER (LDR, STR)  
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  
01 P U B W L  
16 15  
12 11  
0
I
Rn  
Rd  
Offset  
Cond  
[15:12] Source/Destination Registers  
[19:16] Base Register  
[20] Load/Store Bit  
0 = Store to memory  
1 = Load from memory  
[21] Write-back Bit  
0 = No write-back  
1 = Write address into base  
[22] Byte/Word Bit  
0 = Transfer word quantity  
1 = Transfer byte quantity  
[23] Up/Down Bit  
0 = Down: subtract offset from base  
1 = Up: add offset to base  
[24] Pre/Post Indexing Bit  
0 = Post: add offset after transfer  
1 = Pre: add offset bofore transfer  
[25] Immediate Offset  
0 = Offset is an immediate value  
[11:0] Offset  
11  
0
Immediate  
[11:0] Unsigned 12-bit immediate offset  
11  
4
3
0
Shift  
Rm  
[3:0] Offset register [11:4] Shift applied to Rm  
[31:28] Condition Field  
Figure 3-14. Single Data Transfer Instructions  
3-28  
S3C4510B  
INSTRUCTION SET  
OFFSETS AND AUTO-INDEXING  
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.  
SHIFTED REGISTER OFFSET  
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.  
BYTES AND WORDS  
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  
INSTRUCTION SET  
S3C4510B  
Memory  
A
Register  
A
A+3  
24  
24  
B
C
D
B
C
D
A+2  
A+1  
A
16  
16  
8
8
0
0
LDR from word aligned address  
Memory  
A
Register  
A
A+3  
24  
24  
B
C
D
B
C
D
A+2  
A+1  
A
16  
16  
8
8
0
0
LDR from address offset by 2  
Figure 3-15. Little-Endian Offset Addressing  
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  
S3C4510B  
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.  
R15 must not be specified as the register offset (Rm).  
When R15 is the source register (Rd) of a register store (STR) instruction, the stored value will be address of the  
instruction plus 12.  
RESTRICTION ON THE USE OF BASE REGISTER  
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.  
INSTRUCTION CYCLE TIMES  
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  
INSTRUCTION SET  
S3C4510B  
ASSEMBLER SYNTAX  
<LDR|STR>{cond}{B}{T} Rd,<Address>  
where:  
LDR  
STR  
{cond}  
{B}  
Load from memory into a register  
Store from a register into memory  
Two-character condition mnemonic. See Table 3-2.  
If B is present then byte transfer, otherwise word transfer  
If T is present the W bit will be set in a post-indexed instruction, forcing non-  
{T}  
privileged mode for the transfer cycle. T is not allowed when a pre-indexed  
addressing mode is specified or implied.  
Rd  
An expression evaluating to a valid register number.  
Rn and Rm  
Expressions evaluating to a register number. If Rn is R15 then the assembler will  
subtract 8 from the offset value to allow for ARM7TDMI pipelining. In this case base  
write-back should not be specified.  
<Address>can be:  
1
An expression which generates an address:  
The assembler will attempt to generate an instruction using the PC as a base and a  
corrected immediate offset to address the location given by evaluating the  
expression. This will be a PC relative, pre-indexed address. If the address is out of  
range, an error will be generated.  
2
3
A pre-indexed addressing specification:  
[Rn]  
[Rn,<#expression>]{!}  
[Rn,{+/-}Rm{,<shift>}]{!}  
offset of zero  
offset of <expression> bytes  
offset of +/- contents of index register,  
shifted by <shift>  
A post-indexed addressing specification:  
[Rn],<#expression>  
[Rn],{+/-}Rm{,<shift>}  
offset of <expression> bytes  
offset of +/- contents of index register,  
shifted as by <shift>.  
<shift>  
{!}  
General shift operation (see data processing instructions) but you cannot specify  
the shift amount by a register.  
Writes back the base register (set the W bit) if! is present.  
3-32  
S3C4510B  
Examples  
INSTRUCTION SET  
STR  
R1,[R2,R4]!  
; Store R1 at R2 + R4 (both of which are registers)  
; and write back address to R2.  
STR  
LDR  
LDR  
LDREQB  
R1,[R2],R4  
; Store R1 at R2 and write back R2 + R4 to R2.  
; Load R1 from contents of R2 + 16, but don't write back.  
; Load R1 from contents of R2 + R3 * 4.  
; Conditionally load byte at R6 + 5 into  
R1,[R2,#16]  
R1,[R2,R3,LSL#2]  
R1,[R6,#5]  
; R1 bits 0 to 7, filling bits 8 to 31 with zeros.  
; Generate PC relative offset to address PLACE.  
STR  
R1,PLACE  
PLACE  
3-33  
INSTRUCTION SET  
S3C4510B  
HALFWORD AND SIGNED DATA TRANSFER (LDRH/STRH/LDRSB/LDRSH)  
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
000  
P U 0 W L  
Rn  
Rd  
0000  
1 S H 1  
Rm  
Cond  
[3:0] Offset Register  
[6][5] S H  
0 0 = SWP instruction  
0 1 = Unsigned halfwords  
1 1 = Signed byte  
1 1 = Signed half words  
[15:12] Source/Destination Register  
[19:16] Base Register  
[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  
[24] Pre/Post Indexing  
0 = Post: add/subtract offset after transfer  
1 = Pre: add/subtract offset bofore transfer  
[31:28] Condition Field  
Figure 3-16. Half-word and Signed Data Transfer with Register Offset  
3-34  
S3C4510B  
INSTRUCTION SET  
31  
28 27  
25 24 23 22 21 20 19  
16 15  
12 11  
8
7
6
5
4
3
0
000  
P U 1 W L  
Rn  
Rd  
Offset  
1 S H 1  
Offset  
Cond  
[3:0] Immediate Offset (Low Nibble)  
[6][5] S H  
0 0 = SWP instruction  
0 1 = Unsigned halfwords  
1 1 = Signed byte  
1 1 = Signed half words  
[11:8] Immediate Offset (High Nibble)  
[15:12] Source/Destination Register  
[19:16] Base Register  
[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  
[24] Pre/Post Indexing  
0 = Post: add/subtract offset after transfer  
1 = Pre: add/subtract offset bofore transfer  
[31:28] Condition Field  
Figure 3-17. Half-word and Signed Data Transfer with Immediate Offset and Auto-Indexing  
OFFSETS 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  
INSTRUCTION SET  
S3C4510B  
HALF-WORD LOAD AND STORES  
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.  
SIGNED BYTE AND HALF-WORD LOADS  
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.  
ENDIANNESS AND BYTE/HALF-WORD SELECTION  
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 half-word 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 half-word boundary, (A[1]=1).The supplied  
address should always be on a half-word boundary. If bit 0 of the supplied address is high then the ARM7TDMI  
will load an unpredictable value. The selected half-word 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 half-word.  
A half-word 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 half-word subsystem to store the data.  
Note that the address must be half-word aligned, if bit 0 of the address is high this will cause unpredictable  
behaviour.  
3-36  
S3C4510B  
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 half-word 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 half-word boundary, (A[1] =1). The supplied  
address should always be on a half-word boundary. If bit 0 of the supplied address is high then the ARM7TDMI  
will load an unpredictable value. The selected half-word 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 half-word.  
A half-word 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 half-word subsystem to store the data.  
Note that the address must be half-word 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.  
R15 should not be specified as the register offset (Rm).  
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.  
INSTRUCTION CYCLE TIMES  
Normal LDR(H, SH, SB) instructions take 1S + 1N + 1I. LDR(H, SH, SB) PC take 2S + 2N + 1I incremental  
cycles. S,N and I are defined as sequential (S-cycle), non-sequential (N-cycle), and internal (I-cycle),  
respectively. STRH instructions take 2N incremental cycles to execute.  
3-37  
INSTRUCTION SET  
S3C4510B  
ASSEMBLER SYNTAX  
<LDR|STR>{cond}<H|SH|SB> Rd,<address>  
LDR  
STR  
{cond}  
H
Load from memory into a register  
Store from a register into memory  
Two-character condition mnemonic. See Table 3-2.  
Transfer half-word quantity  
SB  
Load sign extended byte (Only valid for LDR)  
Load sign extended half-word (Only valid for LDR)  
An expression evaluating to a valid register number.  
SH  
Rd  
<address> can be:  
1
An expression which generates an address:  
The assembler will attempt to generate an instruction using the PC as a base and a  
corrected immediate offset to address the location given by evaluating the  
expression. This will be a PC relative, pre-indexed address. If the address is out of  
range, an error will be generated.  
2
A pre-indexed addressing specification:  
[Rn]  
offset of zero  
[Rn,<#expression>]{!}  
[Rn,{+/-}Rm]{!}  
offset of <expression> bytes  
offset of +/- contents of index register  
3
A post-indexed addressing specification:  
[Rn],<#expression>  
[Rn],{+/-}Rm  
offset of <expression> bytes  
offset of +/- contents of index register.  
4
Rn and Rm are expressions evaluating to a register number. If Rn is R15 then the  
assembler will subtract 8 from the offset value to allow for ARM7TDMI pipelining.  
In this case base write-back should not be specified.  
{!}  
Writes back the base register (set the W bit) if ! is present.  
3-38  
S3C4510B  
Examples  
INSTRUCTION SET  
LDRH  
R1,[R2,-R3]!  
; Load R1 from the contents of the half-word address  
; contained in R2-R3 (both of which are registers)  
; and write back address to R2  
STRH  
LDRSB  
R3,[R4,#14]  
R8,[R2],#-223  
; Store the half-word in R3 at R14+14 but don't write back.  
; Load R8 with the sign extended contents of the byte  
; address contained in R2 and write back R2-223 to R2.  
; Conditionally load R11 with the sign extended contents  
; of the half-word address contained in R0.  
LDRNESH R11,[R0]  
HERE  
; Generate PC relative offset to address FRED.  
STRH  
FRED  
R5, [PC,#(FRED-HERE-8)]; Store the half-word in R5 at address FRED  
3-39  
INSTRUCTION SET  
S3C4510B  
BLOCK DATA TRANSFER (LDM, STM)  
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 REGISTER LIST  
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
100  
P U S W L  
Rn  
Register list  
Cond  
[19:16] Base Register  
[20] Load/Store Bit  
0 = Store to memory  
1 = Load from memory  
[21] Write-back Bit  
0 = No write-back  
1 = Write address into base  
[22] PSR & Force User Bit  
0 = Do not load PSR or user mode  
1 = Load PSR or force user mode  
[23] Up/Down Bit  
0 = Down: subtract offset from base  
1 = Up: add offset to base  
[24] Pre/Post Indexing Bit  
0 = Post: add offset after transfer  
1 = Pre: add offset bofore transfer  
[31:28] Condition Field  
Figure 3-18. Block Data Transfer Instructions  
3-40  
S3C4510B  
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  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
Rn  
R1  
2
1
Rn  
R7  
R5  
R1  
R5  
R1  
3
4
Figure 3-19. Post-Increment Addressing  
3-41  
INSTRUCTION SET  
S3C4510B  
0x100C  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
R1  
Rn  
1
2
Rn  
R7  
R5  
R1  
R5  
R1  
3
4
Figure 3-20. Pre-Increment Addressing  
0x100C  
0x1000  
0x100C  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
Rn  
R1  
0x0FF4  
1
2
0x100C  
0x1000  
0x0FF4  
R7  
R5  
R1  
R5  
R1  
Rn  
3
4
Figure 3-21. Post-Decrement Addressing  
3-42  
S3C4510B  
INSTRUCTION SET  
0x100C  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
0x100C  
0x1000  
0x0FF4  
Rn  
R1  
2
1
R7  
R5  
R1  
4
R5  
R1  
3
Rn  
Figure 3-22. Pre-Decrement Addressing  
USE OF THE S BIT  
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.  
R15 not in List and S Bit Set (User Bank Transfer)  
For both LDM and STM instructions, the user bank registers are transferred rather than the register 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).  
USE OF R15 AS THE BASE  
R15 should not be used as the base register in any LDM or STM instruction.  
3-43  
INSTRUCTION SET  
S3C4510B  
INCLUSION OF THE BASE IN THE REGISTER LIST  
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.  
Aborts during STM Instructions  
If the abort occurs during a store multiple instruction, ARM7TDMI takes little action until the instruction  
completes, whereupon it enters the data abort trap. The memory manager is responsible for preventing  
erroneous writes to the memory. The only change to the internal state of the processor will be the modification of  
the base register if write-back was specified, and this must be reversed by software (and the cause of the abort  
resolved) before the instruction may be retried.  
Aborts during LDM Instructions  
When ARM7TDMI detects a data abort during a load multiple instruction, it modifies the operation of the  
instruction to ensure that recovery is possible.  
— 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.  
INSTRUCTION CYCLE TIMES  
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  
S3C4510B  
INSTRUCTION SET  
ASSEMBLER SYNTAX  
<LDM|STM>{cond}<FD|ED|FA|EA|IA|IB|DA|DB> Rn{!},<Rlist>{^}  
where:  
{cond}  
Rn  
Two character condition mnemonic. See Table 3-2.  
An expression evaluating to a valid register number  
<Rlist>  
{!}  
A list of registers and register ranges enclosed in {} (e.g. {R0, R2–R7, R10}).  
If present requests write-back (W = 1), otherwise W = 0.  
{^}  
If present set S bit to load the CPSR along with the PC, or force transfer of user  
bank when in privileged mode.  
Addressing Mode Names  
There are different assembler mnemonics for each of the addressing modes, depending on whether the  
instruction is being used to support stacks or for other purposes. The equivalence between the names and the  
values of the bits in the instruction are shown in the following table 3-6.  
Table 3-6. Addressing Mode Names  
Name  
Pre-Increment load  
Stack  
Other  
LDMIB  
LDMIA  
LDMDB  
LDMDA  
STMIB  
STMIA  
STMDB  
STMDA  
L Bit  
P Bit  
U Bit  
LDMED  
LDMFD  
LDMEA  
LDMFA  
STMFA  
STMEA  
STMFD  
STMED  
1
1
1
1
0
0
0
0
1
0
1
0
1
0
1
0
1
1
0
0
1
1
0
0
Post-Increment load  
Pre-Decrement load  
Post-Decrement load  
Pre-Increment store  
Post-Increment store  
Pre-Decrement store  
Post-Decrement store  
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  
INSTRUCTION SET  
Examples  
S3C4510B  
LDMFD  
SP!,{R0,R1,R2}  
R0,{R0-R15}  
SP!,{R15}  
; Unstack 3 registers.  
; Save all registers.  
STMIA  
LDMFD  
LDMFD  
; R15 <- (SP), CPSR unchanged.  
; R15 <- (SP), CPSR <- SPSR_mode  
; (allowed only in privileged modes).  
; Save user mode regs on stack  
; (allowed only in privileged modes).  
SP!,{R15}^  
STMFD  
R13,{R0-R14}^  
These instructions may be used to save state on subroutine entry, and restore it efficiently on return to the calling  
routine:  
STMED  
SP!,{R0–R3,R14}  
; Save R0 to R3 to use as workspace  
; and R14 for returning.  
BL  
LDMED  
somewhere  
SP!,{R0–R3,R15}  
; This nested call will overwrite R14  
; Restore workspace and return.  
3-46  
S3C4510B  
INSTRUCTION SET  
SINGLE DATA SWAP (SWP)  
31  
28 27  
23 22 21 20 19  
00  
16 15  
12 11  
8
7
4
3
0
00010  
B
Rn  
Rd  
0000  
1001  
Rm  
Cond  
[3:0] Source Register  
[15:12] Destination Register  
[19:16] Base Register  
[22] Byte/Word Bit  
0 = Swap word quantity  
1 = Swap word quantity  
[31:28] Condition Field  
Figure 3-23. Swap Instruction  
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.  
BYTES AND WORDS  
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.  
USE OF R15  
Do not use R15 as an operand (Rd, Rn or Rs) in a SWP instruction.  
3-47  
INSTRUCTION SET  
DATA ABORTS  
S3C4510B  
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.  
INSTRUCTION CYCLE TIMES  
Swap instructions take 1S + 2N +1I incremental cycles to execute, where S, N and I are defined as squential (S-  
cycle), non-sequential, and internal (I-cycle), respectively.  
ASSEMBLER SYNTAX  
<SWP>{cond}{B} Rd,Rm,[Rn]  
{cond}  
{B}  
Two-character condition mnemonic. See Table 3-2.  
If B is present then byte transfer, otherwise word transfer  
Expressions evaluating to valid register numbers  
Rd,Rm,Rn  
Examples  
SWP  
R0,R1,[R2]  
R2,R3,[R4]  
R0,R0,[R1]  
; Load R0 with the word addressed by R2, and  
; store R1 at R2.  
; Load R2 with the byte addressed by R4, and  
; store bits 0 to 7 of R3 at R4.  
; Conditionally swap the contents of the  
; word addressed by R1 with R0.  
SWPB  
SWPEQ  
3-48  
S3C4510B  
INSTRUCTION SET  
SOFTWARE INTERRUPT (SWI)  
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
1111  
Cond  
Comment Field (Ignored by Processor)  
[31:28] Condition Field  
Figure 3-24. Software Interrupt Instruction  
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.  
RETURN FROM THE SUPERVISOR  
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.  
INSTRUCTION CYCLE TIMES  
Software interrupt instructions take 2S + 1N incremental cycles to execute, where S and N are defined as  
squential (S-cycle) and non-squential (N-cycle).  
3-49  
INSTRUCTION SET  
S3C4510B  
ASSEMBLER SYNTAX  
SWI{cond} <expression>  
{cond}  
Two character condition mnemonic, Table 3-2.  
Evaluated and placed in the comment field (which is ignored by ARM7TDMI).  
<expression>  
Examples  
SWI  
SWI  
SWINE  
ReadC  
WriteI+ “k”  
0
; Get next character from read stream.  
; Output a “k” to the write stream.  
; Conditionally call supervisor with 0 in comment field.  
Supervisor code  
The previous examples assume that suitable supervisor code exists, for instance:  
0x08 B Supervisor  
EntryTable  
DCD ZeroRtn  
DCD ReadCRtn  
DCD WriteIRtn  
. . .  
; SWI entry point  
; Addresses of supervisor routines  
Zero  
EQU 0  
ReadC  
WriteI  
EQU 256  
EQU 512  
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  
; Save work registers and return address.  
; Get SWI instruction.  
STMFD  
LDR  
R13,{R0-R2,R14}  
R0,[R14,#-4]  
BIC  
MOV  
R0,R0,#0xFF000000  
R1,R0,LSR#8  
; Clear top 8 bits.  
; Get routine offset.  
ADR  
LDR  
R2,EntryTable  
R15,[R2,R1,LSL#2]  
; Get start address of entry table.  
; Branch to appropriate routine.  
WriteIRtn  
. . . . . .  
LDMFD  
; Enter with character in R0 bits 0-7.  
R13,{R0-R2,R15}^  
; Restore workspace and return,  
; restoring processor mode and flags.  
3-50  
S3C4510B  
INSTRUCTION SET  
COPROCESSOR DATA OPERATIONS (CDP)  
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 KS32C6200, 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 KS32C6200.  
These coprocessor instructions can be emulated by the undefined trap handler. Even though external  
coprocessor can not be connected to the KS32C6200, 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
0
Cond  
1110  
CP Opc  
CRn  
CRd  
Cp#  
Cp  
CRm  
[3:0] Coprocessor operand register  
[7:5] Coprocessor information  
[11:8] Coprocessor number  
[15:12] Coprocessor destination register  
[19:16] Coprocessor operand register  
[23:20] Coprocessor operation code  
[31:28] Condition Field  
Figure 3-25. Coprocessor Data Operation Instruction  
THE COPROCESSOR FIELDS  
Only bit 4 and bits 24 to 31 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  
INSTRUCTION SET  
S3C4510B  
INSTRUCTION CYCLE TIMES  
Coprocessor data operations take 1S + bI incremental cycles to execute, where b is the number of cycles spent  
in the coprocessor busy-wait loop.  
S and I are defined as sequential (S-cycle) and internal (I-cycle).  
ASSEMBLER SYNTAX  
CDP{cond} p#,<expression1>,cd,cn,cm{,<expression2>}  
{cond}  
Two character condition mnemonic. See Table 3-2.  
The unique number of the required coprocessor  
Evaluated to a constant and placed in the CP Opc field  
p#  
<expression1>  
cd, cn and cm  
Evaluate to the valid coprocessor register numbers CRd, CRn and CRm  
respectively  
<expression2>  
Where present is evaluated to a constant and placed in the CP field  
Examples  
CDP  
CDPEQ  
p1,10,c1,c2,c3  
p2,5,c1,c2,c3,2  
; Request coproc 1 to do operation 10  
; on CR2 and CR3, and put the result in CR1.  
; If Z flag is set request coproc 2 to do operation 5 (type 2)  
; on CR2 and CR3, and put the result in CR1.  
3-52  
S3C4510B  
INSTRUCTION SET  
COPROCESSOR DATA TRANSFERS (LDC, STC)  
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 coprocessor'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
110  
P U N W L  
Rn  
CRd  
CP#  
Offset  
Cond  
[7:0] Unsigned 8 Bit Immediate Offset  
[11:8] Coprocessor Number  
[15:12] Coprocessor Source/Destination Register  
[19:16] Base Register  
[20] Load/Store Bit  
0 = Store to memory  
1 = Load from memory  
[21] Write-back Bit  
0 = No write-back  
1 = Write address into base  
[22] Transfer Length  
[23] Up/Down Bit  
0 = Down: subtract offset from base  
1 = Up: add offset to base  
[24] Pre/Post Indexing Bit  
0 = Post: add offset after transfer  
1 = Pre: add offset bofore transfer  
[31:28] Condition Field  
Figure 3-26. Coprocessor Data Transfer Instructions  
THE COPROCESSOR FIELDS  
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  
INSTRUCTION SET  
S3C4510B  
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.  
INSTRUCTION CYCLE TIMES  
Coprocessor data transfer instructions take (n-1)S + 2N + bI incremental cycles to execute, where:  
The number of words transferred.  
n
b
The number of cycles spent in the coprocessor busy-wait loop.  
S, N and I are defined as sequential (S-cycle), non-sequential (N-cycle), and internal (I-cycle), respectively.  
3-54  
S3C4510B  
INSTRUCTION SET  
ASSEMBLER SYNTAX  
<LDC|STC>{cond}{L} p#,cd,<Address>  
LDC  
STC  
{L}  
Load from memory to coprocessor  
Store from coprocessor to memory  
When present perform long transfer (N = 1), otherwise perform short transfer  
(N = 0)  
{cond}  
Two character condition mnemonic. See Table 3-2.  
The unique number of the required coprocessor  
p#  
cd  
An expression evaluating to a valid coprocessor register number that is placed in  
the CRd field  
<Address> can be:  
1
An expression which generates an address:  
The assembler will attempt to generate an instruction using the PC as a base and a  
corrected immediate offset to address the location given by evaluating the  
expression. This will be a PC relative, pre-indexed address. If the address is out of  
range, an error will be generated  
2
A pre-indexed addressing specification:  
[Rn]  
offset of zero  
[Rn,<#expression>]{!}  
offset of <expression> bytes  
A post-indexed addressing specification:  
Rn],<#expression  
{!}  
offset of <expression> bytes  
write back the base register (set the W bit) if! is  
present  
Rn  
is an expression evaluating to a valid  
ARM7TDMI register number.  
NOTE  
If Rn is R15, the assembler will subtract 8 from the offset value to allow for ARM7TDMI pipelining.  
Examples  
LDC  
p1,c2,table  
; Load c2 of coproc 1 from address  
; table, using a PC relative address.  
STCEQL  
p2,c3,[R5,#24]!  
; Conditionally store c3 of coproc 2  
; into an address 24 bytes up from R5,  
; write this address back to R5, and use  
; long transfer option (probably to store multiple words).  
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  
INSTRUCTION SET  
S3C4510B  
COPROCESSOR REGISTER TRANSFERS (MRC, MCR)  
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
1110  
CP Opc L  
CRn  
Rd  
CP#  
CP  
1
CRm  
Cond  
[3:0] Coprocessor Operand Register  
[7:5] Coprocessor Information  
[11:8] Coprocessor Number  
[15:12] ARM source/Destination Register  
[19:16] Coprocessor Source/Destination Register  
[20] Load/Store Bit  
0 = Store to coprocessor  
1 = Load from coprocessor  
[21] Coprocessor Operation Mode  
[31:28] Condition Field  
Figure 3-27. Coprocessor Register Transfer Instructions  
THE COPROCESSOR FIELDS  
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  
S3C4510B  
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.  
TRANSFERS FROM R15  
A coprocessor register transfer from ARM7TDMI with R15 as the source register will store the PC+ 12.  
INSTRUCTION CYCLE TIMES  
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>}  
MRC  
Move from coprocessor to ARM7TDMI register (L = 1)  
Move from ARM7TDMI register to coprocessor (L = 0)  
Two character condition mnemonic. See Table 3-2.  
The unique number of the required coprocessor  
MCR  
{cond}  
p#  
<expression1>  
Rd  
Evaluated to a constant and placed in the CP Opc field  
An expression evaluating to a valid ARM7TDMI register number  
cn and cm  
Expressions evaluating to the valid coprocessor register numbers CRn and CRm  
respectively  
<expression2>  
Where present is evaluated to a constant and placed in the CP field  
Examples  
MRC  
p2,5,R3,c5,c6  
; Request coproc 2 to perform operation 5  
; on c5 and c6, and transfer the (single  
; 32-bit word) result back to R3.  
MCR  
p6,0,R4,c5,c6  
; Request coproc 6 to perform operation 0  
; on R4 and place the result in c6.  
MRCEQ  
p3,9,R3,c5,c6,2  
; Conditionally request coproc 3 to  
; perform operation 9 (type 2) on c5 and  
; c6, and transfer the result back to R3.  
3-57  
INSTRUCTION SET  
S3C4510B  
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
xxxxxxxxxxxxxxxxxxxx  
xxxx  
011  
1
Cond  
Figure 3-28. Undefined Instruction  
If the condition is true, the undefined instruction trap will be taken.  
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.  
INSTRUCTION CYCLE TIMES  
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  
S3C4510B  
INSTRUCTION SET  
INSTRUCTION SET EXAMPLES  
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.  
USING THE CONDITIONAL INSTRUCTIONS  
Using Conditionals for Logical OR  
CMP  
BEQ  
CMP  
BEQ  
Rn,#p  
Label  
Rm,#q  
Label  
; If Rn=p OR Rm=q THEN GOTO Label.  
This can be replaced by  
CMP  
CMPNE  
BEQ  
Rn,#p  
Rm,#q  
Label  
; If condition not satisfied try other test.  
Absolute Value  
TEQ  
Rn,#0  
; Test sign  
RSBMI  
Rn,Rn,#0  
; and 2's complement if necessary.  
Multiplication by 4, 5 or 6 (Run Time)  
MOV  
CMP  
Rc,Ra,LSL#2  
Rb,#5  
; Multiply by 4,  
; Test value,  
ADDCS  
ADDHI  
Rc,Rc,Ra  
Rc,Rc,Ra  
; Complete multiply by 5,  
; Complete multiply by 6.  
Combining Discrete and Range Tests  
TEQ  
CMPNE  
MOVLS  
Rc,#127  
Rc,# ” ”-1  
Rc,# “”  
; Discrete test,  
; Range test  
; IF Rc<= ”” OR Rc=ASCII(127)  
; THEN Rc:= ” ”  
3-59  
INSTRUCTION SET  
S3C4510B  
Division and Remainder  
A number of divide routines for specific applications are provided in source form as part of the ANSI C library  
provided with the ARM Cross development toolkit, available from your supplier. A short general purpose divide  
routine follows.  
; Enter with numbers in Ra and Rb.  
MOV  
Rcnt,#1  
; Bit to control the division.  
Div1  
Div2  
CMP  
Rb,#0x80000000  
Rb,Ra  
Rb,Rb,ASL#1  
Rcnt,Rcnt,ASL#1  
Div1  
; Move Rb until greater than Ra.  
CMPCC  
MOVCC  
MOVCC  
BCC  
MOV  
CMP  
SUBCS  
ADDCS  
MOVS  
MOVNE  
BNE  
Rc,#0  
Ra,Rb  
; Test for possible subtraction.  
; Subtract if ok,  
; Put relevant bit into result  
; Shift control bit  
; Halve unless finished.  
; Divide result in Rc, remainder in Ra.  
Ra,Ra,Rb  
Rc,Rc,Rcnt  
Rcnt,Rcnt,LSR#1  
Rb,Rb,LSR#1  
Div2  
Overflow Detection in the ARM7TDMI  
1. Overflow in unsigned multiply with a 32-bit result  
UMULL  
TEQ  
Rd,Rt,Rm,Rn  
Rt,#0  
; 3 to 6 cycles  
; +1 cycle and a register  
BNE  
overflow  
2. Overflow in signed multiply with a 32-bit result  
SMULL  
TEQ  
BNE  
Rd,Rt,Rm,Rn  
Rt,Rd ASR#31  
overflow  
; 3 to 6 cycles  
; +1 cycle and a register  
3. Overflow in unsigned multiply accumulate with a 32 bit result  
UMLAL  
TEQ  
Rd,Rt,Rm,Rn  
Rt,#0  
; 4 to 7 cycles  
; +1 cycle and a register  
BNE  
overflow  
4. Overflow in signed multiply accumulate with a 32 bit result  
SMLAL  
TEQ  
BNE  
Rd,Rt,Rm,Rn  
Rt,Rd, ASR#31  
overflow  
; 4 to 7 cycles  
; +1 cycle and a register  
3-60  
S3C4510B  
INSTRUCTION SET  
5. Overflow in unsigned multiply accumulate with a 64 bit result  
UMULL  
ADDS  
ADC  
Rl,Rh,Rm,Rn  
Rl,Rl,Ra1  
Rh,Rh,Ra2  
overflow  
; 3 to 6 cycles  
; Lower accumulate  
; Upper accumulate  
; 1 cycle and 2 registers  
BCS  
6. Overflow in signed multiply accumulate with a 64 bit result  
SMULL  
ADDS  
ADC  
Rl,Rh,Rm,Rn  
Rl,Rl,Ra1  
Rh,Rh,Ra2  
overflow  
; 3 to 6 cycles  
; Lower accumulate  
; Upper accumulate  
; 1 cycle and 2 registers  
BVS  
NOTE  
Overflow checking is not applicable to unsigned and signed multiplies with a 64-bit result, since overflow  
does not occur in such calculations.  
PSEUDO-RANDOM BINARY SEQUENCE GENERATOR  
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:  
; Enter with seed in Ra (32 bits),  
; Rb (1 bit in Rb lsb), uses Rc.  
TST  
Rb,Rb,LSR#1  
Rc,Ra,RRX  
Rb,Rb,Rb  
Rc,Rc,Ra,LSL#12  
Ra,Rc,Rc,LSR#20  
; Top bit into carry  
; 33 bit rotate right  
; Carry into lsb of Rb  
; (involved!)  
MOVS  
ADC  
EOR  
EOR  
; (similarly involved!) new seed in Ra, Rb as before  
MULTIPLICATION BY CONSTANT USING THE BARREL SHIFTER  
Multiplication by 2^n (1,2,4,8,16,32..)  
MOV  
Ra, Rb, LSL #n  
Multiplication by 2^n+1 (3,5,9,17..)  
ADD  
Ra,Ra,Ra,LSL #n  
Multiplication by 2^n-1 (3,7,15..)  
RSB  
Ra,Ra,Ra,LSL #n  
3-61  
INSTRUCTION SET  
Multiplication by 6  
S3C4510B  
ADD  
MOV  
Ra,Ra,Ra,LSL #1  
Ra,Ra,LSL#1  
; Multiply by 3  
; and then by 2  
Multiply by 10 and add in extra number  
ADD  
ADD  
Ra,Ra,Ra,LSL#2  
Ra,Rc,Ra,LSL#1  
; Multiply by 5  
; Multiply by 2 and add in next digit  
General recursive method for Rb := Ra*C, C a constant:  
1. If C even, say C = 2^n*D, D odd:  
D=1:  
D<>1:  
MOV  
MOV Rb,Ra,LSL #n  
{Rb := Ra*D}  
Rb,Rb,LSL #n  
2. If C MOD 4 = 1, say C = 2^n*D+1, D odd, n>1:  
D=1:  
D<>1:  
ADD  
ADD Rb,Ra,Ra,LSL #n  
{Rb := Ra*D}  
Rb,Ra,Rb,LSL #n  
3. If C MOD 4 = 3, say C = 2^n*D-1, D odd, n>1:  
D=1:  
D<>1:  
RSB  
RSB Rb,Ra,Ra,LSL #n  
{Rb := Ra*D}  
Rb,Ra,Rb,LSL #n  
This is not quite optimal, but close. An example of its non-optimality is multiply by 45 which is done by:  
RSB  
RSB  
ADD  
Rb,Ra,Ra,LSL#2  
Rb,Ra,Rb,LSL#2  
Rb,Ra,Rb,LSL# 2  
; Multiply by 3  
; Multiply by 4*3-1 = 11  
; Multiply by 4*11+1 = 45  
rather than by:  
ADD  
ADD  
Rb,Ra,Ra,LSL#3  
Rb,Rb,Rb,LSL#2  
; Multiply by 9  
; Multiply by 5*9 = 45  
3-62  
S3C4510B  
INSTRUCTION SET  
LOADING A WORD FROM AN UNKNOWN ALIGNMENT  
; Enter with address in Ra (32 bits) uses  
; Rb, Rc result in Rd. Note d must be less than c e.g. 0,1  
; Get word aligned address  
BIC  
Rb,Ra,#3  
LDMIA  
AND  
Rb,{Rd,Rc}  
Rb,Ra,#3  
; Get 64 bits containing answer  
; Correction factor in bytes  
MOVS  
MOVNE  
RSBNE  
ORRNE  
Rb,Rb,LSL#3  
Rd,Rd,LSR Rb  
Rb,Rb,#32  
;
...now in bits and test if aligned  
; Produce bottom of result word (if not aligned)  
; Get other shift amount  
; Combine two halves to get result  
Rd,Rd,Rc,LSL Rb  
3-63  
INSTRUCTION SET  
S3C4510B  
THUMB INSTRUCTION SET FORMAT  
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
1
2
3
0
0
0
0
0
0
0
0
1
Op  
Offset5  
Rs  
Rs  
Rd  
Rd  
Move Shifted register  
Add/subtract  
1
1
I
Op Rn/offset3  
Rd  
Op  
Offset8  
Move/compare/add/  
subtract immediate  
4
5
0
0
1
1
0
0
0
0
0
0
0
1
Op  
Rs  
Rd  
ALU operations  
Op  
Rd  
H1 H2  
Rs/Hs  
Rd/Hd  
Hi regiter operations  
/branch exchange  
PC-relative load  
6
7
0
0
1
1
0
0
0
1
1
L
Word8  
Rb  
B
S
0
Ro  
Ro  
Rd  
Rd  
Rd  
Rd  
Load/store with register  
offset  
8
9
0
0
1
1
0
1
1
H
L
1
Rb  
Rb  
Load/store sign-extended  
byte/halfword  
B
Offset5  
Offset5  
Load/store with immediate  
offset  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
1
1
1
1
1
0
0
1
1
1
0
0
0
1
1
0
1
0
1
1
0
1
1
0
1
L
L
Rb  
Load/store halfword  
SP-relative load/store  
Load address  
Rd  
Rd  
0
Word8  
Word8  
SP  
0
0
1
0
S
SWord7  
Rlist  
Add offset to stack pointer  
Push/pop register  
L
0
R
L
Rb  
Rlist  
Multiple load/store  
Conditional branch  
Software interrupt  
Cond  
Softset8  
Value8  
1
0
1
1
1
Offset11  
Offset  
Unconditional branch  
Long branch with link  
H
15 14 13 12 11 10  
9
8
7
6
5
4
3
2
1
0
Figure 3-29. THUMB Instruction Set Formats  
3-64  
S3C4510B  
INSTRUCTION SET  
OPCODE SUMMARY  
The following table summarises the THUMB instruction set. For further information about a particular instruction  
please refer to the sections listed in the right-most column.  
Table 3-7. THUMB Instruction Set Opcodes  
Mnemonic  
ADC  
Instruction  
Lo-Register  
Operand  
Hi-Register  
Operand  
Condition  
Codes Set  
Add with carry  
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V
V (1)  
V
V
ADD  
AND  
ASR  
B
Add  
AND  
Arithmetic shift right  
Unconditional branch  
Conditional branch  
Bit clear  
Bxx  
BIC  
V
BL  
Branch and link  
Branch and exchange  
Compare negative  
Compare  
BX  
CMN  
CMP  
EOR  
LDMIA  
LDR  
LDRB  
LDRH  
LSL  
V
V
V
EOR  
Load multiple  
Load word  
Load byte  
Load half-word  
Logical shift left  
Load sign-extended byte  
Load sign-extended half-word  
Logical shift right  
Move register  
Multiply  
V
LDSB  
LDSH  
LSR  
MOV  
MUL  
MVN  
NEG  
ORR  
POP  
PUSH  
POR  
V
V (2)  
V
V
V
V
Move negative register  
Negate  
OR  
Pop registers  
Push registers  
Rotate right  
V
3-65  
INSTRUCTION SET  
Mnemonic  
S3C4510B  
Table 3-7. THUMB Instruction Set Opcodes (Continued)  
Instruction  
Lo-Register  
Operand  
Hi-Register  
Operand  
Condition  
Codes Set  
SBC  
Subtract with carry  
V
V
V
V
V
V
V
V
STMIA  
STR  
Store multiple  
Store word  
Store byte  
STRB  
STRH  
SWI  
Store half-word  
Software interrupt  
Subtract  
SUB  
V
V
TST  
Test bits  
NOTES:  
1. The condition codes are unaffected by the format 5, 12 and 13 versions of this instruction.  
2. The condition codes are unaffected by the format 5 version of this instruction.  
3-66  
S3C4510B  
INSTRUCTION SET  
FORMAT 1: MOVE SHIFTED REGISTER  
11  
10  
3
2
15  
14  
13  
12  
6
5
0
Offset5  
Rs  
Rd  
0
0
0
Op  
[2:0] Destination Register  
[5:3] Source Register  
[10:6] Immediate Vale  
[12:11] Opcode  
0 = LSL  
1 = LSR  
2 = ASR  
Figure 3-30. Format 1  
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.  
Table 3-8. Summary of Format 1 Instructions  
OP  
THUMB Assembler  
ARM Equivalent  
Action  
00  
LSL Rd, Rs, #Offset5  
MOVS Rd, Rs, LSL #Offset5  
Shift Rs left by a 5-bit immediate value and  
store the result in Rd.  
01  
10  
LSR Rd, Rs, #Offset5  
ASR Rd, Rs, #Offset5  
MOVS Rd, Rs, LSR #Offset5 Perform logical shift right on Rs by a 5-bit  
immediate value and store the result in Rd.  
MOVS Rd, Rs, ASR #Offset5 Perform arithmetic shift right on Rs by a 5-bit  
immediate value and store the result in Rd.  
INSTRUCTION CYCLE TIMES  
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  
LSR  
R2, R5, #27  
; Logical shift right the contents  
; of R5 by 27 and store the result in R2.  
; Set condition codes on the result.  
3-67  
INSTRUCTION SET  
S3C4510B  
FORMAT 2: ADD/SUBTRACT  
15  
14  
13  
12  
11  
10  
9
8
6
5
3
2
0
Rn/Offset3  
Rs  
Rd  
0
0
0
1
1
1
Op  
[2:0] Destination Register  
[5:3] Source Register  
[8:6] Register/Immediate Value  
[9] Opcode  
0 = ADD  
1 = SUB  
[10] Immediate Flag  
0 = Register operand  
1 = Immediate oerand  
Figure 3-31. Format 2  
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.  
Table 3-9. Summary of Format 2 Instructions  
OP  
I
THUMB Assembler  
ARM Equivalent  
Action  
0
0
ADD Rd, Rs, Rn  
ADDS Rd, Rs, Rn  
Add contents of Rn to contents of Rs.  
Place result in Rd.  
0
1
1
1
0
1
ADD Rd, Rs, #Offset3 ADDS Rd, Rs, #Offset3 Add 3-bit immediate value to contents of Rs.  
Place result in Rd.  
SUB Rd, Rs, Rn  
SUBS Rd, Rs, Rn  
Subtract contents of Rn from contents of Rs.  
Place result in Rd.  
SUB Rd, Rs, #Offset3 SUBS Rd, Rs, #Offset3 Subtract 3-bit immediate value from contents  
of Rs. Place result in Rd.  
3-68  
S3C4510B  
INSTRUCTION SET  
INSTRUCTION CYCLE TIMES  
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  
ADD  
SUB  
R0, R3, R4  
R6, R2, #6  
; R0 : = R3 + R4 and set condition codes on the result.  
; R6 : = R2 - 6 and set condition codes.  
3-69  
INSTRUCTION SET  
S3C4510B  
FORMAT 3: MOVE/COMPARE/ADD/SUBTRACT IMMEDIATE  
15  
14  
13  
12  
11  
10  
8
7
0
Rd  
Offset8  
0
0
0
Op  
[7:0] Immediate Value  
[10:8] Source/Destination Register  
[12:11] Opcode  
0 = MOV  
1 = CMP  
2 = ADD  
3 = SUB  
Figure 3-32. Format 3  
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.  
Table 3-10. Summary of Format 3 Instructions  
OP  
00  
THUMB Assembler  
MOV Rd, #Offset8  
CMP Rd, #Offset8  
ARM Equivalent  
MOVS Rd, #Offset8  
CMP Rd, #Offset8  
Action  
Move 8-bit immediate value into Rd.  
01  
Compare contents of Rd with 8-bit immediate  
value.  
10  
11  
ADD Rd, #Offset8  
SUB Rd, #Offset8  
ADDS Rd, Rd, #Offset8 Add 8-bit immediate value to contents of Rd and  
place the result in Rd.  
SUBS Rd, Rd, #Offset8 Subtract 8-bit immediate value from contents of  
Rd and place the result in Rd.  
INSTRUCTION CYCLE TIMES  
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  
MOV  
CMP  
ADD  
SUB  
R0, #128  
R2, #62  
R1, #255  
R6, #145  
; R0 : = 128 and set condition codes  
; Set condition codes on R2 - 62  
; R1 : = R1 + 255 and set condition codes  
; R6 : = R6 - 145 and set condition codes  
3-70  
S3C4510B  
INSTRUCTION SET  
FORMAT 4: ALU OPERATIONS  
11  
10  
9
3
2
15  
14  
13  
12  
6
5
0
Rs  
Rd  
0
0
0
0
0
0
Op  
[2:0] Source/Destination Register  
[5:3] Source Register 2  
[9:6] Opcode  
Figure 3-33. Format 4  
OPERATION  
The following instructions perform ALU operations on a Lo register pair.  
NOTE  
All instructions in this group set the CPSR condition codes  
Table 3-11. Summary of Format 4 Instructions  
OP  
THUMB Assembler  
ARM Equivalent  
ANDS Rd, Rd, Rs  
Action  
0000 AND Rd, Rs  
0001 EOR Rd, Rs  
0010 LSL Rd, Rs  
0011 LSR Rd, Rs  
0100 ASR Rd, Rs  
0101 ADC Rd, Rs  
0110 SBC Rd, Rs  
0111 ROR Rd, Rs  
1000 TST Rd, Rs  
1001 NEG Rd, Rs  
1010 CMP Rd, Rs  
1011 CMN Rd, Rs  
1100 ORR Rd, Rs  
1101 MUL Rd, Rs  
1110 BIC Rd, Rs  
1111 MVN Rd, Rs  
Rd: = Rd AND Rs  
Rd: = Rd EOR Rs  
Rd : = Rd << Rs  
Rd : = Rd >> Rs  
Rd : = Rd ASR Rs  
EORS Rd, Rd, Rs  
MOVS Rd, Rd, LSL Rs  
MOVS Rd, Rd, LSR Rs  
MOVS Rd, Rd, ASR Rs  
ADCS Rd, Rd, Rs  
SBCS Rd, Rd, Rs  
MOVS Rd, Rd, ROR Rs  
TST Rd, Rs  
Rd : = Rd + Rs + C-bit  
Rd : = Rd - Rs - NOT C-bit  
Rd : = Rd ROR Rs  
Set condition codes on Rd AND Rs  
Rd = - Rs  
RSBS Rd, Rs, #0  
CMP Rd, Rs  
Set condition codes on Rd - Rs  
Set condition codes on Rd + Rs  
Rd: = Rd OR Rs  
CMN Rd, Rs  
ORRS Rd, Rd, Rs  
MULS Rd, Rs, Rd  
BICS Rd, Rd, Rs  
MVNS Rd, Rs  
Rd: = Rs * Rd  
Rd: = Rd AND NOT Rs  
Rd: = NOT Rs  
3-71  
INSTRUCTION SET  
S3C4510B  
INSTRUCTION CYCLE TIMES  
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  
EOR  
ROR  
R3, R4  
R1, R0  
; R3 : = R3 EOR R4 and set condition codes  
; Rotate right R1 by the value in R0, store  
; the result in R1 and set condition codes  
; Subtract the contents of R3 from zero,  
NEG  
R5, R3  
; store the result in R5. Set condition codes ie R5 = - R3  
; Set the condition codes on the result of R2 - R6  
; R0 : = R7 * R0 and set condition codes  
CMP  
MUL  
R2, R6  
R0, R7  
3-72  
S3C4510B  
INSTRUCTION SET  
FORMAT 5: HI-REGISTER OPERATIONS/BRANCH EXCHANGE  
11  
10  
9
8
7
3
2
15  
14  
13  
12  
6
5
0
Rs/Hs  
Rd/Hd  
0
0
0
0
0
0
Op  
H1  
H2  
[2:0] Destination Register  
[5:3] Source Register  
[6] Hi Operand Flag 2  
[7] Hi Operand Flag 1  
[9:8] Opcode  
Figure 3-34. Format 5  
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-73  
INSTRUCTION SET  
OP H1 H2  
S3C4510B  
Table 3-12. Summary of Format 5 Instructions  
THUMB Assembler  
ARM Equivalent  
Action  
00  
0
1
ADD Rd, Hs  
ADD Rd, Rd, Hs  
Add a register in the range 8-15 to a register in  
the range 0-7.  
00  
1
0
ADD Hd, Rs  
ADD Hd, Hd, Rs  
Add a register in the range 0-7 to a register in  
the range 8-15.  
00  
01  
1
0
1
1
ADD Hd, Hs  
CMP Rd, Hs  
ADD Hd, Hd, Hs  
CMP Rd, Hs  
Add two registers in the range 8-15.  
Compare a register in the range 0-7 with a  
register in the range 8-15. Set the condition  
code flags on the result.  
01  
1
0
CMP Hd, Rs  
CMP Hd, Rs  
Compare a register in the range 8-15 with a  
register in the range 0-7. Set the condition  
code flags on the result.  
01  
10  
10  
00  
00  
00  
1
0
1
0
1
1
1
1
0
1
0
1
CMP Hd, Hs  
MOV Rd, Hs  
MOV Hd, Rs  
MOV Hd, Hs  
BX Rs  
CMP Hd, Hs  
MOV Rd, Hs  
MOV Hd, Rs  
MOV Hd, Hs  
BX Rs  
Compare two registers in the range 8-15. Set  
the condition code flags on the result.  
Move a value from a register in the range 8-15  
to a register in the range 0-7.  
Move a value from a register in the range 0-7  
to a register in the range 8-15.  
Move a value between two registers in the  
range 8-15.  
Perform branch (plus optional state change) to  
address in a register in the range 0-7.  
BX Hs  
BX Hs  
Perform branch (plus optional state change) to  
address in a register in the range 8-15.  
INSTRUCTION CYCLE TIMES  
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  
BX performs a branch to a routine whose start address is specified in a Lo or Hi register.  
Bit 0 of the address determines the processor state on entry to the routine:  
Bit 0 = 0  
Bit 0 = 1  
Causes the processor to enter ARM state.  
Causes the processor to enter THUMB state.  
NOTE  
The action of H1 = 1 for this instruction is undefined, and should not be used.  
3-74  
S3C4510B  
INSTRUCTION SET  
Examples  
Hi-Register Operations  
ADD  
R4, R12  
MOV  
PC, R5  
; PC := PC + R5 but don't set the condition codes.CMP  
; Set the condition codes on the result of R4 - R12.  
; Move R14 (LR) into R15 (PC)  
R15, R14  
; but don't set the condition codes,  
; eg. return from subroutine.  
Branch and Exchange  
; Switch from THUMB to ARM state.  
; Load address of outofTHUMB into R1.  
ADR  
MOV  
BX  
R1,outofTHUMB  
R11,R1  
R11  
; Transfer the contents of R11 into the PC.  
; Bit 0 of R11 determines whether  
; ARM or THUMB state is entered, ie. ARM state here.  
...  
ALIGN  
CODE32  
outofTHUMB  
; Now processing ARM instructions...  
USING R15 AS AN OPERAND  
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-75  
INSTRUCTION SET  
S3C4510B  
FORMAT 6: PC-RELATIVE LOAD  
11  
10  
8
7
15  
14  
13  
12  
0
Word 8  
0
0
0
0
0
Rd  
[7:0] Immediate Value  
[10:8] Destination Register  
Figure 3-35. Format 6  
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.  
Table 3-13. Summary of PC-Relative Load Instruction  
THUMB Assembler  
ARM Equivalent  
Action  
LDR Rd, [PC, #Imm]  
LDR Rd, [R15, #Imm]  
Add unsigned offset (255 words, 1020 bytes)  
in Imm to the current value of the PC. Load  
the word from the resulting address into Rd.  
NOTE: The value specified by #Imm is a full 10-bit address, but must always be word-aligned (ie with bits 1:0 set to 0),  
since the assembler places #Imm >> 2 in field Word 8. The value of the PC will be 4 bytes greater than  
the address of this instruction, but bit 1 of the PC is forced to 0 to ensure it is word aligned.  
INSTRUCTION CYCLE TIMES  
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  
LDR R3,[PC,#844]  
; Load into R3 the word found at the  
; address formed by adding 844 to PC.  
; bit[1] of PC is forced to zero.  
; Note that the THUMB opcode will contain  
; 211 as the Word8 value.  
3-76  
S3C4510B  
INSTRUCTION SET  
FORMAT 7: LOAD/STORE WITH REGISTER OFFSET  
11  
10  
9
8
3
2
15  
14  
13  
12  
6
5
0
Rb  
Rd  
0
1
0
1
L
B
0
Ro  
[2:0] Source/Destination Register  
[5:3] Base Register  
[8:6] Offset Register  
[10] Byte/Word Flag  
0 = Transfer word quantity  
1 = Transfer byte quantity  
[11] Load/Store Flag  
0 = Store to memory  
1 = Load from memory  
Figure 3-36. Format 7  
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.  
Table 3-14. Summary of Format 7 Instructions  
L
B
THUMB Assembler  
ARM Equivalent  
Action  
Pre-indexed word store:  
0
0
STR Rd, [Rb, Ro]  
STR Rd, [Rb, Ro]  
Calculate the target address by adding together the  
value in Rb and the value in Ro. Store the contents of  
Rd at the address.  
0
1
1
1
0
1
STRB Rd, [Rb, Ro]  
LDR Rd, [Rb, Ro]  
LDRB Rd, [Rb, Ro]  
STRB Rd, [Rb, Ro] Pre-indexed byte store:  
Calculate the target address by adding together the  
value in Rb and the value in Ro. Store the byte value  
in Rd at the resulting address.  
LDR Rd, [Rb, Ro]  
Pre-indexed word load:  
Calculate the source address by adding together the  
value in Rb and the value in Ro. Load the contents of  
the address into Rd.  
LDRB Rd, [Rb, Ro] Pre-indexed byte load:  
Calculate the source address by adding together the  
value in Rb and the value in Ro. Load the byte value  
at the resulting address.  
3-77  
INSTRUCTION SET  
S3C4510B  
INSTRUCTION CYCLE TIMES  
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  
STR  
R3, [R2,R6]  
R2, [R0,R7]  
; Store word in R3 at the address  
; formed by adding R6 to R2.  
; Load into R2 the byte found at  
; the address formed by adding R7 to R0.  
LDRB  
3-78  
S3C4510B  
INSTRUCTION SET  
FORMAT 8: LOAD/STORE SIGN-EXTENDED BYTE/HALF-WORD  
11  
10  
9
8
3
2
15  
14  
13  
12  
6
5
0
Rb  
Rd  
0
1
0
1
H
S
1
Ro  
[2:0] Destination Register  
[5:3] Base Register  
[8:6] Offset Register  
[10] Sign-Extended Flag  
0 = Operand not sing-extended  
1 = Operand sing-extended  
[11] H Flag  
Figure 3-37. Format 8  
OPERATION  
These instructions load optionally sign-extended bytes or half-words, and store half-words. The THUMB  
assembler syntax is shown below.  
Table 3-15. Summary of format 8 instructions  
L
B
THUMB Assembler  
ARM Equivalent  
Action  
0
0
STRH Rd, [Rb, Ro]  
STRH Rd, [Rb, Ro]  
Store half-word:  
Add Ro to base address in Rb. Store bits 0–15 of Rd at  
the resulting address.  
0
1
1
0
LDRH Rd, [Rb, Ro]  
LDSB Rd, [Rb, Ro]  
LDRH Rd, [Rb, Ro]  
Load half-word:  
Add Ro to base address in Rb. Load bits 0–15 of Rd from  
the resulting address, and set bits 16-31 of Rd to 0.  
LDRSB Rd, [Rb, Ro] Load sign-extended byte:  
Add Ro to base address in Rb. Load bits 0–7 of Rd from  
the resulting address, and set bits 8-31 of Rd to bit 7.  
LDRSH Rd, [Rb, Ro] Load sign-extended half-word:  
1
1
LDSH Rd, [Rb, Ro]  
Add Ro to base address in Rb. Load bits 0–15 of Rd from  
the resulting address, and set bits 16-31 of Rd to bit 15.  
3-79  
INSTRUCTION SET  
S3C4510B  
INSTRUCTION CYCLE TIMES  
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  
STRH  
LDSB  
LDSH  
R4, [R3, R0]  
R2, [R7, R1]  
R3, [R4, R2]  
; Store the lower 16 bits of R4 at the  
; address formed by adding R0 to R3.  
; Load into R2 the sign extended byte  
; found at the address formed by adding R1 to R7.  
; Load into R3 the sign extended half-word  
; found at the address formed by adding R2 to R4.  
3-80  
S3C4510B  
INSTRUCTION SET  
FORMAT 9: LOAD/STORE WITH IMMEDIATE OFFSET  
11  
10  
3
2
15  
14  
13  
12  
6
5
0
Rb  
Rd  
0
1
1
B
L
Offset5  
[2:0] Source/Destination Register  
[5:3] Base Register  
[10:6] Offset Register  
[11] Load/Store Flag  
0 = Store to memory  
1 = Load from memory  
[12] Byte/Word Flad  
0 = Transfer word quantity  
1 = Transfer byte quantity  
Figure 3-38. Format 9  
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  
Table 3-16. Summary of Format 9 Instructions  
L
B
THUMB Assembler  
ARM Equivalent  
Action  
0
0
STR Rd, [Rb, #Imm]  
STR Rd, [Rb, #Imm]  
Calculate the target address by adding together the  
value in Rb and Imm. Store the contents of Rd at  
the address.  
0
1
1
0
LDR Rd, [Rb, #Imm]  
LDR Rd, [Rb, #Imm]  
Calculate the source address by adding together the  
value in Rb and Imm. Load Rd from the address.  
STRB Rd, [Rb, #Imm] STRB Rd, [Rb, #Imm] Calculate the target address by adding together the  
value in Rb and Imm. Store the byte value in Rd at  
the address.  
1
1
LDRB Rd, [Rb, #Imm] LDRB Rd, [Rb, #Imm] Calculate source address by adding together the  
value in Rb and Imm. Load the byte value at the  
address into Rd.  
NOTE: For word accesses (B = 0), the value specified by #Imm is a full 7-bit address, but must be word-aligned  
(ie with bits 1:0 set to 0), since the assembler places #Imm >> 2 in the Offset5 field.  
3-81  
INSTRUCTION SET  
S3C4510B  
INSTRUCTION CYCLE TIMES  
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  
LDR  
R2, [R5,#116]  
R1, [R0,#13]  
; Load into R2 the word found at the  
; address formed by adding 116 to R5.  
; Note that the THUMB opcode will  
; contain 29 as the Offset5 value.  
; Store the lower 8 bits of R1 at the  
; address formed by adding 13 to R0.  
; Note that the THUMB opcode will  
; contain 13 as the Offset5 value.  
STRB  
3-82  
S3C4510B  
INSTRUCTION SET  
FORMAT 10: LOAD/STORE HALF-WORD  
11  
10  
3
2
15  
14  
13  
12  
6
5
0
Rb  
Rd  
0
1
0
0
L
Offset5  
[2:0] Source/Destination Register  
[5:3] Base Register  
[10:6] Immediate Value  
[11] Load/Store Flag  
0 = Store to memory  
1 = Load from memory  
Figure 3-39. Format 10  
OPERATION  
These instructions transfer half-word 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.  
Table 3-17. Half-word Data Transfer Instructions  
L
THUMB Assembler  
ARM Equivalent  
Action  
0
STRH Rd, [Rb, #Imm] STRH Rd, [Rb, #Imm] Add #Imm to base address in Rb and store bits 0–15 of  
Rd at the resulting address.  
1
LDRH Rd, [Rb, #Imm] LDRH Rd, [Rb, #Imm] Add #Imm to base address in Rb. Load bits 0–15 from the  
resulting address into Rd and set bits 16-31 to zero.  
NOTE: #Imm is a full 6-bit address but must be half-word-aligned (ie with bit 0 set to 0),  
since the assembler places #Imm >> 1 in the Offset5 field.  
INSTRUCTION CYCLE TIMES  
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  
LDRH  
R6, [R1, #56]  
R4, [R7, #4]  
; 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.  
; Load into R4 the half-word found at the address formed  
by  
; adding 4 to R7. Note that the THUMB opcode will  
; contain 2 as the Offset5 value.  
3-83  
INSTRUCTION SET  
S3C4510B  
FORMAT 11: SP-RELATIVE LOAD/STORE  
11  
10  
15  
14  
13  
12  
8
7
0
Word 8  
1
0
0
1
L
Rd  
[7:0] Immediate Value  
[10:8] Destination Register  
[11] Load/Store Bit  
0 = Store to memory  
1 = Load from memory  
Figure 3-40. Format 11  
OPERATION  
The instructions in this group perform an SP-relative load or store. The THUMB assembler syntax is shown in the  
following table.  
Table 3-18. SP-Relative Load/Store Instructions  
L
THUMB Assembler  
ARM Equivalent  
Action  
0
STR Rd, [SP, #Imm]  
STR Rd, [R13 #Imm] Add unsigned offset (255 words, 1020 bytes) in Imm to  
the current value of the SP (R7). Store the contents of  
Rd at the resulting address.  
1
LDR Rd, [SP, #Imm]  
LDR Rd, [R13 #Imm] Add unsigned offset (255 words, 1020 bytes) in Imm to  
the current value of the SP (R7). Load the word from the  
resulting address into Rd.  
NOTE: The offset supplied in #Imm is a full 10-bit address, but must always be word-aligned (ie bits 1:0 set to 0),  
since the assembler places #Imm >> 2 in the Word8 field.  
INSTRUCTION CYCLE TIMES  
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  
STR  
R4, [SP,#492]  
; Store the contents of R4 at the address  
; formed by adding 492 to SP (R13).  
; Note that the THUMB opcode will contain  
; 123 as the Word8 value.  
3-84  
S3C4510B  
INSTRUCTION SET  
FORMAT 12: LOAD ADDRES  
11  
10  
15  
14  
13  
12  
8
7
0
Word 8  
1
0
1
0
SP  
Rd  
[7:0] 8-bit Unsigned Constant  
[10:8] Destination Register  
[11] Source  
0 = PC  
1 = SP  
Figure 3-41. Format 12  
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.  
Table 3-19. Load Address  
SP THUMB Assembler  
ARM Equivalent  
Action  
0
ADD Rd, PC, #Imm  
ADD Rd, R15, #Imm  
Add #Imm to the current value of the program counter  
(PC) and load the result into Rd.  
1
ADD Rd, SP, #Imm  
ADD Rd, R13, #Imm  
Add #Imm to the current value of the stack pointer (SP)  
and load the result into Rd.  
NOTE: The value specified by #Imm is a full 10-bit value, but this must be word-aligned (ie with bits 1:0 set to 0)  
since the assembler places #Imm >> 2 in field Word 8.  
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.  
The CPSR condition codes are unaffected by these instructions.  
3-85  
INSTRUCTION SET  
S3C4510B  
INSTRUCTION CYCLE TIMES  
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  
ADD  
ADD  
R2, PC, #572  
R6, SP, #212  
; R2: = PC + 572, but don't set the  
; condition codes. bit[1] of PC is forced to zero.  
; Note that the THUMB opcode will  
; contain 143 as the Word8 value.  
; R6: = SP (R13) + 212, but don't  
; set the condition codes.  
; Note that the THUMB opcode will  
; contain 53 as the Word 8 value.  
3-86  
S3C4510B  
INSTRUCTION SET  
FORMAT 13: ADD OFFSET TO STACK POINTER  
11  
10  
9
15  
14  
13  
12  
8
7
6
0
SWord 7  
1
0
1
1
0
0
0
0
S
[6:0] 7-bit Immediate Value  
[7] Sign Flag  
0 = Offset is positive  
1 = Offset is negative  
Figure 3-42. Format 13  
OPERATION  
This instruction adds a 9-bit signed constant to the stack pointer. The following table shows the THUMB  
assembler syntax.  
Table 3-20. The ADD SP Instruction  
S
0
1
THUMB Assembler  
ADD SP, #Imm  
ARM Equivalent  
Action  
ADD R13, R13, #Imm Add #Imm to the stack pointer (SP).  
SUB R13, R13, #Imm Add #-Imm to the stack pointer (SP).  
ADD SP, #-Imm  
NOTE: The offset specified by #Imm can be up to -/+ 508, but must be word-aligned (ie with bits 1:0 set to 0)  
since the assembler converts #Imm to an 8-bit sign + magnitude number before placing it in field SWord7.  
The condition codes are not set by this instruction.  
INSTRUCTION CYCLE TIMES  
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  
ADD  
SP, #268  
SP, #-104  
; 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.  
; 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-87  
INSTRUCTION SET  
S3C4510B  
FORMAT 14: PUSH/POP REGISTERS  
11  
10  
9
15  
14  
13  
12  
8
7
0
Rlist  
1
0
1
1
L
1
0
R
[7:0] Register List  
[8] PC/LR Bit  
0 = Do not store LR/Load PC  
1 = Store LR/Load PC  
[11] Load/Store Bit  
0 = Store to memory  
1 = Load from memory  
Figure 3-43. Format 14  
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.  
Table 3-21. PUSH and POP Instructions  
L
0
0
B
0
1
THUMB  
Assembler  
ARM Equivalent  
Action  
PUSH { Rlist }  
STMDB R13!, { Rlist }  
Push the registers specified by Rlist onto the stack.  
Update the stack pointer.  
PUSH { Rlist, LR } STMDB R13!, { Rlist, R14} Push the Link Register and the registers specified  
by Rlist (if any) onto the stack. Update the stack  
pointer.  
1
1
0
1
POP { Rlist }  
LDMIA R13!, { Rlist }  
Pop values off the stack into the registers specified  
by Rlist. Update the stack pointer.  
POP { Rlist, PC }  
LDMIA R13!, {Rlist, R15} Pop values off the stack and load into the registers  
specified by Rlist. Pop the PC off the stack.  
Update the stack pointer.  
3-88  
S3C4510B  
INSTRUCTION SET  
INSTRUCTION CYCLE TIMES  
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  
PUSH  
POP  
{R0–R4,LR}  
{R2, R6, PC}  
; Store R0, R1, R2, R3, R4 and R14 (LR) at  
; the stack pointed to by R13 (SP) and update R13.  
; Useful at start of a sub-routine to  
; save workspace and return address.  
; Load R2, R6 and R15 (PC) from the stack  
; pointed to by R13 (SP) and update R13.  
; Useful to restore workspace and return from sub-routine.  
3-89  
INSTRUCTION SET  
S3C4510B  
FORMAT 15: MULTIPLE LOAD/STORE  
11  
10  
15  
14  
13  
12  
8
7
0
Rlist  
1
1
0
0
L
Rb  
[7:0] Register List  
[10:8] Base Register  
[11] Load/Store Bit  
0 = Store to memory  
1 = Load from memory  
Figure 3-44. Format 15  
OPERATION  
These instructions allow multiple loading and storing of Lo registers. The THUMB assembler syntax is shown in  
the following table.  
Table 3-22. The Multiple Load/Store Instructions  
L
THUMB Assembler  
ARM Equivalent  
Action  
0
STMIA Rb!, { Rlist }  
STMIA Rb!, { Rlist }  
Store the registers specified by Rlist, starting at the base  
address in Rb. Write back the new base address.  
1
LDMIA Rb!, { Rlist }  
LDMIA Rb!, { Rlist }  
Load the registers specified by Rlist, starting at the base  
address in Rb. Write back the new base address.  
INSTRUCTION CYCLE TIMES  
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  
STMIA  
R0!, {R3-R7}  
; Store the contents of registers R3-R7  
; starting at the address specified in  
; R0, incrementing the addresses for each word.  
; Write back the updated value of R0.  
3-90  
S3C4510B  
INSTRUCTION SET  
FORMAT 16: CONDITIONAL BRANCH  
11  
15  
14  
13  
12  
8
7
0
SOffset 8  
1
1
0
1
Cond  
[7:0] 8-bit Signed Immediate  
[11:8] Condition  
Figure 3-45. Format 16  
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.  
The THUMB assembler syntax is shown in the following table.  
Table 3-23. The Conditional Branch Instructions  
Code  
THUMB  
ARM Equivalent  
Action  
Assembler  
0000  
0001  
0010  
0011  
0100  
0101  
0110  
0111  
1000  
1001  
1010  
BEQ label  
BNE label  
BCS label  
BCC label  
BMI label  
BPL label  
BVS label  
BVC label  
BHI label  
BLS label  
BGE label  
BEQ label  
BNE label  
BCS label  
BCC label  
BMI label  
BPL label  
BVS label  
BVC label  
BHI label  
BLS label  
BGE label  
Branch if Z set (equal)  
Branch if Z clear (not equal)  
Branch if C set (unsigned higher or same)  
Branch if C clear (unsigned lower)  
Branch if N set (negative)  
Branch if N clear (positive or zero)  
Branch if V set (overflow)  
Branch if V clear (no overflow)  
Branch if C set and Z clear (unsigned higher)  
Branch if C clear or Z set (unsigned lower or same)  
Branch if N set and V set, or N clear and V clear  
(greater or equal)  
3-91  
INSTRUCTION SET  
S3C4510B  
Table 3-23. The Conditional Branch Instructions (Continued)  
Code  
THUMB  
ARM Equivalent  
Action  
Assembler  
BLT label  
BGT label  
1011  
1100  
BLT label  
BGT label  
Branch if N set and V clear, or N clear and V set (less than)  
Branch if Z clear, and either N set and V set or N clear and V  
clear (greater than)  
1101  
BLE label  
BLE label  
Branch if Z set, or N set and V clear, or N clear and V set  
(less than or equal)  
NOTES:  
1. While label specifies a full 9-bit two’s complement address, this must always be half-word-aligned (ie with bit 0 set to 0)  
since the assembler actually places label >> 1 in field SOffset8.  
2. Cond = 1110 is undefined, and should not be used.  
Cond = 1111 creates the SWI instruction: see .  
INSTRUCTION CYCLE TIMES  
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  
CMP R0, #45  
; Branch to over-if R0 > 45.  
BGT over  
; Note that the THUMB opcode will contain  
; the number of half-words to offset.  
...  
...  
...  
...  
over  
; Must be half-word aligned.  
3-92  
S3C4510B  
INSTRUCTION SET  
FORMAT 17: SOFTWARE INTERRUPT  
11  
10  
9
15  
14  
13  
12  
8
7
0
Value 8  
1
1
0
1
1
1
1
1
[7:0] Comment Field  
Figure 3-46. Format 17  
OPERATION  
The SWI instruction performs a software interrupt. On taking the SWI, the processor switches into ARM state and  
enters Supervisor (SVC) mode.  
The THUMB assembler syntax for this instruction is shown below.  
Table 3-24. The SWI Instruction  
THUMB Assembler  
ARM Equivalent  
Action  
SWI Value 8  
SWI Value 8  
Perform Software Interrupt:  
Move the address of the next instruction into LR, move CPSR  
to SPSR, load the SWI vector address (0x8) into the PC.  
Switch to ARM state and enter SVC mode.  
NOTE: Value 8 is used solely by the SWI handler; it is ignored by the processor.  
INSTRUCTION CYCLE TIMES  
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  
SWI 18  
; Take the software interrupt exception.  
; Enter Supervisor mode with 18 as the  
; requested SWI number.  
3-93  
INSTRUCTION SET  
S3C4510B  
FORMAT 18: UNCONDITIONAL BRANCH  
11  
10  
15  
14  
13  
12  
0
Offset11  
1
1
1
0
0
[10:0] Immediate Value  
Figure 3-47. Format 18  
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.  
Table 3-25. Summary of Branch Instruction  
THUMB Assembler  
ARM Equivalent  
Action  
B label  
BAL label (half-word offset) Branch PC relative +/- Offset11 << 1, where label is PC  
+/- 2048 bytes.  
NOTE: The address specified by label is a full 12-bit two¢s complement address,  
but must always be half-word aligned (ie bit 0 set to 0), since the assembler places label >> 1 in the Offset11 field.  
Examples  
here  
B here  
; Branch onto itself. Assembles to 0xE7FE.  
; (Note effect of PC offset).  
B jimmy  
...  
; Branch to 'jimmy'.  
; Note that the THUMB opcode will contain the number of  
; half-words to offset.  
Jimmy  
...  
; Must be half-word aligned.  
3-94  
S3C4510B  
INSTRUCTION SET  
FORMAT 19: LONG BRANCH WITH LINK  
11  
10  
15  
14  
13  
12  
0
Offset  
1
1
1
1
H
[10:0] Long Branch and Link Offset High/Low  
[11] Low/High Offset Bit  
0 = Offset high  
1 = Offset low  
Figure 3-48. Format 19  
OPERATION  
This format specifies a long branch with link.  
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-95  
INSTRUCTION SET  
S3C4510B  
INSTRUCTION CYCLE TIMES  
This instruction format does not have an equivalent ARM instruction.  
Table 3-26. The BL Instruction  
H
0
1
THUMB Assembler  
ARM Equivalent  
Action  
LR := PC + OffsetHigh << 12  
BL label  
none  
temp := next instruction address  
PC := LR + OffsetLow << 1  
LR := temp | 1  
Examples  
BL faraway  
...  
; Unconditionally Branch to 'faraway'  
; and place following instruction  
next  
; address, ie “next”, in R14,the Link  
; register and set bit 0 of LR high.  
; Note that the THUMB opcodes will  
; contain the number of half-words to offset.  
; Must be Half-word aligned.  
faraway  
...  
3-96  
S3C4510B  
INSTRUCTION SET  
INSTRUCTION SET EXAMPLES  
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.  
MULTIPLICATION BY A CONSTANT USING SHIFTS AND ADDS  
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  
1. Multiplication by 2^n (1,2,4,8,...)  
LSL  
Ra, Rb, LSL #n  
; MOV Ra, Rb, LSL #n  
; ADD Ra, Rb, Rb, LSL #n  
2. Multiplication by 2^n+1 (3,5,9,17,...)  
LSL  
ADD  
Rt, Rb, #n  
Ra, Rt, Rb  
3. Multiplication by 2^n-1 (3,7,15,...)  
LSL  
SUB  
Rt, Rb, #n  
Ra, Rt, Rb  
; RSB Ra, Rb, Rb, LSL #n  
4. Multiplication by -2^n (-2, -4, -8, ...)  
LSL  
MVN  
Ra, Rb, #n  
Ra, Ra  
; MOV Ra, Rb, LSL #n  
; RSB Ra, Ra, #0  
5. Multiplication by -2^n-1 (-3, -7, -15, ...)  
LSL  
SUB  
Rt, Rb, #n  
Ra, Rb, Rt  
; SUB Ra, Rb, Rb, LSL #n  
Multiplication by any C = {2^n+1, 2^n-1, -2^n or -2^n-1} * 2^n  
Effectively this is any of the multiplications in 2 to 5 followed by a final shift. This allows the following additional  
constants to be multiplied. 6, 10, 12, 14, 18, 20, 24, 28, 30, 34, 36, 40, 48, 56, 60, 62 .....  
(2..5)  
LSL  
; (2..5)  
; MOV Ra, Ra, LSL #n  
Ra, Ra, #n  
3-97  
INSTRUCTION SET  
S3C4510B  
GENERAL PURPOSE SIGNED DIVIDE  
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  
;Get abs value of R0 into R3  
ASR  
EOR  
SUB  
R2, R0, #31  
R0, R2  
R3, R0, R2  
; Get 0 or -1 in R2 depending on sign of R0  
; EOR with -1 (0xFFFFFFFF) if negative  
; and ADD 1 (SUB -1) to get abs value  
;SUB always sets flag so go & report division by 0 if necessary  
BEQ divide_by_zero  
;Get abs value of R1 by xoring with 0xFFFFFFFF and adding 1 if negative  
ASR  
EOR  
SUB  
R0, R1, #31  
R1, R0  
R1, R0  
; Get 0 or -1 in R3 depending on sign of R1  
; EOR with -1 (0xFFFFFFFF) if negative  
; and ADD 1 (SUB -1) to get abs value  
;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  
MOV  
B
R0, R1, #1  
R2, R3  
%FT0  
just_l  
0
LSL  
CMP  
BLS  
MOV  
B
R2, #1  
R2, R0  
just_l  
R0, #0  
%FT0  
; Set accumulator to 0  
; Branch into division loop  
div_l  
0
LSR  
CMP  
BCC  
SUB  
ADC  
CMP  
BNE  
R2, #1  
R1, R2  
%FT0  
R1, R2  
R0, R0  
R2, R3  
div_l  
; Test subtract  
; If successful do a real subtract  
0
; Shift result and add 1 if subtract succeeded  
; Terminate when R2 == R3 (ie we have just  
; tested subtracting the 'ones' value).  
;Now fix up the signs of the quotient (R0) and remainder (R1)  
POP  
EOR  
EOR  
SUB  
EOR  
SUB  
MOV  
{R2, R3}  
R3, R2  
R0, R3  
R0, R3  
R1, R2  
R1, R2  
pc, lr  
; Get dividend/divisor signs back  
; Result sign  
; Negate if result sign = -1  
; Negate remainder if dividend sign = -1  
3-98  
S3C4510B  
INSTRUCTION SET  
ARM Code  
signed_divide  
; Effectively zero a4 as top bit will be shifted out later  
ANDS  
RSBMI  
EORS  
a4, a1, #&80000000  
a1, a1, #0  
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  
BEQ  
a3, a1  
divide_by_zero  
just_l  
div_l  
; Justification stage shifts 1 bit at a time  
; NB: LSL #1 is always OK if LS succeeds  
CMP  
MOVLS  
BLO  
a3, a2, LSR #1  
a3, a3, LSL #1  
s_loop  
CMP  
a2, a3  
ADC  
SUBCS  
TEQ  
a4, a4, a4  
a2, a2, a3  
a3, a1  
MOVNE  
BNE  
a3, a3, LSR #1  
s_loop2  
MOV  
a1, a4  
MOVS  
RSBCS  
RSBMI  
MOV  
ip, ip, ASL #1  
a1, a1, #0  
a2, a2, #0  
pc, lr  
3-99  
INSTRUCTION SET  
S3C4510B  
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  
LSR  
SUB  
LSR  
ADD  
LSR  
ADD  
LSR  
ADD  
LSR  
ASL  
ADD  
ASL  
SUB  
CMP  
BLT  
a2, a1  
a3, a1, #2  
a1, a3  
a3, a1, #4  
a1, a3  
a3, a1, #8  
a1, a3  
a3, a1, #16  
a1, a3  
a1, #3  
a3, a1, #2  
a3, a1  
a3, #1  
a2, a3  
a2, #10  
%FT0  
ADD  
SUB  
a1, #1  
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  
ADD  
ADD  
ADD  
MOV  
ADD  
SUBS  
ADDPL  
ADDMI  
MOV  
a1, a1, a1, lsr #2  
a1, a1, a1, lsr #4  
a1, a1, a1, lsr #8  
a1, a1, a1, lsr #16  
a1, a1, lsr #3  
a3, a1, a1, asl #2  
a2, a2, a3, asl #1  
a1, a1, #1  
a2, a2, #10  
pc, lr  
3-100  
S3C4510B  
SYSTEM MANAGER  
4
SYSTEM MANAGER  
OVERVIEW  
The S3C4510B microcontroller's System Manager has the following functions.  
·
·
To arbitrate system bus access requests from several master blocks, based on fixed priorities.  
To provide the required memory control signals for external memory accesses. For example, if a master  
block such as the DMA controller or the CPU generates an address which corresponds to a DRAM bank, the  
System Manager's DRAM controller generates the required normal/EDO or SDRAM access signals. The  
interface signals for normal/EDO or SDRAM can be switched by SYSCFG[31].  
·
·
·
To provide the required signals for bus traffic between the S3C4510B and ROM/SRAM and the external I/O  
banks.  
To compensate for differences in bus width for data flowing between the external memory bus and the  
internal data bus.  
S3C4510B supports both little and big endian for external memory or I/O devices.  
NOTE  
By generating an external bus request, an external device can access the S3C4510B's external memory  
interface pins. In addition, the S3C4510B can access slow external devices using a Wait signal. The Wait  
signal, which is generated by the external device, extends the duration of the CPU's memory access  
cycle beyond its programmable value.  
4-1  
SYSTEM MANAGER  
S3C4510B  
SYSTEM MANAGER REGISTERS  
To control external memory operations, the System Manager uses a dedicated set of special registers (see Table  
4-1). By programming the values in the System Manager special registers, you can specify such things as  
·
·
·
·
·
Memory type  
External bus width access cycle  
Control signal timing (RAS and CAS, for example)  
Memory bank locations  
The sizes of memory banks to be used for arbitrary address spacing  
The System Manager uses special register settings to control the generation and processing of the control  
signals, addresses, and data that are required by external devices in a standard system configuration. Special  
registers are also used to control access to ROM/SRAM/Flash banks, up to four DRAM banks and four external  
I/O banks, and a special register mapping area.  
The address resolution for each memory bank base pointer is 64K-bytes (16 bits). The base address pointer is 10  
bits. This gives a total addressable memory bank space of 16 M words.  
NOTE  
When writing a value to a memory bank control register from ROMCON0 to REFEXTCON (locations  
0x3014 to 0x303C), as shown in Table 4-1, you must always set the register using a single STM (Store  
Multiple) instruction. Additionally, the address spaces for successive memory banks must not overlap in  
the system memory map.  
4-2  
S3C4510B  
SYSTEM MANAGER  
0x3FFFFFF  
Reserved  
Special Register Bank  
Internal SRAM  
16K words (fixed)  
0, 4 or 8K bytes (fixed)  
External I/O Bank 3  
External I/O Bank 2  
Continuous 16K word space  
for 4 external I/O banks  
External I/O Bank 1  
4K words  
(Fixed for all I/O banks)  
External I/O Bank 0  
DRAM/SDRAM Bank 3  
DRAM/SDRAM Bank 2  
DRAM/SDRAM Bank 1  
DRAM/SDRAM Bank 0  
ROM/SRAM/Flash Bank 5  
ROM/SRAM/Flash Bank 4  
ROM/SRAM/Flash Bank 3  
ROM/SRAM/Flash Bank 2  
ROM/SRAM/Flash Bank 1  
ROM/SRAM/Flash Bank 0  
16M words  
(16 M X 32 bits)  
SA [25:0]  
16K words-4M words (32 bits)  
ADDR [21:0]  
0x0000000  
NOTE:  
You can define banks anywhere within the 64-Mbyte address space.  
Figure 4-1. S3C4510B System Memory Map  
4-3  
SYSTEM MANAGER  
S3C4510B  
SYSTEM MEMORY MAP  
Following are several important features to note about the S3C4510B system memory map:  
·
·
·
The size and location of each memory bank is determined by the register settings for "current bank base  
pointer" and "current bank end pointer". You can use this base/next bank pointer concept to set up a  
consecutive memory map. To do this, you set the base pointer of the "next bank" to the same address as the  
next pointer of the "current bank". Please note that when setting the bank control registers, the address  
boundaries of consecutive banks must not overlap. This can be applied even if one or more banks are  
disabled.  
Four external I/O banks are defined in a continuous address space. A programmer can only set the base  
pointer for external I/O bank 0. The start address of external I/O bank 1 is then calculated as the external I/O  
bank 0 start address +16 K. Similarly, the start address for external I/O bank 2 is the external I/O bank 0 start  
address + 32 K, and the start address for external I/O bank 3 is the external I/O bank 0 start address + 48 K.  
Therefore, the total consecutive addressable space of the four external banks is defined as the start address  
of external I/O bank 0 + 64 K bytes.  
Within the addressable space, the start address of each I/O bank is not fixed. You can use bank control  
registers to assign a specific bank start address by setting the bank's base pointer. The address resolution is  
64 K bytes. The bank's start address is defined as "base pointer << 16" and the bank's end address (except  
for external I/O banks) is "next pointer << 16 - 1".  
After a power-on or system reset, all bank address pointer registers are initialized to their default values. In this  
case, all bank pointers except for the next pointer of ROM bank 0 are set to zero. This means that, except for  
ROM bank 0, all banks are undefined following a system start-up.  
The reset values for the next pointer and base pointer of ROM bank 0 are 0x200 and 0x000, respectively. This  
means that a system reset automatically defines ROM bank 0 as a 32-Mbyte space with a start address of zero.  
This initial definition of ROM bank 0 lets the system power-on or reset operation pass control to the user-supplied  
boot code that is stored in external ROM. (This code is located at address 0 in the system memory map.) When  
the boot code (i.e. ROM program) executes, it performs various system initialization tasks and reconfigures the  
system memory map according to the application's actual external memory and device configuration.  
The initial system memory map following system start-up is shown in Figure 4-2.  
4-4  
S3C4510B  
SYSTEM MANAGER  
0X3FFFFFF  
0X3FF8000  
Special Function Registers  
Undefined Area  
64 M Bytes  
SA[25:0]  
0X2000000  
ROM/SRAM/FLASH Bank 0 Area  
(Non-Accessible)  
32 M  
ROM/SRAM/FLASH Bank 0 Area  
(Accessible)  
4 M Address[21:0]  
0X0000000  
Figure 4-2. Initial System Memory Map (After Reset)  
Table 4-1. System Manager Registers  
Registers  
Offset  
0x0000  
0x3000  
0x3008  
0x300C  
0x3010  
0x3014  
0x3018  
0x301C  
0x3020  
0x3024  
0x3028  
0x302C  
0x3030  
0x3034  
0x3038  
0x303C  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
Description  
System configuration register  
Clock control register  
Reset Value  
0x37FFFF91  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
SYSCFG  
CLKCON  
EXTACON0  
EXTACON1  
EXTDBWTH  
ROMCON0  
ROMCON1  
ROMCON2  
ROMCON3  
ROMCON4  
ROMCON5  
DRAMCON0  
DRAMCON1  
DRAMCON2  
DRAMCON3  
External I/O timing register 1  
External I/O timing register 2  
Data bus width of each bank  
ROM/SRAM/Flash bank 0 control register  
ROM/SRAM/Flash bank 1 control register  
ROM/SRAM/Flash bank 2 control register  
ROM/SRAM/Flash bank 3 control register  
ROM/SRAM/Flash bank 4 control register  
ROM/SRAM/Flash bank 5 control register  
DRAM bank 0 control register  
0x20000060  
0x00000060  
0x00000060  
0x00000060  
0x00000060  
0x00000060  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x000083FD  
DRAM bank 1 control register  
DRAM bank 2 control register  
DRAM bank 3 control register  
REFEXTCON  
Refresh and external I/O control register  
4-5  
SYSTEM MANAGER  
S3C4510B  
EXTERNAL ADDRESS TRANSLATION METHOD DEPENDS ON THE WIDTH OF EXTERNAL MEMORY  
The S3C4510B address bus is, in some respects, different than the bus used in other standard CPUs. Based on  
the required data bus width of each memory bank, the internal system address bus is shifted out to an external  
address bus, ADDR[21:0]. This means that memory control signals such as nRAS[3:0], nCAS[3:0], nECS[3:0],  
nRCS[5:0], and nWBE[3:0] are generated by the system manager according to a pre-configured external memory  
scheme (see Table 4-2). This is applied to SDRAM signals as same method.  
Table 4-2. Address Bus Generation Guidelines  
Data Bus Width  
8-bit  
External Address Pins, ADDR[21:0]  
A21–A0 (internal)  
Accessible Memory Size  
4M bytes  
16-bit  
A22–A1 (internal)  
4M half-words  
4M words  
32-bit  
A23–A2 (internal)  
Data Bus Width Configuration  
(8-bit/16-bit/32-bit)  
SA [21:0]  
22-bit  
8-bit  
External Address Pins  
ADDR [21:0]  
SA [22:1]  
22-bit  
16-bit  
32-bit  
22-bit  
SA [23:2]  
22-bit  
System Address Bus: SA [25:0]  
Figure 4-3. External Address Bus Diagram  
4-6  
S3C4510B  
SYSTEM MANAGER  
CONNECTION OF EXTERNAL MEMORY WITH VARIOUS DATA WIDTH  
As another example, let us see how the S3C4510B maps CPU address spaces to physical addresses in external  
memory:  
When the CPU issues an arbitrary address to access an external memory device, the S3C4510B compares the  
upper 10 bits of the issued address with the address pointers of all memory banks. It does this by consecutively  
subtracting each address pointer value from the CPU address. There are two reasons why this subtraction  
method is used:  
·
To check the polarities of the subtraction result so as to identify which bank corresponds to the address  
issued by the CPU.  
·
To derive the offset address for the corresponding bank.  
When the bank is identified and the offset has been derived, the corresponding bank selection signal (nRCS[5:0],  
or nECS[3:0]) is generated, and the derived offset is driven to address external memory through the S3C4510B  
physical address bus.  
The S3C4510B can be configured as big-endian or little-endian mode by external little/big selection pin(LITTLE,  
49).  
In Big Endian mode, the most significant byte of the external memory data is stored at the lowest numbered byte  
and the least significant byte at the highest numbered byte.  
Eg.) In case of the external word memory system, Byte 0 of the memory is connected to data lines 31 through  
24, D[31:24].  
In Little Endian mode, vice versa.(See Figure 4-4 External Memory Interface)  
4-7  
SYSTEM MANAGER  
ENDIAN MODES  
S3C4510B  
S3C4510B supports both little-endian and big-endian for external memory or I/O devices by setting the pin  
LITTLE (pin 49).The system diagram for S3C4510B is shown in Figure 4-4.  
S3C4510B  
External Memory  
CPU  
(ARM7TMDI)  
Memory  
31  
0
Bit Number  
Controller  
CPU Addr.  
SA (Addr.)  
SD (Data)  
ADDR  
...X0  
...X4  
CPU Data Bus  
XDATA  
Word Address  
...X8  
...XC  
31  
0
31  
0
CPU Register  
Special Register  
Figure 4-4. Data Bus Connection with External Memory  
Below tables (4-4 through 4-14) are show the program/data path between the CPU register and the external  
memory using little-/big-endian and word/half-word/byte access.  
4-8  
S3C4510B  
SYSTEM MANAGER  
Table 4-3 and Table 4-4  
Using big-endian and word access, Program/Data path between register and external memory  
WA=Address whose LSB is 0, 4, 8, C  
X=Don't care  
CAS3-0/nWBE3-0=0 means active and 1 means inactive  
Table 4-3. Word Access Store Operation with Big-Endian  
STORE (CPU Reg ® External Memory)  
Ext. Memory Type  
Word  
Half Word  
Byte  
Bit Num.  
31  
0
31  
0
31 0  
CPU Register Data  
abcd  
WA  
abcd  
WA  
abcd  
WA  
CPU Address  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
abcd  
abcd  
abcd  
abcd  
abcd  
abcd  
abcd  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
abcd  
WA  
abcd  
WA  
abcd  
abcd  
WA  
abcd  
WA + 1  
XXX0  
abcd  
abcd  
WA + 3  
XXX0  
External Address  
CAS3-0/nWBE3-0  
WA + 2  
XX00  
WA + 2  
XXX0  
0000  
XX00  
XXX0  
Bit Num.  
XDATA  
31  
0
15  
0
15  
0
7
0
7
0
7
0
7
0
abcd  
ab  
cd  
a
a
b
b
c
c
d
d
Bit Num.  
Ext. Memory Data  
31  
0
15  
0
15  
0
7
0
7
0
7
0
7
0
abcd  
ab  
cd  
Timing Sequence  
1st write 2nd write 1st write 2nd write 3rd write 4th write  
Table 4-4 Word Access Load Operation with Big-Endian  
LOAD (CPU Reg ¬ External Memory)  
Ext. Memory Type  
Word  
Half Word  
Byte  
Bit Num.  
31  
0
31  
0
31 0  
CPU Register Data  
abcd  
WA  
abcd  
WA  
abcd  
WA  
CPU Address  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
abcd  
abXX  
abcd  
aXXX  
abXX  
abcX  
abcd  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
abcd  
WA  
abXX  
WA  
abcd  
aXXX  
WA  
abXX  
WA + 1  
XXX0  
abcX  
abcd  
WA + 3  
XXX0  
External Address  
CAS3-0/nWBE3-0  
WA + 2  
XX00  
WA + 2  
XXX0  
0000  
XX00  
XXX0  
Bit Num.  
XDATA  
31  
0
15  
0
15  
0
7
0
7
0
7
0
7
0
abcd  
ab  
cd  
a
a
b
b
c
c
d
d
Bit Num.  
Ext. Memory Data  
31  
0
15  
0
15  
0
7
0
7
0
7
0
7
0
abcd  
ab  
cd  
Timing Sequence  
1st read 2nd read 1st read 2nd read 3rd read  
4th read  
4-9  
SYSTEM MANAGER  
S3C4510B  
Table 4-5 and 4-6  
Using big-endian and half-word access, Program/Data path between register and external memory.  
HA=Address whose LSB is 0, 2, 4, 6, 8, A, C, E  
HAU=Address whose LBS is 2, 6, A, E  
HAL=Address whose LSB is 0, 4, 8, C  
X=Don't care  
CAS3-0/nWBE3-0=0 means active and 1 means inactive  
Table 4-5. Half-Word Access Store Operation with Big-Endian  
STORE (CPU Reg ® External Memory)  
Ext. Memory Type  
Bit Num.  
Word  
Half word  
Byte  
31  
0
31  
0
31 0  
CPU Register Data  
abcd  
abcd  
HA  
abcd  
HA  
CPU Address  
HAL  
HAU  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
cdcd  
cdcd  
cdcd  
cdcd  
cdcd  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
cdcd  
HAL  
0011  
cdcd  
HAL  
1100  
cdcd  
HA  
cdcd  
HA  
cdcd  
HA + 1  
XXX0  
External Address  
CAS3-0/nWBE3-0  
XX00  
XXX0  
Bit Num.  
XDATA  
31  
0
31  
0
15  
0
7
0
7
0
cdXX  
XXcd  
cd  
c
c
d
d
Bit Num.  
Ext. Memory Data  
31 16  
15  
0
15  
0
7
0
7
0
cd  
cd  
cd  
Timing Sequence  
1st write 2nd write  
Table 4-6. Half-Word Access Load Operation with Big-Endian  
LOAD (CPU Reg ¬ External Memory)  
Ext. Memory Type  
Bit Num.  
Word  
Half word  
Byte  
15  
0
15  
0
15 0  
CPU Register Data  
ab  
ab  
HA  
ab  
HA  
CPU Address  
HAL  
HAU  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
abab  
cdcd  
abab  
aXaX  
abab  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
abab  
HAL  
cdcd  
HAL  
abab  
HA  
aXaX  
HA  
abab  
HA + 1  
XXXX  
External Address  
CAS3-0/nWBE3-0  
XXXX  
XXXX  
XXXX  
XXXX  
Bit Num.  
XDATA  
31  
0
31  
0
15  
0
7
0
7
0
abcd  
abcd  
ab  
a
a
b
b
Bit Num.  
Ext. Memory Data  
31  
0
15  
0
7
0
7
0
abcd  
ab  
Timing Sequence  
1st read  
2nd read  
4-10  
S3C4510B  
SYSTEM MANAGER  
Table 4-7 and 4-8  
Using big-endian and byte access, Program/Data path between register and external memory  
BA=Address whose LSB is 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F  
BAL=Address whose LSB is 0,2,4,6,8,A,C,E  
BAU=Address whose LBS is 1,3,5,7,9,B,D,F  
BA0=Address whose LSB is 0,4,8,C  
BA1=Address whose LBS is 1,5,9,D  
BA2=Address whose LSB is 2,6,A,E  
BA3=Address whose LBS is 3,7,B,F  
X=Don't care  
CAS3-0/nWBE3-0=0 means active and 1 means inactive  
Table 4-7. Byte Access Store Operation with Big-Endian  
STORE (CPU Reg ® External Memory)  
Ext. Memory Type  
Bit Num.  
Word  
Half Word  
Byte  
31  
0
31  
0
31 0  
CPU Register Data  
abcd  
abcd  
abcd  
BA  
CPU Address  
BA0  
BA1  
BA2  
BA3  
BAL  
BAU  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
dddd  
dddd  
dddd  
dddd  
dddd  
dddd  
dddd  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
dddd  
BA0  
dddd  
BA0  
dddd  
BA0  
dddd  
BA0  
dddd  
BAL  
dddd  
BAL  
dddd  
BA  
External Address  
CAS3-0/nWBE3-0  
0111  
1011  
1101  
1110  
XX10  
XX01  
XXX0  
Bit Num.  
XDATA  
31  
0
31  
0
31  
0
31  
0
15  
0
15  
0
7
0
dXXX  
XdXX  
XXdX  
XXXd  
dX  
Xd  
d
d
Bit Num.  
Ext. Memory Data  
31 24  
23 16  
15  
8
7
0
15  
0
15  
0
7
0
d
d
d
d
d
d
Timing Sequence  
4-11  
SYSTEM MANAGER  
S3C4510B  
Table 4-8. Byte Access Load Operation with Big-Endian  
LOAD (CPU Reg ¬ External Memory)  
Ext. Memory Type  
Word  
Half Word  
Byte  
Bit Num.  
7
0
7
0
7 0  
CPU Register Data  
a
a
a
CPU Address  
BA0  
BA1  
BA2  
BA3  
BAL  
BAU  
BA  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
aaaa  
bbbb  
cccc  
dddd  
aaaa  
bbbb  
aaaa  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
aaaa  
BA0  
bbbb  
BA0  
cccc  
BA0  
dddd  
BA0  
aaaa  
BAL  
bbbb  
BAL  
aaaa  
BA  
External Address  
CAS3-0/nWBE3-0  
XXXX  
XXXX  
XXXX  
XXXX  
XXXX  
XXXX  
XXXX  
Bit Num.  
XDATA  
31  
0
31  
0
31  
0
31  
0
15  
0
15  
0
7
0
abcd  
abcd  
abcd  
abcd  
ab  
ab  
a
a
Bit Num.  
Ext. Memory Data  
31  
0
15  
0
7
0
abcd  
ab  
Timing Sequence  
4-12  
S3C4510B  
SYSTEM MANAGER  
Table 4-9 and 4-10  
Using little-endian and word access, Program/Data path between register and external memory  
WA=Address whose LSB is 0,4,8,C  
X=Don't care  
CAS3-0/nWBE3-0=0 means active and 1 means inactive  
Table 4-9. Word Access Store Operation with Little-Endian  
STORE (CPU Reg ® External Memory)  
Ext. Memory Type  
Bit Num.  
Word  
Half Word  
Byte  
31  
0
31  
0
31 0  
abcd  
abcd  
abcd  
CPU Register Data  
CPU Address  
Bit Num.  
WA  
WA  
WA  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
abcd  
abcd  
abcd  
abcd  
abcd  
abcd  
abcd  
CPU Data Bus  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
abcd  
abcd  
abcd  
abcd  
abcd  
abcd  
abcd  
Internal SD Bus  
External Address  
Bit Num.  
WA  
WA  
WA + 2  
WA  
WA + 1  
WA + 2  
31  
0
15 0  
15 0  
7
7
0
0
7
7
0
0
7
7
0
0
7
7
0
0
abcd  
cd  
ab  
d
c
c
b
b
a
XDATA  
Bit Num.  
31  
0
15 0  
15 0  
abcd  
cd  
ab  
d
a
Ext. Memory Data  
Timing Sequence  
1st write 2nd write 1st write 2nd write 3rd write 4th write  
Table 4-10. Word Access Load Operation with Little-Endian  
LOAD (CPU Reg ¬ External Memory)  
Ext. Memory Type  
Word  
Half Word  
Byte  
Bit Num.  
31  
0
31  
0
31 0  
CPU Register Data  
abcd  
WA  
abcd  
WA  
abcd  
WA  
CPU Address  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
abcd  
XXcd  
abcd  
XXXd  
XXcd  
Xbcd  
abcd  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
abcd  
WA  
XXcd  
WA  
abcd  
XXXd  
WA  
XXcd  
Xbcd  
WA + 2  
abcd  
External Address  
WA + 2  
WA + 1  
WA + 3  
Bit Num.  
XDATA  
31  
0
15 0  
15 0  
7
0
7
0
7
0
7
0
abcd  
cd  
ab  
d
d
c
c
b
b
a
a
Bit Num.  
Ext. Memory Data  
31  
0
15 0  
15 0  
7
0
7
0
7
0
7
0
abcd  
cd  
ab  
Timing Sequence  
1st read 2nd read 1st read 2nd read 3rd read  
4th read  
4-13  
SYSTEM MANAGER  
S3C4510B  
Table 4-11 and 4-12  
Using little-endian and half-word access, Program/Data path between register and external memory  
HA=Address whose LSB is 0, 2, 4, 6, 8, A, C, E  
HAU=Address whose LBS is 2, 6, A, E  
HAL=Address whose LSB is 0, 4, 8, C  
X=Don't care  
CAS3-0/nWBE3-0=0 means active and 1 means inactive  
Table 4-11. Half-Word Access Store Operation with Little-Endian  
STORE (CPU Reg ® External Memory)  
Ext. Memory Type  
Bit Num.  
Word  
Half word  
Byte  
31 d0  
31  
0
31 0  
CPU Register Data  
abcd  
abcd  
HA  
abc  
CPU Address  
HAL  
HAU  
HA  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
cdcd  
cdcd  
cdcd  
cdcd  
cdcd  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
cdcd  
HAL  
1100  
cdcd  
HAL  
0011  
cdcd  
HA  
cdcd  
HA  
cdcd  
HA+1  
XXX0  
External Address  
CAS3-0/nWBE3-0  
XX00  
XXX0  
Bit Num.  
XDATA  
31  
0
31  
0
15  
0
7
0
7
0
cdcd  
cdcd  
cd  
d
d
c
c
Bit Num.  
Ext. Memory Data  
15  
0
31 16  
15  
0
7
0
7
0
cd  
cd  
cd  
Timing Sequence  
1st write 2nd write  
Table 4-12. Half-Word Access Load Operation with Little-Endian  
LOAD (CPU Reg ¬ External Memory)  
Ext. Memory Type  
Bit Num.  
Word  
Half word  
Byte  
15  
0
15  
0
15 0  
CPU Register Data  
cd  
ab  
HA  
ba  
HA  
CPU Address  
HAL  
HAU  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
cdcd  
abab  
abab  
XaXa  
baba  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
cdcd  
HAL  
abab  
HAL  
abab  
HA  
XaXa  
HA  
baba  
HA+1  
XXXX  
External Address  
CAS3-0/nWBE3-0  
XXXX  
XXXX  
XXXX  
XXXX  
Bit Num.  
XDATA  
31  
0
31  
0
15  
0
7
0
7
0
abcd  
abcd  
ab  
a
a
b
b
Bit Num.  
Ext. Memory Data  
31  
0
15  
0
7
0
7
0
abcd  
ab  
Timing Sequence  
1st read  
2nd read  
4-14  
S3C4510B  
SYSTEM MANAGER  
Table 4-13 and 4-14  
Using little-endian and byte access, Program/Data path between register and external memory  
BA=Address whose LSB is 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F  
BAL=Address whose LSB is 0,2,4,6,8,A,C,E  
BAU=Address whose LBS is 1,3,5,7,9,B,D,F  
BA0=Address whose LSB is 0,4,8,C  
BA1=Address whose LBS is 1,5,9,D  
BA2=Address whose LSB is 2,6,A,E  
BA3=Address whose LBS is 3,7,B,F  
X=Don't care  
CAS3-0/nWBE3-0=0 means active and 1 means inactive  
Table 4-13. Byte Access Store Operation with Little-Endian  
STORE (CPU Reg ® External Memory)  
Ext. Memory Type  
Bit Num.  
Word  
Half Word  
Byte  
31  
0
31  
0
31 0  
CPU Register Data  
abcd  
abcd  
abcd  
BA  
CPU Address  
BA0  
BA1  
BA2  
BA3  
BAL  
BAU  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
dddd  
dddd  
dddd  
dddd  
dddd  
dddd  
dddd  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
dddd  
BA0  
dddd  
BA0  
dddd  
BA0  
dddd  
BA0  
dddd  
BAL  
dddd  
BAL  
dddd  
BA  
External Address  
CAS3-0/nWBE3-0  
1110  
1101  
1011  
0111  
XX10  
XX01  
XXX0  
Bit Num.  
XDATA  
31  
0
31  
0
31  
0
31  
0
15  
0
15  
0
7
0
XXXd  
XXdX  
XdXX  
dXXX  
Xd  
dX  
d
d
Bit Num.  
Ext. Memory Data  
7
0
15  
8
23 16  
31 24  
7
0
15  
8
7
0
d
d
d
d
d
d
Timing Sequence  
4-15  
SYSTEM MANAGER  
S3C4510B  
Table 4-14. Byte Access Load Operation with Little-Endian  
LOAD (CPU Reg ¬ External Memory)  
Ext. Memory Type  
Word  
Bit Num.  
7
0
7
0
7 0  
CPU Register Data  
d
c
a
CPU Address  
BA0  
BA1  
BA3  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
CPU Data Bus  
dddd  
cccc  
bbbb  
aaaa  
bbbb  
aaaa  
aaaa  
Bit Num.  
31  
0
31  
0
31  
0
31  
0
31  
0
31  
0
31 0  
Internal SD Bus  
dddd  
BA0  
cccc  
BA0  
bbbb  
BA0  
aaaa  
BA0  
bbbb  
BAL  
aaaa  
BAL  
aaaa  
BA  
External Address  
CAS3-0/nWBE3-0  
XXXX  
XXXX  
XXXX  
XXXX  
XXXX  
XXXX  
XXXX  
Bit Num.  
XDATA  
31  
0
31  
0
31  
0
31  
0
15  
0
15  
0
7
0
abcd  
abcd  
abcd  
abcd  
ab  
ab  
a
a
Bit Num.  
Ext. Memory Data  
31  
0
15 0  
7
0
abcd  
ab  
Timing Sequence  
4-16  
S3C4510B  
SYSTEM MANAGER  
BUS ARBITRATION  
In the S3C4510B microcontroller, the term "system bus" refers to the separate system address and data buses  
inside the chip. The S3C4510B's internal function blocks, or external devices, can request mastership of the  
system bus and then hold the system bus in order to perform data transfers. Because the design of S3C4510B  
bus allows only one bus master at a time, a bus controller is required to arbitrate when two or more internal units  
or external devices simultaneously request bus mastership.  
When bus mastership is granted to an internal function block or an external device, other pending requests are  
not acknowledged until the previous bus master has released the bus.  
To facilitate bus arbitration, priorities are assigned to each internal S3C4510B function block. The bus controller  
arbitrattion requests for the bus mastership according to these fixed priorities. In the event of contention,  
mastership is granted to the function block with the highest assigned priority. These priorities are listed in  
Table 4-15.  
NOTE  
An external bus master can also be granted bus mastership and hold the S3C4510B system bus. In  
Table 4-3, you will note that all external devices are assigned the identical priority. Therefore, in systems  
made up of several external devices which can become the bus master, external circuitry must be  
implemented to assign additional bus arbitration priorities to all potential external bus masters.  
Table 4-15. Bus Priorities for Arbitration  
Function Block  
Bus Priority (Group)  
External bus master  
A-1 (Highest priority in Group A)  
DRAM memory refresh controller  
General DMA 1 (GDMA 1)  
General DMA 0 (GDMA 0)  
High level data link controller B (HDLC B)  
High level data link controller A (HDLC A)  
MAC buffered DMA (BDMA)  
Writer buffer  
A-2  
A-3  
A-4  
A-5  
A-6  
A-7 (Lowest priority in Group A)  
B-1 (Highest priority in Group B)  
B-2 (Lowest priority in Group B)  
Bus router  
NOTE: Internal function blocks are divided into two groups, Group A and Group B. Within each group, the bus arbitration  
priorities are fixed according to the assigned level. The relative priority of Group A and Group B is determined more  
or less in an alternating manner.  
4-17  
SYSTEM MANAGER  
S3C4510B  
EXTERNAL BUS MASTERSHIP  
The S3C4510B can receive and acknowledge bus request signals (ExtMREQs) that are generated by an external  
bus master. When the CPU asserts an external bus acknowledge signal (ExtMACK), mastership is granted to the  
external bus master, assuming the external bus request is still active.  
When the external bus acknowledge signal is active, the S3C4510B's memory interface signals go to high-  
impedance state so that the external bus master can drive the required external memory interface signals.  
The S3C4510B does not perform DRAM refreshes when it is not the bus master. When an external bus master is  
in control of the external bus, and if it retains control for a long period of time, it must assume the responsibility of  
performing the necessary DRAM refresh operations.  
SCLK  
MCLKO  
tEMZ  
Address, Data, nOE,  
nWBE, nDWE, nRCS  
, nCAS, nRAS  
Data  
Data  
tEMRh  
tEMRs  
ExtMREQ  
ExtMACK  
tEMAr  
tEMAf  
Figure 4-5. External Bus Request Timing  
NOTE: When External Bus Master requests the ExtMREQ during the Sync DRAM writing cycles, the ExtMACK can be  
generated with the wrong writing control signals of Sync DRAM. Just floating the Sync DRAM control signals at the  
time ExtMACK , it can cause the feasible active writing on the Sync DRAM. As the result, the wrong data can be  
written into unexpected address on Sync DRAM. If this address is in the range of stack or code area, the crash will  
be happen sooner or later. The other memory interfaces doesn’t have this problem, which is asynchronous with  
MCLKO, that is why Sync DRAM write cycle only. You can avoid this by disabling the SDCS (Sync DRAM Chip  
Select HIGH) as soon as receiving the ExtMACK and driving the Address and Data after one or two MCLKO cycles.  
4-18  
S3C4510B  
SYSTEM MANAGER  
CONTROL REGISTERS  
SYSTEM CONFIGURATION REGISTER (SYSCFG)  
The System Manager has one system configuration register, SYSCFG. The SYSCFG register determines the  
start address of the System Manager's special registers and the start address of internal SRAM. (The total special  
register space in the system memory map is fixed at 64 K bytes.)  
You also use SYSCFG settings to control write buffer enable, cache enable, and stall enable operations.  
All DRAM banks can be configured to SDRAM banks by set the Synchronous DRAM mode (SYSCFG[31]).  
NOTE  
If you write a "10" into the cache mode field, SYSCFG[5:4], the cache enable bit is cleared automatically  
(see Figure 4-6).  
Table 4-16. SYSCFG Register  
Registers  
SYSCFG  
Offset Address  
R/W  
Description  
Reset Value  
0x0000  
R/W  
System configuration register  
0x37FFFF91  
4-19  
SYSTEM MANAGER  
S3C4510B  
31 30  
26 25  
16 15  
6
5
4
3
2
1
0
S
Special Register Bank  
Base Pointer  
Internal SRAM  
Base Pointer  
W C S  
E E E  
PD_ID  
D
CM  
0
M
[0] Stall enable (SE)  
Must be set to zero.  
[1] Cache enable (CE)  
When set to '1', cache operations are enabled.  
[2] Write buffer enable (WE)  
When set to "1", write buffer operations are enabled.  
[5:4] Cache mode (CM)  
This 2-bit value determines how internal memory is to be  
devided into cache and SRAM.  
00 = 4-Kbyte SRAM, 4Kbyte cache  
01 = 0-Kbyte SRAM, 8Kbyte cache  
10 = 8-Kbyte SRAM, 0Kbyte cache  
NOTE:  
When you write 10 to this field, the cache enable  
bit is cleared automatically.  
[15:6] Internal SRAM base pointer  
This 10-bit address becomes the upper address of SRAM.  
A25 through A16, the remaining SRAM address, and A15  
through A0, are filled with zeros.  
[25:16] Special register bank base pointer  
The resolution of this value is 64K. Therefore, to place  
the start address at 1800000H (24M), use this formula:  
Setting value = (1800000H/64K) << 16.  
[30:26] Product Identifier (PD_ID)  
00001 = S3C4510X (KS32C50100)  
11001 = S3C4510B  
[31] Sync. DRAM Mode  
0 = Normal/EDO DRAM interface for 4 DRAM banks  
1 = Sync. DRAM interface for 4 DRAM banks.  
Figure 4-6. System Configuration Register (SYSCFG)  
4-20  
S3C4510B  
SYSTEM MANAGER  
Start Address Setting  
The start address of the System Manager special register area is initialized to 3FFFF91H. (You can also set the  
start address to an arbitrary value by writing the address, 3FF0000H.) When you have set the start address of the  
special register area, the register addresses are automatically defined as the start address plus the register’s  
offset.  
Assume for example, that a reset initialize the start address to 3FF0000H. The offset address of the ROMCON  
register is 3014H. Therefore, the physical address for ROMCON is 3FF0000H + 3014h = 3FF3014H. If you then  
modified the start address of the special register area to 3000000H, the new address for the ROMCON register  
would be 3003014H.  
Cache Disable/Enable  
To enable or disable the cache, you set the cache enable (CE) bit of the SYSCFG register to "1" or "0",  
respectively Because cache memory does not have an auto-flush feature, you must be careful to verify the  
coherency of data whenever you re-enable the cache. You must also carefully check any changes that the DMA  
controller may make to data stored in memory.  
(Usually, the memory area that is allocated to DMA access operations must be non-cachable.)  
The internal 8-Kbyte SRAM can be used as a cache area. To configure this area, you use the cache mode bits,  
SYSCFG[5:4]. If you do not need to use the entire 8-Kbyte area as cache, you can use the remaining area as  
internal SRAM. This area is accessed using the address of the base pointer in the internal SRAM field.  
Write Buffer Disable/Enable  
The S3C4510B has four programmable write buffer registers that are used to improve the speed of memory write  
operations. When you enable a write buffer, the CPU writes data into the write buffer, instead of an external  
memory location. This saves the cycle that would normally be required to complete the external memory write  
operation. The four write buffers also enhance the performance of the ARM7TDMI core’s store operations.  
To maintain data coherency between the cache and external memory, the S3C4510B uses a write-through policy.  
An internal 4-level write buffer compensates for performance degradation caused by write-throughs.  
(For more information, read Chapter 5.)  
4-21  
SYSTEM MANAGER  
S3C4510B  
SYSTEM CLOCK AND MUX BUS CONTROL REGISTER  
CLOCK CONTROL REGISTER (CLKCON)  
There is a clock control register in the System Manager. This control register is used to divide the internal system  
clock, so the slower clock than the system clock can be made by clock dividing value. In this register, ROM bank  
5 address/data MUX. enable control function is included.  
Table 4-17. CLKCON Register  
Registers  
CLKCON  
Offset Address  
R/W  
Description  
Clock control register  
Reset Value  
0x3000  
R/W  
0x00000000  
Table 4-18. CLKCON Register Description  
Bit Number  
Bit Name  
Description  
[15:0]  
Clock dividing value  
S3C4510B System Clock source. If CLKSEL is Low, PLL output  
clock is used as the S3C4510B internal system clock. If CLKSEL  
is High, XCLK is used as the S3C4510B internal system clock.  
The internal system clock is divided by this value. The clock  
divided is used to drive the CPU and system peripherals. Only  
one bit can be set in CLKCON[15:0], that is, the clock deviding  
value is defined as 1, 2, 4, 8, 16,... If all bits are zero, a non-  
divided clock is used.  
[16]  
[17]  
ROM bank 5 wait enable Wait cycle will check the next cycle after a chip selection signal is  
activated.  
ROM bank 5  
address/data MUX.  
enable  
Using multiplex bus at ROM bank 5, this bit must be set to 1.  
[19:18]  
MUX Bus address cycle When address phase of multiplexed bus is not enough long for  
external device to receive, address phase can be extended by  
setting this bit.(You can see tAC in timing diagram.)  
00 = 1 MCLK  
01 = 2 MCLK  
10 = 3 MCLK  
[31]  
Test bit  
This bit is for factory use only. During the normal operation, it  
must always be 0.  
4-22  
S3C4510B  
SYSTEM MANAGER  
31  
20 19 18 17 16 15  
0
CLKCON  
Clock Divided Value  
[15:0] Clock diving value  
If all bits are 0, non-divided clock is used. Only one bit  
can be set in CLKCON[15:0]. That is, the clock diving  
value is defined as 1,2,4,8,16,...  
Internal system clock, fMCLK = fICLK/(CLKCON+1)  
[16] ROM bank 5 wait enable  
0 = Disable ROM bank 5 wait.  
1 = Enable ROM bank 5 wait.  
[17] ROM bank 5 address/data bus MUX enable  
0 = Normal operation  
1 = Enable bus multiplexing  
[19:18] MUX bus Address (tAC)  
00 = 1 MCLK  
01 = 2 MCLK  
10 = 3 MCLK  
[31] Test bit  
This bit should be always 0.  
Figure 4-7. Clock Control Register (CLKCON)  
4-23  
SYSTEM MANAGER  
SYSTEM CLOCK  
S3C4510B  
The external clock input, XCLK, can be used to the internal system clock by assign VDD to CLKSEL pin. Using  
PLL for the internal system clock, VSS has to be assigned to CLKSEL pin. In this case, the internal system clock  
is XCLK ´ MF. To get 50MHz of system clock, a 10 MHz external clock must be used.  
CLKSEL  
pdown (1)  
MF (2)  
PLL  
TMOD  
XCLK  
0: MF = 5.0  
1: MF = 6.6  
0
Clock Divider for  
Low Power Control  
(CLKCON)  
Internal System  
Clock SCLK  
(MCLK)  
ICLK  
MUX  
1
MCLKO  
CLKOEN  
NOTES:  
1. If CLKSEL is 1, the PLL block became to the state of power down.  
2. MF means Multiplication Factor.  
Figure 4-8. System Clock Circuit  
For the purpose of power save, Clock Control Register (CLKCON) can be programed at low frequency. When the  
internal system clock is divided by CLKCON, it's duty-cycle is changed.  
If CLKCON is programed to zero, the internal system clock remains the same as the internal clock, ICLK. In other  
cases, the duty cycle of internal system clock is no longer 50%.  
Figure 4-9 shows the internal system clock, SCLK(MCLK) waveform according to the clock dividing value.  
ICLK  
SCLK(MCLK)  
CLKCON = 0  
SCLK(MCLK)  
CLKCON = 1  
SCLK(MCLK)  
CLKCON = 2  
Figure 4-9. Divided System Clocks Timing Diagram  
4-24  
S3C4510B  
SYSTEM MANAGER  
EXTERNAL I/O ACCESS CONTROL REGISTERS (EXTACON0/1)  
The System Manager has four external I/O access control registers. These registers correspond to the up to four  
external I/O banks that are supported by S3C4510B. Table 4-19 describes the two registers that are used to  
control the timing of external I/O bank accesses.  
You can control external I/O access cycles using either a specified value or an external wait signal, nEWAIT. To  
obtain access cycles that are longer than those possible with a specified value, you can delay the active time of  
nOE or nWBE by tCOS value setting. After nOE or nWBE active, nEWAIT should be active previously at the first  
MCLK(SCLK) falling edge. In case of ROM bank 5, nRCS and nOE/nWBE signals are activated simultaneously,  
that is, there is no control parameter as like tCOS. As a result, nEWAIT should be valid previously at the second  
MCLK(SCLK) falling edge after nRCS active for the ROM bank 5.  
EXTACON0 is used to set the access timings for external I/O banks 0 and 1. EXTACON1 is used to set the  
external access timings for I/O banks 2 and 3.  
NOTE  
The base pointer for external I/O bank 0 is set in the REFEXTCON register(REFEXTCON register is in  
DRAM control registers part).  
Table 4-19. External I/O Access Control Register Description  
Registers  
EXTACON0  
EXTACON1  
Offset Address  
0x3008  
R/W  
R/W  
R/W  
Description  
Reset Value  
0x00000000  
0x00000000  
External I/O access timing register 0  
External I/O access timing register 1  
0x300C  
4-25  
SYSTEM MANAGER  
S3C4510B  
31 30 29 28 27  
25 24  
22 21  
19 18  
16 15 14 13 12 11  
9
8
6
5
3
2
0
EXTACON0  
EXTACON1  
0
0
0
0
0
0
0
0
tACC1  
tACC3  
tCOH1  
tCOH3  
tACS1  
tACS3  
tCOS1  
tCOS3  
0
0
0
0
0
0
0
0
tACC0  
tACC2  
tCOH0  
tCOH2  
tACS0  
tACS2  
tCOS0  
tCOS2  
[2:0] Chip selection set-up time on nOE (tCOS0, tCOS2)  
[18:16] tCOS1, tCOS3  
000 = 0 cycle  
001 = 1 cycle  
010 = 2 cycles  
011 = 3 cycles  
100 = 4 cycles  
101 = 5 cycles  
110 = 6 cycles  
111 = 7 cycles  
[5:3] Address set-up time before nECS (tACS0, tACS2)  
[21:19] tACS1, tACS3  
000 = 0 cycle  
001 = 1 cycle  
010 = 2 cycles  
011 = 3 cycles  
100 = 4 cycles  
101 = 5 cycle  
110 = 6 cycle  
111 = 7 cycles  
[8:6] Chip selection hold time on nOE (tCOH0, tCOH2)  
[24:22] tCOH1, tCOH3  
000 = 0 cycle  
001 = 1 cycle  
010 = 2 cycles  
011 = 3 cycles  
100 = 4 cycles  
101 = 5 cycles  
110 = 6 cycles  
111 = 7 cycles  
[11:9] Access cycles (nOE low time) (tACC0, tACC2)  
[27:25] tACC1, tACC3  
000 = 0 cycle  
001 = 1 cycle  
010 = 2 cycles  
011 = 3 cycles  
100 = 4 cycles  
101 = 5 cycles  
110 = 6 cycles  
111 = 7 cycles  
Figure 4-10. External I/O Access Control Registers (EXTACON0, EXTACON1)  
4-26  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
nECS  
tNECS  
tNECS  
tNROE  
tACC  
tNROE  
nOE  
Address  
Data  
tADDRh  
Addr  
Data  
nEWAIT  
Data  
Fetch  
tACS = 0 (0 cycle)  
tCOS = 0 (0 cycle)  
tACC = 4 (5 cycles)  
tCOH = 0 (0 cycle)  
Figure 4-11. External I/O Read Timing 1  
When nEWAIT is asserted for external I/O banks, the tCOS and tCOH should not be zero. When ROM banks,  
except ROM bank 5, are selected, the nEWAIT can not be asserted.  
Even if you does not use nEWAIT, nEWAIT pin should be connected pull-up for safe operation.  
4-27  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNECS  
tNECS  
tCOH  
tACC  
tACS  
tNROE  
nECS  
tNROE  
nOE  
Address  
Data  
tADDRh  
Addr  
Data  
nEWAIT  
Data  
Fetch  
tACS = 1 (1 cycle)  
tCOS = 0 (0 cycle)  
tACC = 3 (4 cycles)  
tCOH = 1 (1 cycle)  
Figure 4-12. External I/O Read Timing 2  
4-28  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
nECS  
tNECS  
tCOH  
tNECS  
tACC  
tACS  
tNROE  
tNROE  
nOE  
Address  
Data  
tCOS  
tADDRd  
Addr  
Data  
tWs  
tWh  
nEWAIT  
Data Read Point  
(tCOH = 1)  
tACS = 1 (1 cycle)  
tCOS = 1 (1 cycle)  
tACC = 1 (2 cycles)  
tCOH = 1 (1 cycle)  
Figure 4-13. External I/O Read Timing with nEWAIT  
The nEWAIT should be valid at the first SCLK falling edge after nOE active. In this case, tCOS and tCOH need  
to have a minimum of one cycle, and by the setting of tCOS value slower device can be supported. Naimly,  
nEWAIT valid time depends on tCOS value. Deassertion timing depends on the applied Ext. I/O devices.  
When the nEWAIT de-assert, it must be synchronized with MCLKO rising edge.(Because we can not detect  
SCLK falling edge.) If not, memory state machine can go into the wrong state.  
4-29  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNECS  
tNECS  
tACC  
nECS  
tNWBE  
tNWBE  
nWBE  
Address  
Data  
tADDRd  
tADDRh  
tWDh  
Addr  
Data  
tWDd  
nEWAIT  
tACS = 0 (0 cycle)  
tCOS = 0 (0 cycle)  
tACC = 4 (5 cycles)  
tCOH = 0 (0 cycle)  
Figure 4-14. External I/O Write Timing 1  
4-30  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
nECS  
tNECS  
tNECS  
tACC  
tCOH  
tACS  
tNWBE  
tNWBE  
nWBE  
Address  
Data  
tADDRd  
Addr  
Data  
tWDd  
tWDh  
nEWAIT  
tACS = 1 (1 cycle)  
tCOS = 0 (0 cycle)  
tACC = 3 (4 cycles)  
tCOH = 1 (1 cycle)  
Figure 4-15. External I/O Write Timing 2  
4-31  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNECS  
tNECS  
tCOH  
tACC  
tACS  
nECS  
tNWBE  
tNWBE  
nWBE  
Address  
Data  
tCOS  
tADDRd  
Addr  
Data  
tWDd  
tWDh  
tWs  
tWh  
nEWAIT  
tACS = 1 (1 cycle)  
tCOS = 1 (1 cycle)  
tACC = 1 (2 cycles)  
tCOH = 1 (1 cycle)  
Figure 4-16. External I/O Write Timing with nEWAIT  
4-32  
S3C4510B  
SYSTEM MANAGER  
DATA BUS WIDTH REGISTER (EXTDBWTH)  
The S3C4510B has interfaces for 8/16/32-bit external ROMs, SRAMs, flash memories, DRAMs, SDRAMs, and  
external I/O ports. Using data bus width register, you can set the data bus width that is required for specific  
external memory and external I/O banks.  
NOTE  
In Figure 4-20, the term "Disable" means that the S3C4510B does not generate the access signal for the  
corresponding external I/O bank.  
Table 4-20. EXTDBWTH Register Description  
Registers  
Offset  
R/W  
Description  
Reset Value  
EXTDBWTH  
0x3010  
R/W  
Data bus width of each bank  
0x00000000  
4-33  
SYSTEM MANAGER  
S3C4510B  
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  
EXTDBWTH  
0 0 0  
0 DSX3 DSX2 DSX1 DSX0 DSD3 DSD2 DSD1 DSD0 DSR5 DSR4 DSR3 DSR2 DSR1 DSR0  
[1:0] Data bus width for ROM/SRAM/FLASH bank 0 (DSR0)  
DSR0 is read-only data at the B0SIZE [1:0] pins. DSR0 is used as read-only  
because ROM/SRAM/FLASH bank 0 is used to boot the ROM while the data  
bus width for ROM/SRAM/FLASH bank 0 is set using B0SIZE [1:0].  
00 = Not permitted  
01 = Byte (8 bits)  
10 = Half-word (16 bits)  
11 = Word (32 bits)  
[3:2] Data bus width for ROM/SRAM/FLASH bank 1 (DSR1)  
[5:4] DSR2, [7:6] DSR3, [9:8] DSR4, [11:10] DSR5  
00 = Disable  
01 = Byte (8 bits)  
10 = Half- word (16 bits)  
11 = Word (32 bits)  
[13:12] Data bus width for DRAM bank 0 (DSD0)  
[15:14] DSD1, [17:16] DSD2, [19:18] DSD3  
00 = Disable  
01 = Byte (8 bits)  
10 = Half-word (16 bits)  
11 = Word (32 bits)  
[21:20] Data bus width for external I/O bank 0 (DSX0)  
[23:22] DSX1, [25:24] DSX2, [27:26] DSX3  
00 = Dissable  
01 = Byte (8 bits)  
10 = Half-word (16 bits)  
11 = Word (32 bits)  
NOTE:  
When you select "Disable", the assigned external I/O  
bank access signal is not generated.  
Figure 4-17. Data Bus Width Register (EXTDBWTH)  
4-34  
S3C4510B  
SYSTEM MANAGER  
ROM/SRAM/FLASH CONTROL REGISTERS (ROMCON)  
The System Manager has six control registers for ROM, SRAM, and flash memory (see Table 4-21). These  
registers correspond to the up to six ROM/SRAM/Flash banks that are supported by S3C4510B.  
For ROM/SRAM/Flash bank 0, the external data bus width is determined by the signal at the B0SIZE[1:0] pins:  
When B0SIZE[1:0] = "01", the external bus width for ROM/SRAM/Flash bank 0 is 8 bits.  
When B0SIZE[1:0] = "10", the external bus width for ROM/SRAM/Flash bank 0 is 16 bits.  
When B0SIZE[1:0] = "11", the external bus width for ROM/SRAM/Flash bank 0 is 32 bits.  
You can determine the start address of a special register's bank by the value of the corresponding "special  
register bank base pointer". The control register's physical address is always the sum of the register's bank base  
pointer plus the register's offset address.(For example, base pointer is 0x3ff0000 and ROMCON0’s offset is  
0x3014. Then ROMCON0’s physical address becomes 0x3ff3014.)  
NOTE  
If you attach SRAM to a ROM/SRAM/Flash bank, you must set the page mode configuration bits,  
ROMCONn[1:0], in the corresponding control register to "00" (normal ROM).  
Table 4-21. ROM/SRAM/Flash Control Register Description  
Registers  
ROMCON0  
ROMCON1  
ROMCON2  
ROMCON3  
ROMCON4  
ROMCON5  
Offset  
0x3014  
0x3018  
0x301C  
0x3020  
0x3024  
0x3028  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
Description  
Reset Value  
0x20000060  
0x00000060  
0x00000060  
0x00000060  
0x00000060  
0x00000060  
ROM/SRAM/Flash bank 0 control register  
ROM/SRAM/Flash bank 1 control register  
ROM/SRAM/Flash bank 2 control register  
ROM/SRAM/Flash bank 3 control register  
ROM/SRAM/Flash bank 4 control register  
ROM/SRAM/Flash bank 5 control register  
4-35  
SYSTEM MANAGER  
S3C4510B  
31 30 29  
20 19  
10 9  
8
7
6
4
3
2
1
0
ROM/SRAM/Flash Bank #  
Next Pointer  
ROM/SRAM/Flash Bank #  
Base Pointer  
0
0
0
0
0
tACC  
tPA PMC  
[1:0] Page mode configuration (PMC)  
00 = Normal ROM  
01 = 4-word page  
10 = 8-word page  
11 = 16-word page  
[3:2] Page address access time (tPA)  
00 = 5 cycles  
01 = 2 cycles  
10 = 3 cycles  
11 = 4 cycles  
[6:4] Programmable access cycle (tACC)  
000 = Disable bank  
010 = 3 cycle  
110 = 7 cycle  
001 = 2 cycles  
011 = 4 cycles  
111 = Reserved  
[19:10] ROM/SRAM/Flash bank # base pointer  
This value is the start address of the ROM/SRAM/Flash bank #.  
The start address is calculated as ROM/SRAM/FLASH bank #  
base pointer << 16.  
[29:20] ROM/SRAM/FLASH bank # next pointer  
This value is the current bank end address << 16 + 1.  
Figure 4-18. ROM/SRAM/FLASH Control Registers (ROMCON0–ROMCON5)  
4-36  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
tNRCS  
tNROE  
tADDRd  
tNRCS  
tACC  
nRCS  
nOE  
tADDRh  
Addr  
Address  
Data  
tRDs  
tRDh  
Data  
Data Fetch  
Point  
tACC = 4 (5 cycles)  
Figure 4-19. ROM/SRAM/Flash Read Access Timing  
4-37  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNRCS  
tNROE  
tNRCS  
tNROE  
tPA  
tPA  
tPA  
tACC  
nRCS  
nOE  
tADDRd  
Addr  
Addr + 1  
Data  
Addr + 2  
Data  
Addr + 3  
Data  
Address  
Data  
tRDh  
tRDh  
tRDh  
tRDh  
Data  
Data Fetch  
Data Fetch  
Data Fetch  
Data Fetch  
tACC = 2 (3 cycles)  
tPA = 1 (2 cycles)  
PMC = 1 (4 word page)  
Figure 4-20. ROM/SRAM/Flash Page Read Access Timing  
4-38  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
tNRCS  
tNRCS  
tACC  
nRCS  
nWBE  
tNWBE  
tNWBE  
tADDRd  
Address  
Data  
Addr  
tWDd  
Data  
tACC = 4 (5 cycles)  
Figure 4-21. ROM/SRAM/Flash Write Access Timing  
4-39  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNRCS  
tNRCS  
tACC  
tPA  
nRCS  
nWBE  
tNWBE  
tNWBE  
tADDRd  
tADDRh  
tADDRd  
Addr  
Addr + 1  
Data  
Address  
Data  
Data  
tACC = 2 (3 cycles)  
tPA = 1 (2 cycles)  
PMC = 1 (4 word page)  
Figure 4-22. ROM/SRAM/Flash Page Write Access Timing  
4-40  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
tNRCS  
tNRCS  
NOTE 1  
tACC  
tPA (or tACC)  
nRCS  
nWBE  
nOE  
tNWBE  
tNWBE  
tNROE  
tNROE  
tADDRd  
tADDRd  
tADDRh  
Addr  
Addr + 1  
Address  
Data  
Data  
Data  
Data Fetch  
tACC = 2 (3 cycles)  
tPA = 1 (2 cycles)  
PMC = 1(4 word page)  
NOTE:  
Page hit case: tPA  
Page miss case: tACC  
Figure 4-23. ROM/SRAM/Flash Read and Write Access Timing  
4-41  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNRCS  
tNRCS  
tACC  
tPA  
nRCS  
nWBE  
nOE  
tNWBE  
tNWBE  
tNROE  
tNROE  
tADDRh  
tADDRd  
tADDRd  
Addr  
Addr + 1  
Address  
Data  
Data  
Data  
Figure 4-24. ROM/SRAM/Flash Write and Read Access Timing  
4-42  
S3C4510B  
SYSTEM MANAGER  
ROM BANK 5 ADDRESS/DATA MULTIPLEXED BUS  
Overview  
The S3C4510B has separate address and data bus. S3C4510B supports multiplexed address/data bus for low  
cost chips which require multiplexed bus. To support this feature, the S3C4510B has one special bank (ROM  
bank 5) which can support address/data multiplexed bus and 4-data burst access by GDMA. For this feature, you  
should set the MUX enable bit and wait enable bit of CLKCON register.  
You can also use ROM bank 5 as normal ROM bank by clearing MUX enable bit of CLKCON register.  
When you set the wait enable bit in the CLKCON register, wait cycle can be added by nEWAIT pin for ROM bank  
5. Other ROM banks except ROM bank 5 has no effects. nEWAIT pin also can be used to add wait cycle for EXT  
I/O bank regardless of the wait enable bit.  
Random Access by CPU  
At the first cycle of ROM bank 5, address comes out from data bus. Therefore, any device which is connected to  
the ROM bank 5 can get address. The rest cycle is for data. As the S3C4510B has not a dedicated address  
strobe signal for address phase in the data burst, you should generate address strobe signal in the application  
device.  
Four-data Burst Access by GDMA  
When you set FB (4-data burst enable) bit in the GDMACON register, the GDMA requests 4-data burst access.  
When you access ROM bank 5 by 4-data burst mode, the multiplexed ROM bank 5 bus has only one address  
phase. Therefore, you should internally calculate the address at the data phase. To notify the 4-data burst mode  
to ROM bank 5 device, the ADDR[21] remains "1" during address phase.  
4-43  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNRCS  
tNROE  
tNRCS  
tNROE  
tACC  
nRCS[5]  
nOE  
nWBE  
tADDRd  
Addr  
Address  
Data  
tAC  
Addr  
Data  
Address  
Cycle  
Data Cycle  
nEWAIT  
1 wait  
Data Read  
Point  
tAC = 0 (1 cycle)  
tACC = 1 (2 cycles)  
MUX BUS Enable  
Figure 4-25. ROM/SRAM/FLASH Bank 5 random Read with nEWAIT Access Timing  
4-44  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
nRCS[5]  
tNRCS  
tNROE  
tNRCS  
tNROE  
tACC  
tACC  
tACC  
tACC  
nOE  
nWBE  
tADDRd  
Addr 0  
Addr 1  
Data 1  
Addr 3  
Address  
Data  
Addr 2  
Data 2  
tAC  
Data 3  
Data 0  
Addr  
Address  
Cycle  
Data Cycle  
nEWAIT  
tAC = 0 (1 cycle)  
tACC = 1 (2 cycles)  
MUX BUS Enable  
Figure 4-26. ROM/SRAM/FLASH Bank 5 four word burst Read Access Timing When GDMA Request  
4-45  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNRCS  
tNRCS  
tACC  
nRCS[5]  
nOE  
tNWBE  
tNWBE  
nWBE  
tADDRd  
Addr  
Address  
Data  
tAC  
Addr  
Data  
Address  
Cycle  
Data Cycle  
nEWAIT  
1 Wait  
tAC = 0 (1 cycle)  
tACC = 1 (2 cycles)  
MUX BUS Enable  
Figure 4-27. ROM/SRAM/FLASH Bank 5 Write Timing with nEWAIT Access Timing  
4-46  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
tNRCS  
tNRCS  
tACC  
tACC  
tACC  
tACC  
nRCS[5]  
nOE  
tNWBE  
tNWBE  
nWBE  
tADDRd  
Addr 0  
Addr 1  
Addr 2  
Addr 3  
Address  
Data  
tAC  
Data 0  
Data 1  
Data 2  
Data 3  
Addr  
Address  
Cycle  
Data Cycle  
nEWAIT  
tAC = 0 (1 cycle)  
tACC = 1 (2 cycles)  
MUX BUS Enable  
Figure 4-28. ROM/SRAM/FLASH Bank5 Four-data Burst Mode Write Timing When GDMA Requests  
4-47  
SYSTEM MANAGER  
S3C4510B  
DRAM CONTROL REGISTERS  
The System Manager has four DRAM control registers, DRAMCON0–DRAMCON3. These registers correspond  
to the up to four DRAM banks that are supported by S3C4510B. A fifth register, REFEXTCON, is used to set the  
base pointer for external I/O bank 0.  
S3C4510B supports EDO, normal, Synchronous DRAM(SDRAM). SDRAM mode can be selected by setting  
SYSCFG[31]. If this bit is set to '1', all DRAM banks are selected SDRAM. Otherwise, EDO/FP DRAM banks are  
selected.  
Table 4-22. DRAM and External I/O Control Register Description  
Registers  
DRAMCON0  
DRAMCON1  
DRAMCON2  
DRAMCON3  
REFEXTCON  
Offset  
0x302C  
0x3030  
0x3034  
0x3038  
0x303C  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
Description  
Reset Value  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
DRAM bank 0 control register  
DRAM bank 1 control register  
DRAM bank 2 control register  
DRAM bank 3 control register  
Refresh and external I/O control register  
4-48  
S3C4510B  
SYSTEM MANAGER  
31 30 29  
20 19  
10 9  
8
7
6
4
3
2
1
0
t
R
C
t
C
P
E
D
O
DRAM Bank # Next Pointer  
DRAM Bank # Base Pointer  
DRAMCON# CAN  
tRP  
Reserve  
tCS  
[0] EDO mode (EDO)  
0 = Normal DRAM (Fast page mode DRAM)  
1 = EDO DRAM  
[2:1] CAS strobe time (tCS) (note)  
00 = 1 cycle  
01 = 2 cycles  
10 = 3 cycles  
11 = 4 cycles  
[3:3] CAS pre-charge time (tCP)  
0 = 1 cycle  
1 = 2 cycles  
[6:4] Reserved  
These bits default value is 000. But, you must set to 001.  
[7] RAS to CAS delay (tRC or tRCD)  
0 = 1 cycle  
1 = 2 cycles  
[9:8] RAS pre-charge time (tRP)  
00 = 1 cycle  
10 = 3 cycles  
01 = 2 cycles  
11 = 4 cycles  
[19:10] DRAM bank # base pointer  
This value indicates the start address of DRAM bank #. The start address is  
calculated as RAM bank # base pointer << 16  
[29:20] DRAM bank # next pointer  
This value is the current bank end address << 16 + 1  
[31:30] Number of column address bits in DRAM bank # (CAN)  
00 = 8 bits  
01 = 9 bits  
10 = 10 bits  
11 = 11 bits  
NOTE:  
In SDRAM mode, this bit affect SDRAM cycle.  
tCS value[1]: 0 = 1 cycle  
1 = 2 cycle  
Figure 4-29. DRAM Control Registers (DRAMCON–DRAMCON3)  
4-49  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNRASr  
tNRASf  
tCS  
tCP  
tCS  
tRP  
nRAS  
nCAS  
tNCASf  
tNCASr  
tRC  
tNROE  
tNROE  
nOE  
nDWE  
tADDRd  
Row  
Addr  
Column Addr  
(Same page)  
Column Addr  
Address  
Data  
Data  
Data  
Data Fetch  
Data Fetch  
(Normal DRAM)  
(Normal DRAM)  
Data  
Data  
Data Fetch  
Data Fetch  
(EDO DRAM)  
(EDO DRAM)  
tRP = 0 (1 cycle)  
tCS = 1 (2 cycles)  
tCP = 0 (1 cycle)  
tRC = 0 (1 cycle)  
Figure 4-30. EDO/FP DRAM Bank Read Timing (Page Mode)  
4-50  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
tNRASr  
tNRASf  
tCS  
tCP  
tCS  
nRAS  
nCAS  
tRP  
tNCASwf  
tNCASwr  
tNDWE  
tRC  
tNDWE  
nDWE  
nOE  
tADDRd  
Row  
Addr  
Column Addr  
(Same page)  
Address  
Data  
Column Addr  
Data  
Data  
tRP = 0 (1 cycle)  
tCS = 1 (2 cycles)  
tCP = 0 (1 cycle)  
tRC = 0 (1 cycle)  
Figure 4-31. EDO/FP DRAM Bank Write Timing (Page Mode)  
4-51  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
tNRASr  
tNRASf  
tCS  
tCP  
tCS  
nRAS  
nCAS  
tRP  
tNCASf  
tNCASwr  
tNCASwf  
tNCASr  
tRC  
tNROE  
tNROE  
nOE  
tNDWE  
tNDWE  
nDWE  
tADDRd  
Row  
Addr  
Column Addr  
(Same page)  
Address  
Data  
Column Addr  
Data  
tWDDd  
tWDDh  
Data  
Data Fetch  
(Normal DRAM)  
tRP = 0 (1 cycle)  
tCS = 1 (2 cycles)  
tCP = 0 (1 cycle)  
tRC = 0 (1 cycle)  
Data  
Data Fetch  
(EDO DRAM)  
Figure 4-32. EDO/FP DRAM Bank Read and Write Timing (Page Mode)  
4-52  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
tNRASr  
tNRASf  
tCS  
tCP  
tCS  
nRAS  
nCAS  
tRP  
tNCASf  
tNCASwr  
tNCASwf  
tNCASr  
tRC  
tNROE  
tNROE  
nOE  
tNDWE  
tNDWE  
nDWE  
tADDRd  
Row  
Addr  
Column Addr  
(Same page)  
Address  
Data  
Column Addr  
tWDDd  
tWDDh  
Data  
Data  
Data Read  
Point  
tRP = 0 (1 cycle)  
tCS = 1 (2 cycles)  
tCP = 0 (1 cycle)  
tRC = 0 (1 cycle)  
Normal DRAM  
Figure 4-33. EDO/FP DRAM Bank Write and Read Timing (Page Mode)  
4-53  
SYSTEM MANAGER  
S3C4510B  
Mode  
Register Set  
(MRS)  
Precharge  
(All banks)  
Auto  
Refresh  
Auto  
Refresh  
200 us  
SCLK  
MCLKO  
CKE  
High level is necessary.  
nSDCS  
nSDRAS  
nSDCAS  
ADDR  
BA  
Key  
A10/AP  
nDWE  
DQM  
RFU  
TM  
A8 A7  
0 0  
CAS Latency  
BT  
A3  
0
Burst Length  
A2 A1 A0  
0 0 0  
KEY  
A9  
0
A6 A5 A4  
0 1 0  
Figure 4-34. SDRAM Power-up Sequence  
4-54  
S3C4510B  
SYSTEM MANAGER  
1
2
3
4
5
6
7
8
9
10  
11  
12  
13  
SCLK  
MCLKO  
CKE  
nSDCS  
tRP  
nSDRAS  
tRCD  
nSDCAS  
ADDR  
Col2  
Col1  
Row  
Col0  
(1)  
nDWE  
DATA  
Rd  
Rd  
Wd  
(2)  
(3)  
0xF  
0x0  
0xF  
0x0  
0xF  
DQM  
Precharge  
(All banks)  
Row  
Active  
Read  
Fetch  
Write Read  
Fetch  
NOTES:  
1. There is minimum 1 cycle gap between data-in and data-out of  
SDRAM to prevent bus confliction.  
2. All DQM signals go to zero during read operation.  
3. Only valid signals go to zero during write operation.  
Figure 4-35. Non-burst, Read-Write-Read Cycles @CAS Latency = 2, Burst Length = 1  
4-55  
SYSTEM MANAGER  
S3C4510B  
DRAM INTERFACE FEATURES  
The S3C4510B provides a fully programmable external DRAM interface. You can easily modify the  
characteristics of this interface by manipulating the corresponding DRAM control registers. Programmable  
features include  
·
·
·
·
·
External data bus width  
Control fast page or EDO mode by DRAMCON[0]  
Select fast page/EDO mode or SDRAM mode by SYSCFG  
Number of access cycles for each DRAM bank, and  
CAS strobe time, CAS precharge time, RAS to CAS delay, RAS pre-charge time  
The refresh and external I/O control register, REFEXTCON, controls DRAM refresh operations and external I/O  
bank accesses. The S3C4510B eliminates the need for an external refresh signal by automatically issuing an  
internal CAS-before-RAS refresh or auto-refresh control signal.  
The S3C4510B generates row and column addresses for DRAM accesses with 23-bit internal address bus. It also  
supports symmetric or asymmetric DRAM addressing by changing the number of column address lines from 8 to  
11.  
EDO Mode DRAM Accesses  
The timing for accessing a DRAM in EDO mode is comparable to DRAM accesses in normal fast page mode.  
However, in EDO mode, the S3C4510B CPU fetches data (when read) one-half clock later than in normal fast  
page mode. This is possible because EDO mode can validate the data even if CAS goes High when RAS is Low.  
In this way, gives the CPU sufficient time to access and latch the data so that the overall memory access cycle  
time can be reduced.  
Synchronous DRAM Accesses  
Synchronous DRAM interface features are as follows:  
·
MRS cycle with address key program  
— CAS latency (2 cycles)  
— Burst length (1)  
— Burst type (Sequential)  
·
·
Auto refresh  
SDRAM interface signal: CKE, SDCLK, nSDCS[3:0], nSDCAS, nSDRAS, DQM[3:0], ADDR[10]/AP  
The address bits except row and column address among the 23-bit internal address bus can be assigned to Bank  
select address(BA) for SDRAM.  
See the SDRAM interface example, Figure 4-36.  
4-56  
S3C4510B  
SYSTEM MANAGER  
Available Samsung SDRAM Components for S3C4510B  
Components  
S3C4510B can support below SDRAM configuration for 1 bank.  
·
·
·
·
·
2MBytes to 1 bank ® 1 ´ (2Mx32 with 4banks)  
4MBytes to 1 bank ® 2 ´ (1Mx16 with 2banks)  
8MBytes to 1 bank ® 4 ´ (2Mx8 with 2banks)  
16MBytes to 1bank ® 2 ´ (4Mx16 with 2/4banks)  
32MBytes to 1bank ® 4 ´ (8Mx8 with 2/4banks)  
You can select any combination among them.  
SDRAM components that are available are as follow.  
x4 SDRAM whose capacity is larger than 16M SDRAM is not supported at S3C4510B.  
16M bit SDRAM  
4Mx4 with 2banks (Supported)  
— 2Mx8 with 2banks (Supported)  
— 1Mx16 with 2banks (Supported)  
RA0–RA10, CA0–CA9  
RA0–RA10, CA0–CA8  
RA0–RA10, CA0–CA7  
64M bit 2Banks SDRAM  
— 16Mx4 with 2banks (not supported)  
— 8Mx8 with 2banks (supported)  
— 4Mx16 with 2banks (supported)  
RA0–RA12, CA0–CA9  
RA0–RA12, CA0–CA8  
RA0–RA12, CA0–CA7  
64M bit 4Banks SDRAM  
— 16Mx4 with 4banks (not supported)  
— 8Mx8 with 4banks (supported)  
— 4Mx16 with 4banks (supported)  
RA0–RA11, CA0–CA9  
RA0–RA11, CA0–CA8  
RA0–RA11, CA0–CA7  
2Mx32 (64M bit) SDRAM  
— 2Mx32 with 4banks (supported)  
RA0–RA10, CA0–CA7  
100 Pin DIMM Module SDRAM  
KMM330S104CT  
— 1Mx32 based on 2 1Mx16 2banks components  
RA0–RA10, CA0–CA7  
RA0–RA10, CA0–CA7  
RA0–RA11, CA0–CA7  
RA0–RA11, CA0–CA7  
KMM330S204CT  
— 4Mx32 based on 4 1Mx16 2banks components  
KMM330S2424CT  
— 4Mx32 based on 2 4Mx16 4banks componets  
KMM330S824CT  
— 8Mx32 based on 4 4Mx16 4banks componets  
4-57  
SYSTEM MANAGER  
S3C4510B  
Relationship Between CAN (Column Address Number) and Address MUX Output for SDRAM  
Table 4-23. CAN and Address MUX Output  
CAN  
Output  
Timing  
External Address Pins (ADDR)  
[21:15]  
14  
13  
12  
11  
10  
9
8
7-0  
00  
Column  
address  
x
A22  
A21  
A20  
A19  
A10/AP  
A9  
A8  
A7-A0  
Row  
address  
x
x
x
x
x
A22  
0
A21  
A22  
A22  
0
A20  
A21  
A21  
A22  
A22  
A19  
A20  
A20  
A21  
A21  
A18  
A10/AP  
A19  
A17  
A9  
A16  
A8  
A15-A8  
A7-A0  
01  
10  
Column  
address  
Row  
address  
0
A18  
A9  
A17  
A8  
A16-A9  
A7-A0  
Column  
address  
0
A10/AP  
A20  
Row  
0
0
A19  
A18  
A17-A10  
address  
NOTES:  
1. A22 to A0 depends on external bus width. In case of x32 memory, A[22:0] is word address.  
2. A[22:0] consists of: Bank Address + Valid Row Address + Valid Column Address  
DRAM BANK SPACE  
The S3C4510B DRAM interface supports four DRAM banks. Each bank can have a different configuration. You  
use the DRAM control registers, DRAMCON0-DRAMCON3, to program the DRAM access cycles and memory  
bank locations.  
Each DRAM control register has two 10-bit address pointers, one base pointer and one next pointer, to denote the  
start and end address of each DRAM bank. The 10-bit pointer values are mapped to the address [25:16]. This  
gives each bank address an offset value of 64 K bytes (16 bits). The next pointer value will be the DRAM bank's  
end address + 1.  
System Initialization Values  
When the system is initialized, the four DRAM control registers are initialized to 00000000H, disabling all external  
DRAMs.  
4-58  
S3C4510B  
SYSTEM MANAGER  
CLK  
D3  
D2  
D1  
D0  
CS  
CKE  
RAS  
CAS  
WE  
Address  
DQM  
DQ0-7  
<3>  
<2>  
<1>  
<0>  
CLK  
MCLKO/SDCLK  
nRAS/nSDCS 0, 1, 2, 3  
nCAS2/CKE  
CS  
CKE  
RAS  
CAS  
WE  
nCAS0/nSDRAS  
nCAS1/nSDCAS  
nDWE  
S3C451B  
Address  
DQM  
DQ0-7  
ADDR[10:0]  
nWBE[3:0]/DQM[3:0]  
XDATA[31:0]  
ADDR[11]  
BA0  
CLK  
All  
SDRAM's  
BA pin  
CS  
CKE  
RAS  
CAS  
WE  
Address  
DQM  
DQ0-7  
CLK  
CS  
CKE  
RAS  
CAS  
WE  
Address  
DQM  
DQ0-7  
NOTE:  
4 components have the following features:  
1 M x 8 bit x 2 Banks 9 bit column, 11 bit row- address  
Figure 4-36. SDRAM Application Example  
4-59  
SYSTEM MANAGER  
S3C4510B  
DRAM REFRESH AND EXTERNAL I/O CONTROL REGISTER  
The S3C4510B DRAM interface supports the CAS-before-RAS (CBR) refresh mode for EDO/FP DRAM and  
auto-refresh for SDRAM. Settings in the DRAM refresh and external I/O control register, REFEXTCON, control  
DRAM refresh mode, refresh timings, and refresh intervals. REFEXTCON also contains the 10-bit base pointer  
value for the external I/O bank 0.  
NOTE  
Whenever the S3C4510B CPU writes one of system manager registers, the validity of special register  
field (that is, the VSF bit) is automatically cleared and the external bus is disabled. To reactivate external  
bus, you must set the VSF bit to "1" using a STMIA instruction. It is recommended that programmers  
always use STMIA instructions to write the 10 system manager special registers. The instruction used to  
set the VSF bit should always be the last instruction in the register write sequence.  
4-60  
S3C4510B  
SYSTEM MANAGER  
31  
21 20 19  
17 16 15 14 13 12 11 10 9  
0
t
R V  
E S  
N F  
External I/O Bank 0  
Base Pointer  
C
REFEXTCON  
Refresh Count Value  
tCHR  
0 0 0 0 0  
S
R
[9:0] External I/O bank 0 base pointer (base address)  
This value is the start address of I/O external I/O bank 0. Start address is defined as  
external I/O bank 0 base pointer << 16. The end address of external I/O bank 0 is defined  
as external I/O bank 0 base pointer >> 16 + 16 Kbytes - 1.  
NOTE:  
All external I/O banks are located in the continuous address space which  
begins at the start address of external I/O bank 0. The size of each external I/O bank  
is fixed at 16Kbytes. The start and end addresses of the other three external I/O banks  
can be derived from the external I/O bank 0 base pointer value.  
[15] Validity of spedial register field (VSF)  
0 = Not accessible to memory bank  
1 = Accessible to memory bank  
[16] Refresh enable (REN)  
0 = Disable DRAM refresh  
1 = Enable DRAM refresh  
[19:17] CAS hold time (tCHR)  
ROW cycle time (tRC) (Note 1)  
000 = 1 cycle  
010 = 3 cycles  
100 = 5 cycles  
110 = Not used  
001 = 2 cycles  
011 = 4 cycles  
101 = Not used (6 cycles)  
111 = Not used  
[20] CAS setup time (tCSR)(Note 2)  
0 = 1 cycle  
1 = 2 cycles  
[31:21] Refresh count value (duration)  
The refresh period is calculate as (211 - value + 1)/fMCK  
NOTES:  
1. In EDO/normal DRAM mode, CAS hold time can be  
programmed upto 5 cycles. But in SDRAM mode, this  
bit fields function are defined as ROW cycle time (tRC)  
and can be programmed upto 6 cycles.  
2. In SDRAM mode, this bit field is reserved.  
Figure 4-37. DRAM Refresh and External I/O Control Register (REFEXTCON)  
4-61  
SYSTEM MANAGER  
S3C4510B  
External I/O Bank 3  
External I/O Bank 2  
External I/O Bank 1  
External I/O Bank 0  
Continuous 16 Kword address  
space for 4 external I/O banks  
End Address of  
External I/O Bank 0  
4 Kwords (fixed for all I/O banks)  
Start Address of  
External I/O Bank 0  
Start address of external I/O bank n =  
(External I/O bank 0 base pointer << 16) + 16 Kbytes x n  
End address of external I/O bank n =  
(External I/O bank 0 base pointer << 16) + 16 Kbytes x (n + 1) - 1  
Where, n is an external I/O bank number (= 0, 1, 2, 3)  
Figure 4-38. External I/O Bank Address Map  
4-62  
S3C4510B  
SYSTEM MANAGER  
SCLK  
MCLKO  
nRAS  
nCAS  
tCSR  
tCHR  
nDWE/  
nOE  
Address  
Data  
Figure 4-39. EDO/FP DRAM Refresh Timing  
4-63  
SYSTEM MANAGER  
S3C4510B  
SCLK  
MCLKO  
CKE  
High level is necessary  
nSDCS  
nSDRAS  
nSDCAS  
nDWE  
tRP  
tRC  
Precharge  
(All banks)  
Auto  
Refresh  
New  
Command  
Figure 4-40. Auto Refresh Cycle of SDRAM  
NOTE  
At auto-refresh cycle, DRAM bank0's tRP bit field is used as RAS pre-charge time parameter.  
4-64  
S3C4510B  
UNIFIED INSTRUCTION/DATA CACHE  
5
UNIFIED INSTRUCTION/DATA CACHE  
OVERVIEW  
The S3C4510B CPU has a unified internal 8K byte instruction/data cache. Using cache control register settings,  
you can use part or all of this cache as internal SRAM. To raise the cache hit ratio, the cache is configured using  
two-way, set-associative addressing. The replacement algorithm is pseudo-LRU (Least Recently Used).  
The cache line size is four words (16 bytes). When a miss occurs, four words must be fetched consecutively from  
external memory. Typically, RISC processors take advantage of unified instruction/data caches to improve  
performance. Without an instruction cache, bottlenecks that occur during instruction fetches from external  
memory may seriously degrade performance.  
CACHE CONFIGURATION  
The S3C4510B’s 4K byte, two-way set-associative instruction/data cache uses a 15-bit tag address for each set.  
The CS bits (a 2-bit value) in tag memory stores information for cache replacement. When a reset occurs, the CS  
value is "00", indicating that the contents of cache set 0 and cache set 1 are invalid. When the first cache fill  
operation occurs while exiting from the reset operation, the CS value becomes "01" at the specified line to  
indicate that only set 0 is valid. When the subsequent cache fill occurs, the CS value becomes "11" at the  
specified line, indicating that the contents of both set 0 and set 1 are valid.  
5-1  
UNIFIED INSTRUCTION/DATA CACHE  
S3C4510B  
31 30 29 28 27 26 25  
10 9  
4
3 2 1 0  
Tag Address (15-bit)  
2-bit  
Enable non-cacheable control  
7 (8) bits  
15 (14)  
switch  
15 (14)  
100: Set 0 direct access  
101: Set 1 direct access  
110: TAG direct access  
2
15 (14)  
Height = 128 (256)  
CS  
Set 1 Tag  
Set 0 Tag  
7 (8)-bit  
Decoder  
Tag RAM (32-bit)  
Set I Cache 1 = 4 instruction/data (128-bit)  
Set I Cache 0 = 4 instruction/data (128-bit)  
Instr3  
Instr2  
Instr1  
Instr0  
Instr3  
Instr2  
Instr1  
Instr0  
7 (8)-bit  
Height =  
128 (256)  
32-bit  
32-bit  
2
32  
32  
2
32  
(Set 0 Hit)  
(Set 1 Hit)  
Figure 5-1. Memory Configuration for 4-Kbyte (or 8-Kbyte) Cache  
5-2  
S3C4510B  
UNIFIED INSTRUCTION/DATA CACHE  
CACHE REPLACE OPERATIONS  
When the contents of two sets are valid and when the content of the cache must be replaced due to a cache  
miss, the CS value becomes "10" at specified line. This indicates that the content of set 0 (S0) was replaced.  
When CS is "10" and when another replacement is required due to a cache miss, the content of set 1 (S1) is  
replaced by changing the CS value to "01".  
To summarise, at its normal steady state, the CS value is changed from "01" or "10" to "10" or "01". This  
modification provides the information necessary to implement a 2-bit pseudo-LRU (Least Recently Used) cache  
replacement policy.  
Reset(/)  
NVALID: 00  
; Set 0, set 1 all invalid  
miss  
; Chahe miss occurs  
S0 only: 01  
; Set 0 = valid, set 1 = invalid  
Status does not change on hit  
Hit  
miss  
; Read miss  
; AV_S1D = All valid and set 1 is dirty.  
Dirty means to access just before;  
status does not change on hit.  
Miss or hit 1  
Miss or hit 0  
AV-S1D: 11  
AV-S0D: 10  
Hit 1  
; AV_S0D = All valid and set 0 is dirty.  
Hit 0  
Figure 5-2. Cache Replace Algorithm State Diagram  
5-3  
UNIFIED INSTRUCTION/DATA CACHE  
CACHE DISABLE/ENABLE  
S3C4510B  
To disable the cache disable entirely following a system reset, you must set SYSCFG[1] to "0". By setting the  
cache mode bits, SYSCFG[5:4], you can specify a cache size of 0, 4, or 8K bytes. If you do not need the entire 8-  
Kbyte area for cache, you can use the remaining area as normal internal SRAM. The start address of the internal  
SRAM area is defined by writing an appropriate value to SYSCFG[15:6].  
CACHE FLUSH OPERATION  
To flush cache lines, you must write a zero to Tag memory bits 31 and 30, respectively.  
The 4-Kbyte set 0 RAM area, 4-Kbyte set 1 RAM area, and the 1-Kbyte Tag RAM area (total 256 words) can be  
accessed from locations 0x10000000H, 0x10800000H, and 0x11000000H, respectively. You can do this  
independently of the current cache mode bit and cache enable bit settings.  
Tag RAM is normally cleared by hardware following a power-on reset. However, if you change the cache or  
memory bank configuration when the cache is being enabled, you will have to clear the Tag RAM area using  
application software.  
NON-CACHEABLE AREA CONTROL BIT  
Although the cache affects the entire system memory, it is sometimes necessary to define non-cacheable areas  
when the consistency of data stored in memory and the cache must be ensured. To support this, the S3C4510B  
provides a non-cacheable area control bit in the address field, ADDR[26].  
If ADDR[26] in the ROM/SRAM, flash memory, DRAM, or external I/O bank's access address is "0", then the  
accessed data is cacheable. If the ADDR[26] value is "1", the accessed data is non-cacheable.  
Cacheable Area  
Non-cacheable Area  
000_0000  
400_0000  
000_0000  
Cacheable Area  
000_FFFF  
401_0000  
401_FFFF  
Non-cacheable  
Area  
16 M word  
002_0000  
3FF_FFFF  
Cacheable Area  
7FF_FFFF  
3FF_FFFF  
NOTE:  
The non-cacheable area has the same space in memory  
as the cacheable area. To access the non-cacheable  
area, you can change the address of the space in memory  
using non-cacheable control bit.  
Figure 5-3. Non-Cacheable Area Control  
NOTE  
A SWAP command must be used within a non-cacheable area.  
5-4  
2
S3C4510B  
I C BUS CONTROLLER  
2
6
I C BUS CONTROLLER  
OVERVIEW  
The S3C4510B's internal IC bus (I2C-bus) controller has the following important features:  
It requires only two bus lines, a serial data line (SDA) and a serial clock line (SCL). When the I2C-bus is free,  
both lines are High level.  
— Each device that is connected to the bus is software-addressable by a single master using a unique address.  
slave relationships on the bus are constant. The bus master can be either a master-transmitter or a master-  
receiver. The I2C bus controller supports only single master mode.  
— It supports 8-bit, bi-directional, serial data transfers.  
— The number of ICs that you can connect to the same I2C-bus is limited only by the maximum bus  
capacitance of 400 pF.  
Figure 6-1 shows a block diagram of the S3C4510B I2C-bus controller  
Data  
Control  
Shift Buffer Register (IICBUF)  
System Clock (fMCK)  
SDA  
SCL  
Serial  
Clock  
Prescaler  
SCL  
Control 0  
16  
Prescaler Register (IICPS)  
0
BUSY COND1 COND0  
ACK  
LRB  
IEN  
BF  
Control Status Register (IICCON)  
Figure 6-1. I2C BUS Block Diagram  
6-1  
2
I C BUS CONTROLLER  
S3C4510B  
FUNCTIONAL DESCRIPTION  
The S3C4510B I2C bus controller is the master of the serial I2C-bus. Using a prescaler register, you can program  
the serial clock frequency that is supplied to the I2C bus controller. The serial clock frequency is calculated as  
follows:  
MCLK / (16 ´ (prescaler register value + 1) + 3)  
To initialize the serial I2C-bus, the programmer sends a start code by writing "01" to bits [5:4]of the control status  
register, IICCON. The bus controller then sends the 7-bit slave address and a read/write control bit through shift  
buffer register. The receiver sends an acknowledge by pulling the SDA line from high to low during a master SCL  
pulse.  
To continue the data write operation, you must set the BF bit in the control status register and then write the data  
to the shift buffer register. Whenever the shift buffer register is read or written, the BF bit is cleared  
automatically. For the consecutive read/write operations, you must set the ACK bit in the control status register.  
For read operations, you can read the data after you have set the BF bit in the control status register. To signal  
the end of the read operation, you can reset the ACK bit to inform the receiver/transmitter when the last byte is to  
be written/read.  
Following a read/write operation, you set IICCON[5:4] to "10" to generate a stop code. If you want to complete  
another data transfer before issuing the Stop code, you can send the start code using the repeat start command  
(with IICCON[5:4] = "11"). When the slave address and read/write control bit have been sent, and when the  
receive acknowledge has been issued to control SCL timing, the data transfer is initiated.  
6-2  
2
S3C4510B  
I C BUS CONTROLLER  
I2C-BUS CONCEPTS  
Basic Operation  
The I2C-bus has two wires, a serial data line (SDL) and a serial clock line (SCL), to carry information between the  
ICs connected to the bus. Each IC is recognized by a unique address and can operate as either a transmitter or  
receiver, depending on the function of the specific ICs.  
The I2C-bus is a multi-master bus. This means that more than one IC which is capable of controlling the bus can  
be connected to it. data transfers proceed as follows:  
Case 1: A master IC wants to send data to another IC (slave):  
1. Master addresses slave  
2. Master sends data to the slave (master is transmitter, slave is receiver)  
3. Master terminates the data transfer  
Case 2: A master IC wants to receive information from another IC (slave):  
1. Master addresses slave  
2. Master receives data from the slave (master is receiver, slave is transmitter)  
3. Master terminates the data transfer  
Even in case 2, the master IC must generate the timing signals and terminate the data transfer.  
If two or more masters try to put information simultaneously onto the bus, the first master to issue a "1" when the  
other issues a "0" will lose the bus arbitration. The clock signals used for arbitration are a synchronized  
combination of the clocks generated by the bus masters using the wired-AND connection to the SCL line.  
The master IC is always responsible for generating the clock signals on the I2C-bus. Bus clock signals from a  
master can only be altered by 1) a slow slave IC which "stretches" the signal by temporarily holding the clock line  
Low, or 2) by another master IC during arbitration.  
General Characteristics  
Both SDA and SCL are bi-directional lines which are connected to a positive supply voltage through a pull-up  
resistor.  
When the I2C-bus is free, the SDA and SCL lines are both high level. The output stages of I2C interfaces  
connected to the bus have an open-drain or open-collector to perform the wired-AND function. Data on the I2C-  
bus can be transferred at a rate up to 100 Kbits/s. The number of interfaces that can be connected to the bus is  
solely dependent on the limiting bus capacitance of 400 pF.  
Bit Transfers  
Due to the variety of different ICs (CMOS, NMOS, and I2L, for example) which can be connected to the I2C-bus,  
the levels of logic zero (low) and logic one (high) are not fixed and depend on the associated level of VDD. One  
clock pulse is generated for each data bit that is transferred.  
6-3  
2
I C BUS CONTROLLER  
S3C4510B  
Data Validity  
The data on the SDA line must be stable during the high period of the clock. The high or low state of the data line  
can only change when clock signal on the SCL line is low.  
Start and Stop Conditions  
Start and stop conditions are always generated by the master. The bus is considered to be busy after the start  
condition is generated. The bus is considered to be free again when a brief time interval has elapsed following  
the Stop condition.  
— Start condition: a High-to-Low transition of the SDA line while SCL is high.  
— Stop condition: a Low-to-High transition of the SDA line while SCL is high.  
SDA  
SCL  
1-7  
8
9
1-7  
DATA  
8
9
1-7  
DATA  
8
9
S
Start  
P
Stop  
Condition  
Address R/W  
ACK  
ACK  
ACK  
Condition  
Figure 6-2. Start and Stop Conditions  
6-4  
2
S3C4510B  
I C BUS CONTROLLER  
DATA TRSANSFER OPERATIONS  
Data Byte Format  
Every data byte that is put on the SDA line must be 8 bits long. The number of bytes that can be transmitted per  
transfer is unlimited. Each byte must be followed by an acknowledge bit. Data is transferred MSB-first.  
If the receiver cannot receive another complete byte of data until it has performed some other function (such as  
servicing an internal interrupt), it can hold the clock line SCL Low to force the transmitter into a wait state. The  
data transfer then continues when the receiver is ready for another byte of data and releases the SCL line.  
Acknowledge Procedure  
Data transfer with acknowledge is obligatory. The acknowledge-related clock pulses must be generated by the  
bus master. The transmitter releases the SDA line (High) during the acknowledge clock pulse.  
The receiver must pull down the SDA line during the acknowledge pulse so that it remains stable low during the  
High period of this clock pulse.  
Usually, a receiver which has been addressed is obliged to generate an acknowledge after each byte is received.  
When a slave receiver does not acknowledge from the slave address, the slave must leave the data line high.  
The master can then generate a stop condition to abort the transfer.  
If a slave receiver acknowledges the slave address, but later in the transfer cannot receive any more data bytes,  
the master must again abort the transfer. This is indicated by the slave not generating the acknowledge on the  
first byte to follow. The slave leaves the data line high and the master generates the stop condition.  
If a master receiver is involved in a transfer, it must signal the end of data to the slave transmitter by not  
generating an acknowledge on the last byte that was clocked out of the slave. The slave transmitter must then  
release the data line to let the master generate the stop condition.  
6-5  
2
I C BUS CONTROLLER  
S3C4510B  
Data Transfer Format  
Data transfers uses the format shown in Figure 6-3. After the start condition has been generated, a 7-bit slave  
address is sent. The eighth bit is a data direction bit (R/W). A "0" direction bit indicates a transmission (Write)  
and a "1" indicates a request for data (Read).  
A data transfer is always terminated by a stop condition which is generated by the master. However, if a master  
still wishes to communicate on the bus, it can generate another start condition and address another slave without  
first generating a stop condition. This feature supports the use of various combinations of read/write formats for  
data transfers.  
Multiple Byte Slave Receiver Format:  
S
Slave address  
W A  
Data 1 (8 bits)  
A
A
Data 2  
Data 2  
A
A
Data M  
Data M  
A P  
A P  
Multiple Byte Slave Transmitter Format:  
Slave address R A Data 1 (8 bits)  
S
NOTE:  
S (Start)  
W (Write; bit value is 0)  
R (Read; bit value is 1)  
P (Stop),  
A (Acknowledge; The ACK is first sent to the slave. Afterwards, the direction  
depends on the data transfer direction. In other words, if the mater reads the data,  
it sends the ACK.)  
Figure 6-3. Data Transfer Format  
6-6  
2
S3C4510B  
I C BUS CONTROLLER  
I2C-Bus Addressing  
The addressing procedure for the I2C-bus is such that the first byte after the start condition determines which  
slave the master will select. Usually, this first byte immediately follows the start procedure.  
An exception is the "general call" address which can address all ICs simultaneously. When this address is used,  
all ICs should, in theory, respond with an acknowledge. However, ICs can also be made to ignore this address.  
The second byte of the general call address then defines the action to be taken.  
Definition of Bits in the First Data Byte  
The first seven bits of the first data byte make up the slave address. The eighth bit is the LSB, or direction bit,  
which determines the direction (R/W) of the message.  
When an address is sent, each IC on the bus compares the first 7 bits received following start condition with its  
own address. If the addresses match, the IC considers itself addressed by the master as a slave receiver or a  
slave transmitter.  
General Call Address  
The general call address can be used to address every IC that connected to the I2C-bus. However, if an IC does  
not need any of the data supplied within the general call structure, it can ignore this address by not  
acknowledging it.  
If an IC does require data from a general call address, it can then acknowledge this address and behave as a  
slave receiver. The second and following bytes will be acknowledged by every slave receiver capable of handling  
this data. A slave which cannot process one of these bytes must ignore it by not acknowledging. The meaning of  
the general call address is always specified in the second byte.  
Start Byte  
Every data transfer is preceded by a start procedure:  
— A start condition, S  
— A start byte, "00000001"  
— An acknowledge (ACK) clock pulse, and  
— A repeated start condition, Sr  
After the start condition (S) has been transmitted by a master which requires bus access, the start byte  
("00000001") is transmitted. Another IC can therefore sample the SDA line at a low sampling rate until one of the  
seven zeros in the start byte is detected. After it detects this low level on the SDA line, the IC can switch to a  
higher sampling rate to find the repeated start condition (Sr) which is then used for synchronization. (A) hardware  
receiver will reset upon receipt of the repeated start condition (Sr) and will therefore ignore the start byte.)  
An acknowledge-related clock pulse is generated after the start byte. This is done only to conform with the byte  
handling format used on the bus. No IC is allowed to acknowledge the start byte.  
6-7  
2
I C BUS CONTROLLER  
S3C4510B  
I2C BUS SPECIAL REGISTERS  
The I2C-bus controller has three special registers: a control status register (IICCON), a prescaler register (IICPS),  
and a shift buffer register (IICBUF).  
Control Status Register (IICCON)  
The control status register for the I2C-bus, IICCON, is described in Table 6-2.  
Table 6-1. Control Status Register (IICCON)  
Register  
Offset Address  
R/W  
Description  
Control status register  
Rest Value  
IICCON  
0xf000  
R/W  
0x00000000  
Table 6-2. IICCON Register Description  
Bit Number  
Bit Name  
Description  
[0]  
Buffer flag (BF)  
The BF bit is set when the buffer is empty in transmit mode or  
when the buffer is full in receive mode. To clear the buffer, you  
write a "0" to this bit. The BF bit is cleared automatically  
whenever the IICBUF register is written or read. If you set BF bit  
to one, the I2C -bus is stopped. To activate I2C-bus, you should  
clear the BF bit to zero.  
[1]  
[2]  
Interrupt enable (IEN)  
Last received bit (LRB)  
Setting the interrupt enable bit to "1" enables the I2C-bus  
interrupt.  
The LRB bit is read only. It holds the value of the last received bit  
over the I2C-bus. Normally, this bit will be the value of the slave  
acknowledgement. To check for slave acknowledgement, you  
test the LRB.  
[3]  
Acknowledge enable  
(ACK)  
The ACK bit is normally set to "1". This causes the I2C-bus  
controller to send an acknowledge automatically after each byte.  
This bit must be "0" when the I2C-bus controller is operating in  
receiver mode and requires no further data to be received from  
the slave transmitter. This causes a negative acknowledge on the  
I2C-bus, which halts further reception from the slave device.  
[5:4]  
[6]  
COND1, COND0  
Bus busy (BUSY)  
These bits control the generation of the start, Stop, and repeat  
Start conditions: "00" = no effect, "01" = start, "10" = stop, and  
"11" = repeat start.  
This bit is a read-only flag that indicates when the I2C-bus is in  
use. A "1" indicates that the bus is busy. This bit is set or cleared  
by a start or stop condition, respectively.  
[7]  
Reset  
If "1" is written to the reset bit, the I2C-bus controller is reset to its  
initial state.  
[31:8]  
Reserved  
Not applicable.  
6-8  
2
S3C4510B  
I C BUS CONTROLLER  
31  
9
8
7
6
5
4
3
2
1
0
R
E
S
E
T
C C  
B
U
S
Y
O O A L  
I
B
F
N N C R E  
D D K B N  
Reserved  
1
0
[0] Buffer Flag (BF)  
0 = Automatically cleared when the IICBUF register is written or read. To  
manually clear the BF, write 0.  
1 = Automatically set when the buffer is empty in transmit mode or when the  
buffer is full in receive mode.  
[1] Interrupt enable (IEN)  
0 = Disable  
1 = Enable; an interrupt is generated if the BF bit is 1.  
[2] Last received bit (LRB)  
Use this read-only status bit to theck for ACK signals from the receiver (slave), or  
to monitor SDA operation of SDA when writing 11 to IICCON [5:4] for repeated  
starts.  
0 = The most recent SDA is low. (ACK is received)  
1 = The most recent SDA is high. (ACK not received)  
[3] Acknowledge enable (ACK)  
Controls generation of an ACK signal in receive mode.  
0 = Do not generate an ACK at 9th SCL (No more received data is required from  
the slave)  
1 = Generate an ACK signal at 9th SCL.  
[5:4] COND 1 and COND 0  
Generate a bus control such as start or stop.  
00 = No effect.  
01 = Generate start condition.  
10 = Generate stop condition.  
11 = SCL will be released to high level to generate repeated start condition.  
[6] Bus busy (BUSY)  
Data transmission is in progress on the IIC-bus.  
0 = Bus is currently not in use. (not busy)  
1 = Bus is in use. (busy)  
[7] Reset  
0 = Normal  
1 = Reset the IIC-bus controller.  
[31:8] Reserved  
Figure 6-4. I2C Control Status Register  
6-9  
2
I C BUS CONTROLLER  
S3C4510B  
Shift Buffer Register (IICBUF)  
The shift buffer register for the I2C-bus described in Table 6-4.  
Table 6-3. IICBUF Register  
R/W Description  
R/W Shift buffer register  
Register  
Offset Address  
Rest Value  
Undefined  
IICBUF  
0xf004  
Table 6-4. IICBUF Register Description  
Description  
Bit Number  
Bit Name  
[7:0]  
Data  
This data field acts as serial shift register and read buffer for  
interfacing to the I2C-bus. All read and write operations to/from the  
I2C-bus are done via this register. The IICBUF register is a  
combination of a shift register and a data buffer. 8-bit parallel data is  
always written to the shift register, and read form the data buffer. I2C-  
bus data is always shifted in or out of the shift register.  
[31:8]  
Reserved  
Not applicable.  
Prescaler Register (IICPS)  
The prescaler register for the I2C-bus is described in Table 6-6.  
Table 6-5. IICPS Register  
R/W Description  
R/W Prescaler register  
Register  
Offset Address  
Rest Value  
IICPS  
0xf008  
0x00000000  
Table 6-6. IICPS Register Description  
Description  
Bit Number  
Bit Name  
This prescaler value is used to generate the serial I2C-bus clock. The  
system clock is divided by (16 x (prescaler value + 1) + 3) to make the  
serial I2C clock. If the prescaler value is zero, the system clock is when  
divided by 19 to make the serial I2C clock.  
[15:0]  
Prescaler value  
[31:16]  
Reserved  
Not applicable.  
6-10  
2
S3C4510B  
I C BUS CONTROLLER  
Prescaler Counter Register (IICCNT)  
The prescaler counter register for the I2C-bus is described in Table 6-8.  
Table 6-7. IICCNT Register  
Register  
Offset Address  
R/W  
Description  
Rest Value  
IICCNT  
0xf00c  
R/W  
Prescaler counter register  
0x00000000  
Table 6-8. IICCNT Register Description  
Description  
Bit Number  
Bit Name  
[15:0]  
Counter value  
This 16-bit value is the value of the prescaler counter. It is read (in test  
mode only) to check the counter’s current value.  
[31:16]  
Reserved  
Not applicable.  
6-11  
2
I C BUS CONTROLLER  
S3C4510B  
NOTES  
6-12  
S3C4510B  
ETHERNET CONTROLLER  
7
ETHERNET CONTROLLER  
OVERVIEW  
The S3C4510B has an ethernet controller which operates at either 100-Mbits or 10-Mbits per second in half-  
duplex or full-duplex mode. In half-duplex mode, the controller supports the IEEE 802.3 carrier sense multiple  
access with collision detection (CSMA/CD) protocol. In full-duplex mode, it supports the IEEE 802.3 MAC control  
layer, including the pause operation for flow control.  
The ethernet controller¢s MAC layer supports both the media independent interface (MII) and the buffered DMA  
interface (BDI). The MAC layer itself consists of the receive and the transmit blocks, a flow control block, a  
content addressable memory (CAM) for storing network addresses, and a number of command, status, and error  
counter registers.  
The MII supplies the transmit and receive clocks of 25 MHz for 100-Mbit/s operation or 2.5 MHz at the 10-Mbit/s  
speed. The MII conforms to the ISO/IEC 802-3 standards for a media-independent layer which separates  
physical layer issues from the MAC layer.  
7-1  
ETHERNET CONTROLLER  
S3C4510B  
Physical  
Layer  
BDMA+SBUS I/F  
MAC  
MAC Tx  
BDMA Tx  
Buffer  
Controller  
Buffer  
Controller  
BDMA Tx  
Buffer  
(64 Words)  
MAC Tx  
Buffer  
(80 bytes)  
8
8
32  
Preamble/  
Jam/Pad/CRC  
Generator  
32  
M
I
I
Bus Arbiter/  
Controller  
MAC Rx  
Buffer  
(16 bytes)  
B
D
I
/
S
y
s
t
e
m
10  
M
b
p
s
MAC Rx  
Buffer  
Controller  
BDMA Rx  
Buffer  
(64 Words)  
32  
M
D
I
32  
32  
BDMA Rx  
Buffer  
Controller  
Address  
CAM Interface  
and Comparator  
7
-
W
i
B
u
s
Flow  
Controller  
CAM Contents  
Memory  
(32-Words)  
32  
r
CRC  
e
Checker  
BDMA Control  
and Status  
Register  
MAC Control  
and Status  
Register  
Station  
Manager  
Figure 7-1. Ethernet System Flow Control  
7-2  
S3C4510B  
ETHERNET CONTROLLER  
FEATURES AND BENEFITS  
The most important features and benefits of the S3C4510B ethernet controller are as follows:  
— Cost-effective connection to an external RIC/Ethernet backbone  
— Buffered DMA (BDMA) engine using burst mode  
— BDMA Tx/Rx buffers (256 bytes/256 bytes)  
— MAC Tx/Rx FIFOs (80 bytes/16 bytes) to support re-transmit after collision without DMA request and to  
handle DMA latency  
— Data alignment logic  
— Endian translation  
— Support for old and new media (compatible with existing 10-Mbit/s networks)  
— 100-Mbit/s or 10-Mbits/s operation to increase price/performance options and to support phased conversions  
— Full IEEE 802.3 compatibility for existing applications  
— Media Independent interface (MII) or 7-wire interface  
— Station management (STA) signaling for external physical layer configuration and link negotiation  
— On-chip CAM (21 addresses)  
— Full-duplex mode for doubled bandwidth  
— Pause operation hardware support for full-duplex flow control  
— Long packet mode for specialized environments  
— Short packet mode for fast testing  
— PAD generation for ease of processing and reduced processing time  
7-3  
ETHERNET CONTROLLER  
S3C4510B  
MAC FUNCTION BLOCKS  
The major function blocks of the ethernet controller¢s MAC layer are described in Table 7-1 and Figure 7-1.  
Table 7-1. MAC Function Block Descriptions  
Function Block  
Description  
Media Independent  
Interface (MII)  
The interface between the physical layer and the transmit and receive blocks.  
Transmit block  
Moves the outgoing data from the transmit buffer to the MII. The transmit block  
includes circuits for generating the CRC, checking parity, and generating  
preamble or jam. The transmit block also has timers for back-off after collision  
and for the interframe gap the follows a transmission.  
Receive block  
Accepts incoming data from the MII and stores it in the receive FIFO. The  
receive block has logic for computing and checking the CRC value, generating  
parity for data from the MII, and checking minimum and maximum packet  
lengths. The receive block also has a content addressable memory (CAM) block  
which provides for address lookup, and for acceptance or rejection for packets  
based on their destination address.  
Flow control block  
Recognizes MAC control packets and supports the pause operation for full-duplex  
links. The flow control block also supports generation of pause packets, and  
provides timers and counters for pause control.  
MAC control (command)  
and status registers  
Controls programmable options, including the enabling or disabling of signals  
which notify the system when conditions occur. The status registers hold  
information for error handling software, and the error counters accumulate  
statistical information for network management software.  
Loop-back circuit  
Provides for MAC-layer testing in isolation from the MII and physical layer.  
7-4  
S3C4510B  
ETHERNET CONTROLLER  
Transmit Block  
MAC  
Transmit  
FIFO  
Tx_DB[7:9]  
10  
M
b
/
s
Preamble and  
Jam Generator  
TxD_10  
(80 bytes)  
Pad and CRC  
Generator  
Backoff  
and  
Intergap  
Timer  
RxD_10  
I/F  
MAC  
Loop-back  
Parity Check  
TxD[3:0]  
B
D
I
Flow Control  
Rx_DB[7:0]  
MAC  
M
I
I
Receive  
FIFO  
(16 bytes)  
Parity  
Generator  
RxD[3:0]  
CRC and  
CAM Filter  
MDC  
Receive Block  
MII Station  
Manager  
MDIO  
MAC Control and  
Status Register  
Figure 7-2. MAC Layer Flow Control Function Blocks  
7-5  
ETHERNET CONTROLLER  
S3C4510B  
MEDIA INDEPENDENT INTERFACE (MII)  
Transmit and receive blocks both operate using the MII, which was developed by the IEEE802.3 task force on  
100-Mbit/s ethernet. This interface has the following characteristics:  
— Media independence  
— Multi-vendor points of interoperability  
— Supports connection of MAC layer and physical layer entity (PHY) devices  
— Capable of supporting both 100-Mbit/s and 10-Mbit/s data rates  
— Data and delimiters are synchronous to clock references  
— Provides independent 4-bit wide transmit and receive data paths  
— Uses TTL signal levels that are compatible with common digital CMOS ASIC processes  
— Supports connection of PHY layer and station management (STA) devices  
— Provides a simple management interface  
— Capable of driving a limited length of shielded cable  
PHYSICAL LAYER ENTITY (PHY)  
The physical layer entity, or PHY, performs all of the decoding/encoding on incoming and outgoing data. The  
manner of decoding and encoding (Manchester for 10BASE-T, 4B/5B for 100BASE-X, or 8B/6T for 100BASE-T4)  
does not affect the MII. The MII provides the raw data it receives, starting with the preamble and ending with the  
CRC. The MII expects raw data for transmission, also starting with the preamble and ending with the CRC. The  
MAC layer also generates jam data and transmits it to the PHY.  
BUFFERED DMA INTERFACE (BDI)  
The buffered DMA interface (BDI) supports read and write operations across the system bus. Two eight-bit buses  
transfer data with optional parity checking. The system interface initiates data transfers. The MAC-layer controller  
responds with a ready signal to accept data for transmission, or to deliver data which has been received. An end-  
of-frame signal indicates the boundary between packets.  
7-6  
S3C4510B  
ETHERNET CONTROLLER  
THE MAC TRANSMIT BLOCK  
The MAC transmit block is responsible for transmitting data. It complies with the IEEE802.3 standard for carrier  
sense multiple access with collision detection (CSMA/CD) protocol. The MAC transmit block consists of the  
following sections:  
— Transmit FIFO and controllers  
— Preamble and jam generators  
— Pad generator  
— Parallel CRC generator  
— Threshold logic and counters  
— Back-off and retransmit timers  
— Transmit state machine  
Figure 7-3 shows the MAC transmit function blocks in detail.  
Parity  
Check  
Preamble and  
Tx_DB [7:0]  
JAM generator  
MAC  
and PARITY  
M
I
I
Transmit  
FIFO  
(80 x 9)  
9
TxD [3:0]  
9
8
a
n
d
PAD  
Generator  
Tx_CLK  
CrS  
CRC  
Generator  
Tx_EOF  
Tx_wr#  
Tx_rdy  
B
D
I
Write FIFO  
Controller  
and Counter  
10  
M
b
y
t
Tx_er  
Tx_en  
Read FIFO  
Controller  
and Counter  
Transmit  
State  
Matchine  
e
Col  
Threshold  
Logic and  
Counters  
I/F  
Back off and  
Retransmit  
Timers  
SYS_CLK Domain  
Tx_CLK Domain  
Figure 7-3. MAC Transmit Function Blocks  
7-7  
ETHERNET CONTROLLER  
S3C4510B  
Transmit FIFO and Read/Write Controllers  
The transmit FIFO has an 80-byte depth. An extra bit is associated with each data byte for parity checking. This  
80-byte by 9-bit size allows the first 64 bytes of a data packet to be stored and retransmitted, without further  
system involvement, in case of a collision. If no collision occurs and transmission is underway, the additional 16  
bytes handle system latency and avoid FIFO under-run.  
When the system interface has set the transmit enable bit in the appropriate control register, the transmit state  
machine requests data from the BDI. The system controller then fetches data from the system memory.  
The FIFO controller stores data in the transmit FIFO until the threshold for transmit data is satisfied. The FIFO  
controller passes a handshaking signal to the transmit state machine, indicating that sufficient data is in the FIFO  
to start the transmit operation. If the FIFO is not full, the FIFO controller issues a request to the BDI for more  
data. The transmit state machine continues transmitting data until it detects the end-of-frame signal, which  
signals the last byte. It then appends the calculated CRC to the end of the data (unless the CRC truncate bit in  
the transmit control register is set). The packet transmit bit in the status register is set, generating an interrupt if it  
is enabled.  
The FIFO counters in this block (the Write counter) and the transmit FIFO counter of the transmit state machine  
(the Read counter) co-ordinate their functions based on each other's count value, although they do have different  
clock sources.  
The FIFO controller stores parity bits with the data in the FIFO. It checks for parity and can halt transmission  
after reading the data out of the FIFO and sending it for the CRC calculation. If a parity error occurs, the FIFO  
controller sets an error status bit, generating an interrupt if it is enabled.  
Preamble and Jam Generator  
As soon as the transmit enable bit in the control register is set and there are eight bytes of data in the FIFO, the  
transmit state machine starts the transmission by asserting the Tx_en signal and transmitting the preamble and  
the start frame delimiter (SFD). In case there is a collision, it transmits a 32-bit string of "1s" after the preamble  
as a jam pattern.  
PAD Generator  
If a short data packet is transmitted, the MAC will normally generate pad bytes to extend the packet to a  
minimum of 64 bytes. The pad bytes consist entirely of "0" bits. A control bit is also used to suppress the  
generation of pad bytes.  
Parallel CRC Generator  
The CRC generation of the outgoing data starts from the destination address and continues through the data  
field. You can suppress CRC generation by setting the appropriate bit in the transmit control register. This is  
useful in testing, for example, to force the transmission of a bad CRC in order to test error detection in the  
receiver. It can also be useful in certain bridge or switch applications, where end-to-end CRC checking is desired.  
7-8  
S3C4510B  
ETHERNET CONTROLLER  
Threshold Logic and Counters  
The transmit state machine uses a counter and logic to control the threshold of when transmission can begin.  
before it attempts to initiate transmission, the MAC waits until eight bytes or a complete packet has been placed  
in the transmit FIFO. This gives the DMA engine some latency without causing an underflow during transmission.  
Back-Off and Retransmit Timers  
When a collision is detected on the network, the transmitter block stops the transmission and starts a jamming  
pattern to ensure that all the nodes detect the collision. After this, the transmitter waits for a minimum of 96 bit  
times and then retransmits the data. After 16 attempts, the transmit state machine sets an error bit and  
generates an interrupt, if enabled, to signify the failure to transmit a packet due to excessive collisions. It flushes  
the FIFO, and the MAC is ready for the next packet.  
Transmit Data Parity Checker  
Data in the FIFO is odd-parity protected. When data is read for transmission, the transmit state machine checks  
the parity. If a parity error is detected, the transmit data parity checker does the following:  
— It stops transmission.  
— It sets the parity error bit in the transmit status register.  
— It generates an interrupt, if enabled.  
Transmit State Machine  
The transmit state machine is the central control logic for the transmit block. It controls the passing of signals, the  
timers, and the posting of errors in the status registers.  
7-9  
ETHERNET CONTROLLER  
S3C4510B  
THE MAC RECEIVE BLOCK  
The MAC receive block is responsible for receiving data. It complies with the IEEE802.3 standard for carrier  
sense multiple access with collision detection (CSMA/CD) protocol.  
After it receives a packet, the receive block checks for a number of error conditions: CRC errors, alignment  
errors, and length errors. Several of these checks can be disabled by setting bits in the appropriate control  
registers. depending on the CAM status, the destination address and the receive block may reject an otherwise  
acceptable packet. The MAC receive block consists of the following units:  
— Receive FIFO, FIFO controller, and counters  
— Receive BDI state machine  
— Threshold logic and counters  
— CAM block for address recognition  
— Parallel CRC checker  
— Receive state machine  
The main components of the receive block are shown in Figure 7-4.  
Rx_DB [7:0]  
and parity  
RxD[3:0]  
Rx_clk  
MAC Receive  
FIFO  
9
(16X10)  
Parity  
Check  
SFD  
Detect  
CAM  
Checker  
Read  
address  
Write address  
/WE  
CRC  
Checker  
Rx_DV  
Rx_er  
Receive  
State  
Machine  
Write FIFO  
controller  
and counter  
Write FIFO  
controller  
and counter  
Rx_rd  
Rx_rdy  
Receive  
BDI state  
Machine  
Rx_EOF  
Thershold  
logic and  
counter  
Rx_keep  
Rx_toss  
Rx_load  
CAM_hit#  
SYS_CLK Domain  
Rx_CLK Domain  
Figure 7-4. MAC Receive Function Blocks  
7-10  
S3C4510B  
ETHERNET CONTROLLER  
Receive FIFO Controller  
The receive FIFO controller accepts data one byte at a time. Parity starts with the destination address. The  
receive controller updates the counter with the number of bytes received. As the FIFO stores the data, the CAM  
block checks the destination address against its stored address. If the CAM recognizes the address, the FIFO  
continues receiving the packet. If the CAM block does not recognize the address and rejects the packet, the  
receive block discards the packet and flushes the FIFO.  
Address CAM and Address Recognition  
The CAM block provides direct comparison address recognition. The CAM compares the destination address of  
the received packet to stored addresses. If it finds a match, the receive state machine continues to receive the  
packet. The CAM is organized to hold six-byte address entries. With its 32-word size, the CAM can store 21  
address entries.  
CAM address entries 0, 1, and 18 are used to send the pause control packet. To send a pause control packet,  
you must write the destination address to CAM0, the source address to CAM1, and length/type, op-code, and  
operand to the CAM18 entry. You must them write the MAC transmit control register to set the send pause  
control bit. In addition, CAM19 and CAM20 can be used to construct a user-define control frame.  
Parallel CRC Checker  
The receive block computes a CRC across the data and the transmitted CRC, and then checks that the resulting  
syndrome is valid. A parallel CRC checking scheme handles data arriving in 4-bit nibbles at 100 Mbps. To  
support full-duplex operation, the receive and transmit blocks have independent CRC circuits.  
Receive State Machine  
In MII mode, the receive block receives data from the MII on the RxD[3:0] lines. This data is synchronized to  
Rx_clk at 25 MHz or 2.5 MHz. In 7-wire mode, and at 10 MHz, data is received on the RxD_10 line only.  
After it detects the preamble and SFD, the receive state machine arranges data in byte configurations, generates  
parity, and stores the result in the receive FIFO one byte at a time. If the CAM block accepts the destination  
address, the receive FIFO stores the rest of the packet. At the end of the reception, the receive block marks the  
packet received by setting the appropriate bits in the receive status register. Any error in reception will reset the  
FIFO and the state machine will wait for the end of the current packet. It will then idle while it is waiting for the  
next preamble and SFD.  
BDMA Interface Receive State Machine  
The BDMA I/F receive state machine issues the Rx_rdy signal to request that the receive FIFO have data  
whenever data is present in the receive FIFO. The last byte of the packet is signaled by asserting the Rx_EOF.  
In case there are any errors during the reception, or if there is a CRC error at the end, the BDMA I/F receive  
state machine asserts the Rx_toss signal to indicate that the received packet should be discarded.  
7-11  
ETHERNET CONTROLLER  
S3C4510B  
FLOW CONTROL BLOCK  
The flow control block provides for the following functions:  
— Recognition of MAC control frames received by the receive block  
— Transmission of MAC control frames, even if transmitter is paused  
— Timers and counters for pause operation  
— Command and status register (CSR) interface  
— Options for passing MAC control frames through to software drivers  
The receive logic in the flow control block recognizes a MAC control frame as follows:  
— The length/type field must have the special value specified for MAC control frames. The destination address  
must be recognized by the CAM. The frame length must be 64 bytes, including CRC. The CRC must be  
valid, and the frame must contain a valid pause op-code and operation.  
— If the length/type field does not have the special value specified for MAC control frames, the MAC takes no  
action, and the packet is treated as a normal packet. If the CAM does not recognize the destination address,  
the MAC rejects the packet. If the packet length is not 64 bytes, including CRC, the MAC does not perform  
the operation. The packet is then marked as a MAC control packet, and is passed forward to the software  
drivers, if pass-through is enabled.  
You can set control bits in the transmit status register to generate a Full-Duplex pause operation or other MAC  
control functions, even if the transmitter itself is paused. Two timers and two corresponding CSR registers are  
used during a pause operation. One timer/register pair is used when a received packet causes the transmitter to  
pause. The other pair is used to approximate the pause status of the other end of the link, after the transmitter  
sends a Pause command.  
The command and status register (CSR) interface provides control and status bits within the transmit and receive  
control registers and status registers. These lets you initiate the sending of a MAC control frame, enable and  
disable MAC control functions, and read the values of the flow control counters.  
Control bits are provided for processing MAC control frames entirely within the controller, or for passing MAC  
control frames on to the software drivers. This lets you enable flow control by default even on software drivers  
which are not otherwise "flow control aware".  
7-12  
S3C4510B  
ETHERNET CONTROLLER  
BUFFERED DMA INTERFACE  
BUFFERED DMA (BDMA) CONTROL BLOCKS  
The BDMA engine controls a transmit buffer and a receive buffer. The BDMA transmit buffer holds data and  
status information for packets being transmitted. The BDMA receive buffer holds data and status information for  
packets being received. Each FIFO has a control block which controls data being placed in, and removed from,  
the buffers.  
Half_full  
Half_empty  
SD [31:0]  
nREQ_Tx  
Rx Bus  
Tx_clk  
Tx_wr  
BDMA  
Tx  
Buffer  
(32 x 64)  
HEAD Ptr  
TAIL Ptr  
SD[31:0]  
nACK  
Tx  
Control  
Machine  
-
Request  
BUS  
Arbiter  
Tx_rdy  
S
Y
S
T
E
M
B
D
I
Half_full  
Tx_Underflow  
nREQ_Rx  
nREQ  
Tx_DB[7:0]  
Tx widget  
Big/little  
Word-to-Byte  
Converter  
B
D
M
A
SA[25:0]  
Data Swapper  
Big/Little  
Address  
Generator  
B
U
S
BDMA  
Rx  
Buffer  
(33 x 64)  
HEAD Ptr  
TAIL Ptr  
Rx_clk  
Rx_rd  
Rx Bus  
Request  
-
I/F  
Rx  
Control  
Machine  
Target Address  
for Rx  
I/F  
Rx_rdy  
RX_over flow  
Half_empty  
Rx_DB[7:0]  
Byte-to-Word  
Converter  
Source Address  
for Tx  
Rx_Widget  
Figure 7-5. BDMA Control Blocks  
7-13  
ETHERNET CONTROLLER  
The Bus Arbiter  
S3C4510B  
The bus arbiter decides which of the BDMA buffer controllers, transmit (Tx) or receive (Rx), has the highest  
priority for accessing the system bus. The prioritization is dynamic. The BDMA arbiter outputs a bus request  
signal (nREQ) to the system manager when  
— A buffer contains more words than the Rx burst size,  
— An EOF (End of Frame) was saved to the buffer, or  
— A buffer contains more free space than the Tx burst size.  
After it receives a bus acknowledge signal (nACK) from the system manager, the BDMA bus arbiter determines  
the correct bus access priority. If nREQ_Tx and nREQ_Rx were requested simultaneously, the bus arbiter  
decodes the nACK signal using the following method:  
switch (Half_empty, Half_full)  
{ case 2'b01: nACK_Rx ¬ nACK  
case 2'b10: nACK_Tx ¬ nACK  
default: //case 2'b00 or 2'b11:  
if (Rx buffsize (Head - Tail) < Tx buffsize) // Rx more urgent  
nACK_Rx ¬ nACK  
else nACK_Tx ¬ nACK}  
7-14  
S3C4510B  
ETHERNET CONTROLLER  
BDMA Bus Control Logic  
The function blocks of the BDMA controller provide logic for controlling bus master read and write operations  
across the system bus. This control logic supports the following operations:  
— Burst size control, to optimize system bus utilization.  
— Transmit threshold control (based on 1/8 of transmit buffer size) to match transmission latency to system bus  
latency.  
— Little-Endian byte swapping, to support the data transfer of Little-Endian memory usage for frame data.  
— A transmit/receive alignment widget to circumvent word alignment restrictions.  
In systems with an ATM LAN emulation or an MPOA interface, and in certain other systems as well, the  
beginning of a packet should be placed on a byte or half-word boundary. You may not, however misalign the  
BDMA transfer, as this would complicate the design of the DMA, and would degrade performance. To avoid this,  
you can use an alignment widget between the BDMA buffer (word) and the MAC FIFO (byte).  
In the receiver, the BDMA bus control logic inserts a programmable number of bytes (up to three) into the  
received data stream while the preamble is being received. This adds some padding to the beginning of the  
frame. This padding can then be used to solve alignment problems downstream, without having to use a copy of  
the buffer. Because there is never more than three bytes, this feature does not degrade performance. Also,  
because the data is inserted prior to the concatenation of bytes into words, it does not misalign the subsequent  
DMA transfer.  
The length of the alignment data is read from a control register. This length value should be set by software  
immediately after the MAC module is reset, and it should not be modified.  
You can use a corresponding transmit alignment widget to remove data from the buffer. In the simplest  
implementation, the widget discards the first "n" bytes (up to three), where "n" is the value read from the transmit  
frame descriptor which configures the transmit alignment widget.  
MEMORY DATA STRUCTURES  
The flow control 100-/10-Mbit/s ethernet controller uses three data structures to exchange control information and  
data:  
— Transmit frame descriptor  
— Receive frame descriptor  
— Frame data buffer  
Each frame descriptor has the following elements:  
— Frame start address  
— Ownership bit  
— Control field for transmitter  
— Status field  
— Frame length  
— Next frame descriptor pointer  
Figure 7-6 shows data structures of the transmit and receive frame descriptors.  
7-15  
ETHERNET CONTROLLER  
S3C4510B  
DATA FRAMES  
The ownership bit in the MSB of the frame start address controls the owner of the descriptor. When the  
ownership bit is "1", the BDMA controller owns the descriptor. When this bit is "0", the CPU owns the descriptor.  
The owner of the descriptor always owns the associated data frame. (The descriptor's frame start address field  
always points to this frame.)  
As it receives the data frame, software sets the maximum frame size register in the BDMA block to the system  
frame buffer size (typically, to 1536 or 2048). Software also sets the Rx frame descriptor start address register to  
point to a chain of frame descriptors, all of which have their ownership bit set.  
The BDMA engine can then be started to set the BDMA receive enable bit in the BDMARXCON register. When a  
frame is received, it is copied into memory at the address specified by the Rx frame start address. Please note  
that no configurable offset or page boundary calculation is required. The received frame is written into the frame  
data buffer until the end of frame is reached, or until the length exceeds the configured maximum frame size.  
If the entire frame is received successfully, the status bits in the frame descriptor are set to indicate this.  
Otherwise, the status bits are set to indicate that an error occurred. The ownership bit in the frame start address  
field is cleared and an interrupt may now be generated. The BDMA controller copies the next frame descriptor  
register value into the Rx frame descriptor start address register. If the next frame descriptor address is null (0),  
the BDMA simply halts, and all subsequent frames are dropped. Otherwise, the descriptor is read in, and the  
BDMA controller starts again with the next frame, as described in the previous paragraph.  
If the received frame size exceeds the maximum frame size, the data frame will be overwritten by the last word  
of maximum frame. The overflow data is written to the Rx status bit [19] in the receive frame descriptor. When  
the BDMA reads a descriptor, if the ownership bit is not set, it has two options:  
— Skip to the next frame descriptor, or  
— Generate an interrupt and halt the BDMA operation.  
Transmit frame descriptors contain the following components:  
— A four-byte pointer to the frame data  
— Widget alignment control bits [6:5]  
— Frame data pointer increment/decrement bit [4]  
— Little-Endian control bit [3]  
— Interrupt enable after transmit [2]  
— No-CRC [1], and  
— No-padding [0]  
During transmission, the two-byte frame length at the Tx frame descriptor is moved into the BDMA internal Tx  
register. After transmission, Tx status is saved in the Tx frame descriptor. The BDMA controller then updates the  
next frame descriptor address register for the linked list structure.  
When the Tx frame descriptor start address register points to the first frame buffer, transmitter starts transmitting  
the frame data into the frame buffer memory.  
7-16  
S3C4510B  
ETHERNET CONTROLLER  
31 30  
16 15  
0
O
Frame Data Pointer  
Reserved  
Rx Status  
Frame Length  
Next Frame Descriptor Pointer  
[31] Ownership bit (O)  
0 = CPU  
1 = BDMA  
[30:0] Frame Data Pointer  
Address of the frame data to be saved.  
[15:0] Frame Length  
The size of the received frame.  
[31:16] Rx Status  
The Rx status field of the receive frame is updated by the MAC after reception is  
complete.  
[31:0] Next frame descriptor pointer  
Address of next frame descriptor.  
Figure 7-6. Data Structure of Rx Frame Descriptor  
7-17  
ETHERNET CONTROLLER  
S3C4510B  
31 30  
16 15  
7 6  
5 4  
3
2
1
0
O
Frame Data Pointer  
Reserved  
WA A L  
Frame Length  
T
C P  
Tx Status  
Next Frame Descriptor Pointer  
[0] No-padding mode (P)  
0 = Padding mode 1 = No-padding mode  
[1] No-CRC mode (C)  
0 = CRC mode  
1 = No-CRC mode  
[2] MAC transmit interrupt enable after transmission of this frame (T)  
0 = Disable 1 = Enable  
[3] Little-Endian mode (L)  
0 = Big-endian  
1 = Little-endian  
[4] Frame data pointer increment/decrement (A)  
0 = Decrement  
1 = Increment  
[6:5] Widget alignment control (WA)  
(Non-aligned data must be transmitted without alignment control.)  
00 = No invalid bytes  
10 = Two invalid bytes  
01 = One invalid byte  
11 = Three invalid bytes  
[31] Ownership bit (0)  
0 = CPU  
1 = BDMA  
[30:0] Frame data pointer  
The address of the frame data to be transmitted.  
[15:0] Frame length  
The size of the transmit frame.  
[31:16] Tx status  
This Tx frame status field is updated by the MAC after transmission.  
[31:0] Next frame descriptor pointer  
The address of the next frame descriptor.  
Figure 7-7. Data Structure of Tx Frame Descriptor  
7-18  
S3C4510B  
ETHERNET CONTROLLER  
Rx Status  
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16  
R
x
H G  
a
l
t
e
d
O
v
e
r
f
l
A R  
L
o
n
g
E
r
C
R
l
i
x
1
0
S
t
C
t
i
R
c
v
R
x
p
a
r
I
n
t
R
x
O
v
o
o
d
C g  
0
0
M 0 0 0  
a
x
E
r
r
n
E
r
o
w
a
t
r
r
[19] Over maximum size (OvMax)  
Set if the received frame data size exceeds the maximum frame size.  
[21] Control received (CtlRcv)  
Set if the received packet is a MAC control frame.  
[22] Interrupt on receive (IntRx)  
Set if reception of packet caused an interrupt condition. This includes Good  
received, if the Engood bit, MACRXCON [14], is set.  
[23] Receive 10 Mb/s status (Rx10stat)  
Set if packet was received over the 7-wire interface. Reset if packet was received  
over the MII.  
[24] Alignment error (AlignErr)  
Frame length in bits was not a multiple of eight and the CRC was invalid.  
[25] CRC Error (CRCErr)  
CRC at end of packet did not match the computed value, or else the PHY  
asserted Rx_er during packet reception.  
[26] Overflow error (Overflow)  
The MAC receive FIFO was full when it needed to store a received byte.  
[27] Long error (LongErr)  
Received a frame longer than 1518 bytes. Not set if the long enable bit set to one  
in the receive control register.  
[29] Receive parity error (RxPar)  
MAC receive FIFO has detected a parity error.  
[30] Good received (Good)  
Successfully received a packet with no errors. If EnGood = 1, an interrupt is  
generated on each packet that is received successfully.  
[31] Reception halted (RxHalted)  
Reception interrupted by user clearing RxEN or setting Haltlmm in the MAC  
control register.  
Figure 7-8. Rx Descriptor Status Bits  
7-19  
ETHERNET CONTROLLER  
S3C4510B  
Tx Status  
31 30 29 28 27 26 25 24 23 22 21 20 19  
16  
R
x
H C  
a
l
t
e
d
L
a
t
e
C
o
l
T
x
D
e
f
P
a
u
s
e
d
E
x
C
o
l
T
x
p
a
r
S N D U  
I
n
t
T
x
Q C e  
n
d
e
r
o
m
p
E
r
r
a
r
r
f
e
r
TxCollCnt  
e
r
l
l
[19:16] Transmit collision count (TxCollCnt)  
Count of collisions during transmission of a single packet. After 16 collisions, TxColl  
is zero, and ExColl is set.  
[20] Excessive collision (ExColl)  
16 collisions occured in the same packet.  
[21] Transmit deferred (TxDefer)  
[22] Paused  
[23] Interrupt on transmit (IntTx)  
Set if transmission of packet caused an interrupt condition. This includes the enable  
completion (EnComp), MACTXCON [14], if enabled.  
[24] Underrun (Under)  
MAC transmit FIFO becomes empty during transmission.  
[25] Deferral (Defer)  
MAC defers for max_deferral 0.32768ms for 100Mbit/s or 3.27680ms for 10Mbit/s.  
[26] No carrier (NCarr)  
Carrier sense is not detected during the entire transmission of a packet  
(from the SFD to the CRC).  
[27] SQE error (SQErr)  
After transmit frame, set if the fake collision (COL) signal did not come from the PHY  
for 1.6 ms.  
[28] Late collision (LateColl)  
A collision occurred after 512 bit times (64 byte times)  
[29] Transmit parity error (TxPar)  
MAC transmit FIFO detected a parity error.  
[30] Completion (Comp)  
MAC complete a transmit or discard of one packet.  
[31] Transmission halted (TxHalted)  
Transmission halted by clearing RxEn or setting the Haltlmm in the MAC control  
register. Or, an interrupt was generated by an error condition (not completion).  
Figure 7-9. Tx Descriptor Status Bits  
7-20  
S3C4510B  
ETHERNET CONTROLLER  
Frame  
Descriptor  
Start Address  
Register  
Frame Data Pointer #1  
Receive Frame  
Maximum Size  
Register  
Frame Data #1  
Unused  
Status Frame Length  
Next Frame Descriptor  
(BDMARXLSZ)  
Frame Data Pointer #2  
Frame Data #2  
Unused  
BDMARXLSZ  
BDMARXLSZ  
Status Frame Length  
Next Frame Descriptor  
(For Ring Type  
Linked List)  
Frame Data #N  
Frame Data Pointer #N  
Memory for Frame Buffer  
Status Frame Length  
Next Frame Descriptor  
In single linked lists, the last next frame  
descriptor is filled with a Null address  
Figure 7-10. Data Structure of the Receive Frame Data Buffer  
7-21  
ETHERNET CONTROLLER  
S3C4510B  
ETHERNET CONTROLLER SPECIAL REGISTERS  
The special registers used by the S3C4510B ethernet controller are divided into two main groups:  
— BDMA control and status registers  
— MAC control and status registers  
BDMA CONTROL AND STATUS REGISTERS  
All registers that contain a memory address must store the address in a word-aligned format.  
Table 7-2. BDMA Control and Status Registers  
Registers  
BDMATXCON  
BDMARXCON  
BDMATXPTR  
BDMARXPTR  
BDMARXLSZ  
BDMASTAT  
CAM  
Offset  
0x9000  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
W
Description  
Reset Value  
Buffered DMA transmit control register  
Buffered DMA receive control register  
Transmit frame descriptor start address  
Receive frame descriptor start address  
Receive frame maximum size  
Buffered DMA status  
0x00000000  
0x00000000  
0xFFFFFFFF  
0xFFFFFFFF  
Undefined  
0x9004  
0x9008  
0x900C  
0x9010  
0x9014  
0x00000000  
Undefined  
0x9100–0x917C  
0x9200–0x92FC  
CAM content (32 words)  
BDMATXBUF  
(1)  
R/W  
BDMA transmit (Tx) buffer (64 words)  
for test mode addressing only  
Undefined  
BDMARXBUF  
(1)  
0x9800–0x98FC  
0x9900–0x99FC  
R/W  
BDMA receive (Rx) buffer (64 words)  
for test mode addressing only  
Undefined  
NOTES:  
1. For testing, you can read the BDMA Tx/Rx buffer directly. The BDMA receive buffer has a 64 word by 33 bit size.  
The highest bit, [32], indicates the data frame boundary, as shown in the following illustration:  
32 31  
0
0x9800  
0x98FC  
0x9900  
0x99FC  
EOF (End of Frame); Boundary of frame data.  
Figure 7-11. End of Frame Bit  
2. You can access the EOF bit by reading the address range, 0x9800-0x98FC (read into LSB bit 0).  
7-22  
S3C4510B  
ETHERNET CONTROLLER  
Buffered DMA Transmit Control Register  
The buffered DMA transmit control register, BDMATXCON, is described in Tables 7-3 and 7-4 below.  
Table 7-3. BDMATXCON Register  
Registers  
Offset  
R/W  
Description  
Reset Value  
BDMATXCON  
0x9000  
R/W  
Buffered DMA transmit control register  
0x00000000  
Table 7-4. BDMA Transmit Control Register Description  
Bit Number  
Bit Name  
Description  
[4:0]  
BDMA Tx burst size  
(BTxBRST)  
(Word size + 1) of data bursts requested in BDMA mode.  
If the BTxBRST is zero, the burst size is one word.  
If the BTxBRST is 31, the burst size is 32 words.  
[5]  
BDMA Tx stop/skip frame by  
owner bit (BTxSTSKO)  
This bit determines whether the BDMA Tx controller issues an  
interrupt, if enabled, or skips the current frame and goes to the  
next frame descriptor (assuming BDMA is not the owner).  
[6]  
[7]  
Reserved  
Not applicable.  
BDMA Tx complete to send  
Setting this bit enables the BDMA Tx complete to send contol  
control packet interrupt enable packet interrupt when the MAC has finished sending the  
(BTxCCPIE)  
control packet.  
[8]  
[9]  
BDMA Tx Null list interrupt  
enable (BTxNLIE)  
This bit enables the BDMA Tx Null list interrupt which indicates  
that the transmit frame descriptor start address pointer,  
BDMATXPTR, in the BDMA Tx block has a null (0x00000000)  
address.  
BDMA Tx not owner interrupt This bit enables the BDMA Tx not owner interrupt when the  
enable (BTxNOIE)  
ownership bit of the current frame does not belong to the  
BDMA controller, and if the BTxSTSKO bit is set.  
[10]  
BDMA Tx buffer empty  
Set this bit is "1" to enable the Tx buffer empty interrupt.  
interrupt enable (BTxEmpty)  
[13:11]  
BDMA transmit to MAC Tx  
start level (BTxMSL)  
These bits determine when the new frame data in BDMA Tx  
buffer can be moved to the MAC Tx FIFO when a new frame  
arrives.  
000 means no wait, 001 means wait to fill 1/8 of the BDMA Tx  
buffer, 010 means wait to fill 2/8 of the buffer, 011 for 3/8 and  
1xx for 4/8.  
NOTE: If the last data of the frame arrives in BDMA Tx buffer,  
the data transfer from the BDMA Tx buffer to the MAC Tx  
FIFO starts immediately, regardless of the level of these bits.  
7-23  
ETHERNET CONTROLLER  
S3C4510B  
Table 7-4. BDMA Transmit Control Register Description (Continued)  
Bit Number  
Bit Name  
Description  
[14]  
BDMA Tx enable (BTxEn)  
When the Tx enable bit is set to "1", the BDMA Tx block is  
enabled. Even if this bit is disabled, buffer data will be moved  
to the MAC Tx FIFO until the BDMA Tx buffer underflows (as  
long as the FIFO is not empty and the MAC Tx is enabled).  
This bit is automatically disabled in the following cases: 1) if  
the next frame pointer is null, or 2) if the owner bit is zero, and  
the BTxSTSKO bit is set.  
NOTE: The frame descriptor start address pointer must be  
assigned before the BDMA Tx enable bit is set.  
[15]  
BDMA Tx reset (BTxRS)  
Set this bit to "1" to reset the BDMA Tx block.  
7-24  
S3C4510B  
ETHERNET CONTROLLER  
BDMATxCON Register  
31  
16 15 14 13 12 11 10 9  
8
7
6
5
4
0
B
B B B  
B B  
B
T
x
M
S
L
T
x
E
m
p
t
T
x
T
x
T
x
B B  
T
x
T
x
T
x
T
x
C M S  
C A T  
N N  
O L  
Reserved  
BTxBRST  
R E  
P
I
I
S
I
I
s
n
N K  
E E  
y
E C O  
[4:0] BDMA Tx burst size (BTxBRST)  
(Word size + 1) of data bursts reqested in BDMA mode. If BTxBRST is zero, the burst size is  
one word. If BTxBRST is 31, the burst size is 32 words.  
[5] BDMA Tx stop/skip frame by owner bit (BTxSTSKO)  
0 = Skips the current frame and goes to the next frame descriptor (if BDMA is not the  
owner of the frame)  
1 = BDMA transmitter generates an interrupt (if enabled).  
[6] Reserved  
[7] BDMA Tx complete to send control packet interrupt enable (BTxCCPIE)  
0 = Disable complete to send control packet interrupt.  
1 = Enable complete to send control packet interrupt. (The interrupt is generated when the MAC  
completes sending the control packet).  
[8] BDMA Tx Null list interrupt enable (BTxNLIE)  
0 = Disable transmit Null list interrupt.  
1 = Enable Null list interrupt to indicate that BDMATxPTR in the BDMA Tx unit has a Null  
address (0x00000000).  
[9] BDMA Tx not owner interrupt enable (BTxNOIE)  
0 = Disable BDMA Tx not owner interrupt for the current frame.  
1 = Enable BDMA Tx not owner interrupt for the current frame (and if the BTxSTSKO bit is set).  
[10] BDMA Tx buffer empty interrupt (BTxEmpty)  
0 = Disable Tx buffer empty interrupt.  
1 = Enable Tx buffer empty interrupt.  
[13:11] BDMA transmit to MAC Tx start level (BTxMSL)  
000 = No waiting  
010 = Wait to fill 2/8 of the Tx buffer  
100 = Wait to fill 4/8 of the Tx buffer  
001 = Wait to fill 1/8 of the Tx buffer  
011 = Wait to fill 3/8 of the Tx buffer  
1xx = Wait to fill 4/8 of the Tx buffer  
NOTE: Use this formula to calculate transmit time to the MAC Tx FIFO tBtOM:  
tBtOM = (BTxMSL/8) * size of the BDMA Tx buffer  
[14] BDMA Tx enable (BTxEn)  
0 = Disable the BDMA transmitter.  
1 = Enable the BDMA transmitter.  
[15] BDMA Tx reset (BTxRS)  
0 = No effect.  
1 = Reset the BDMA Tx block.  
Figure 7-12. Buffered DMA Transmit Control Register  
7-25  
ETHERNET CONTROLLER  
S3C4510B  
Buffered DMA Receive Control Register  
The buffered DMA receive control register, BDMARXCON, is described in Tables 7-5 and 7-6 below.  
Table 7-5. BDMA RXCON Register  
Register  
Offset Address  
R/W  
Description  
Rest Value  
BDMARXCON  
0x9004  
R/W  
Buffered DMA receive control register  
0x00000000  
Table 7-6. BDMA Receive Control Register Description  
Bit Number  
Bit Name  
Description  
[4:0]  
BDMA Rx burst size  
(BRxBRST)  
(Word size + 1) of data bursts requested in BDMA mode. If  
the BRxBRST is zero, the burst size is one word. If the  
BRxBRST is 31, the burst size is 32 words.  
[5]  
[6]  
[7]  
[8]  
BDMA Rx stop/skip frame by This bit determines whether the BDMA Rx controller issues an  
owner bit (BRxSTSKO)  
interrupt, if enabled, or skips the current frame and goes to the  
next frame descriptor (assuming BDMA is not the owner).  
BDMA Rx memory address  
inc/dec (BRxMAINC)  
This bit determines whether the address is incremented or  
decremented. If this bit is set to "1", the address will be  
incremented.  
BDMA Rx every received  
frame interrupt enable  
(BRxDIE)  
This bit enables the BDMA Rx every received frame interrupt  
which is generated by the BDMA controller each time is moves  
a complete data frame into memory.  
BDMA Rx Null list interrupt  
enable (BRxNLIE)  
This bit enables the BDMA Rx null list interrupt which indicates  
that the receive frame descriptor start address pointer,  
BDMARXPTR, in the BDMA Rx block has a null (0x00000000)  
address.  
[9]  
[10]  
BDMA Rx not owner interrupt This bit enables the BDMA Rx not owner interrupt when the  
enable (BRxNOIE)  
ownership bit of the current frame does not belong to the  
BDMA controller, and if the BRxSTSKO bit is set.  
BDMA Rx maximum size over This bit enables the BDMA Rx maximum size over interrupt  
interrupt enable (BRxMSOIE) when the received frame size is larger than the value in  
receive frame maximum size register.  
[11]  
BDMA Rx Big/Little Endian  
(BRxLittle)  
This bit determines whether the data is stored in Little- or Big-  
Endian format. If it is set to "1", word swapping will take place  
between the receive buffer and the system data bus.  
[13:12]  
BDMA Rx word alignment  
(BRxWA)  
The Rx word alignment bits determine how many bytes are  
invalid in the first word of each data frame. These invalid bytes  
are inserted when the word is assembled by the BDMA  
controller. "00" = No invalid bytes, "01" = 1 invalid byte, "10" =  
2 invalid bytes, and "11" = 3 invalid bytes.  
7-26  
S3C4510B  
ETHERNET CONTROLLER  
Table 7-6. BDMA Receive Control Register Description (Continued)  
Bit Number  
Bit Name  
Description  
[14]  
BDMA Rx enable (BRxEn)  
When the Rx enable bit is set to "1", the BDMA Rx block is  
enabled. Even if this bit is disabled, the MAC will receive Rx  
data until the MAC Rx FIFO overflows (as long as the FIFO is  
not empty and the MAC Rx is enabled). This bit is  
automatically disabled in the following cases: 1) if the next  
frame pointer is Null, or 2) if the owner bit is zero, and the  
BRxSTSKO bit is set.  
NOTE: The frame descriptor start address pointer must be  
assigned before the BDMA Rx enable bit is set.  
[15]  
[16]  
BDMA Rx reset (BRxRS)  
Set this bit to "1" to reset the BDMA Rx block.  
BDMA Rx buffer empty  
Set this bit is "1" to enable the Rx buffer empty interrupt.  
interrupt enable (BRxEmpty)  
[17]  
BDMA Rx early notify  
interrupt enable (BRxEarly)  
Set this bit to "1" to enable the Rx early notify interrupt. The  
function of this interrupt is to note the length of a data frame  
that is being received from its frame length field.  
7-27  
ETHERNET CONTROLLER  
S3C4510B  
BDMARxCON Register  
31  
18 17 16 15 14 13 12 11 10 9  
8
7
6
5
4
0
B B  
R R  
B
R
x
L
i
B
R
x
B B  
B R R  
R x  
B B  
R R  
B B  
R R  
B
R
x
W
A
x
x
x
x
x
E E  
M
S
O
I
x
M S  
D A T  
N N  
O L  
Reserved  
x
x
BRxBRST  
a
r
l
m
p
t
t
R E  
S n  
I
I
S
t
I
I
E N K  
C O  
l
E E  
E
e
y
y
[4:0] BDMA Rx burst size (BRxBRST)  
Burst data size = ( BRxBRST + 1 ) word.  
[5] BDMA Rx stop/skip frame (or interrupt if not owner of the current frame (BRxSTSKO)  
0 = Skips the current frame and goes to the next frame descriptor.  
1 = BDMA receiver generates an interrupt (if enabled).  
[6] BDMA Rx memory address increment/decrement (DRxMAINC)  
0 = Decrement the frame memory address.  
1 = Increment the frame memory address.  
[7] BDMA Rx every receuve frane interrupt enable (BRxDIE)  
0 = Disable frame receive done interrupt.  
1 = Enable frame receive done interrupt.  
[8] BDMA Rx Null list interrupt enable (BRxNLIE)  
0 = Disable Null address (0x00000000) receive interrupt.  
1 = Enable Null address (0x00000000) receive interrupt.  
[9] BDMA Rx not owner interrupt enable (BRxNOIE)  
0 = Disable interrupt for BDMA Rx not owner of the current frame.  
1 = Enable interrupt for BDMA Rx not onwer of the current frame.  
[10] BDMA Rx maximum size over interrupt enable (BRxMSOIE)  
0 = Disable interrupt for received frame if larger than the maximum frame size.  
1 = Enable interrupt for received frame if larger than the maximum frmae size.  
[11] BDMA Rx Big/Little Endian (BRxLittle)  
0 = Big-Endian frame data format.  
1 = Little-Endian. (Frame data in BDMA Rx buffer is word-swapped on the system bus).  
[13:12] BDMA Rx word alignment (BRxWA)  
00 = Do not insert an invalid byte in the first received frame data.  
01 = Insert one invalid byte in the first received frame data.  
10 = Insert two invalid bytes in the firat received frame data.  
11 = Insert three invalid bytes in the first received frame data.  
[14] BDMA Rx enable (BRxEn)  
0 = Disable the BDMA receiver.  
(If the MAC Rx FIFO is not empty, move data to the BDMA Rx buffer).  
1 = Enable the BDMA receiver.  
[15] BDMA Rx reset (BRxRs)  
0 = No effect.  
1 = Reset the BDMA receiver.  
[16] BDMA Rx buffer empty interrupt (RxEmpty)  
0 = Disable the Rx buffer empty interrupt.  
1 = Enable the Rx buffer empty interrupt.  
[17] BDMA Rx early notify interrupt (BRxEarly)  
0 = Disable the Rx early notify interrupt.  
1 = Enable the interrupt when BDMA captures the length of the received frame type.  
Figure 7-13. Buffered DMA Receiver Control Register  
7-28  
S3C4510B  
ETHERNET CONTROLLER  
BDMA Transmit Frame Descriptor Start Address Register  
Table 7-7. BDMATXPTR Register  
R/W Description  
R/W Buffered DMA transmit control register  
Registers  
Offset  
Reset Value  
0xFFFFFFFF  
BDMATXPTR  
0x9008  
Table 7-8. BDMA Transmit Frame Descriptor Start Address Register Description  
Bit Number  
Bit Name  
Description  
[25:0]  
BDMA transmit frame  
descriptor start address  
The BDMA transmit frame descriptor start address register  
contains the address of the frame descriptor on the frame to  
be sent. During a BDMA operation, this start address pointer is  
updated to the next frame address.  
BDMA Receive Frame Descriptor Start Address Register  
Table 7-9. BDMARXPTR Register  
R/W Description  
R/W Buffered DMA transmit control register  
Registers  
Offset  
Reset Value  
BDMARXPTR  
0x900C  
0xFFFFFFFF  
Table 7-10. BDMA Receive Frame Descriptor Start Address Register Description  
Bit Number  
Bit Name  
Description  
[25:0]  
BDMA receive frame  
descriptor start address  
The BDMA receive frame descriptor start address register  
contains the address of the frame descriptor on the frame to  
be saved. During a BDMA operation, this start address pointer  
is updated to the next frame address.  
7-29  
ETHERNET CONTROLLER  
S3C4510B  
BDMA Receive Frame Maximum Size Register  
Table 7-11. BDMARXLSZ Register  
R/W Description  
R/W Receive frame maximum size  
Registers  
Offset  
Reset Value  
Undefined  
BDMARXLSZ  
0x9010  
Table 7-12. BDMA Receive Frame Maximum Size Register Description  
Bit Number  
Bit Name  
Description  
[15:0]  
BDMA receive frame  
maximum size (BRxLSZ)  
This register value controls how many bytes per frame can be  
saved to memory. If the received frame size exceeds the  
value stored in this location, an error condition is reported.  
[31:16]  
BDMA receive frame length  
(BRxFSZ), read-only  
When an early notification (early notify) interrupt occurs, the  
frame Length/Ethernet type field contains the Frame size of  
the frame that is currently being received.  
To save space in the frame memory buffer, you can determine  
the current frame length by 1) enabling the early notification  
interrupt, and 2) reading the BRxFSZ field when the interrupt  
occurs.  
To calculate the value of the next frame start address pointer,  
you add the current frame size value (BRxFSZ) to the BDMA  
receive start address register. (For a control packet, additional  
space may be needed.)  
NOTE: To obtain the next Rx frame address that is to be  
saved in the Rx frame start address register, we recommend  
that you first halt the BDMA operation.  
BDMA Status Register  
Table 7-13. BDMASTAT Register  
Registers  
Offset  
R/W  
Description  
Buffered DMA status  
Reset Value  
BDMASTAT  
0x9014  
R/W  
0x00000000  
7-30  
S3C4510B  
ETHERNET CONTROLLER  
Table 7-14. BDMA Status Register Description  
Bit Name Description  
Bit Number  
[0]  
BDMA Rx done every  
received frame (BRxRDF)  
This bit is set each time the BDMA receiver moves one  
received data frame to memory. This bit must be cleared for  
the receiving next frame interrupt generation.  
[1]  
BDMA Rx null list (BRxNL)  
If this bit is set, the BDMARXPTR has a null address. Even if  
BDMA Rx is disabled, data is transferred from the MAC Rx  
FIFO to the BDMA Rx buffer until the BDMA Rx buffer  
overflows.  
[2]  
[3]  
[4]  
[5]  
BDMA Rx not owner (BRxNO) If this bit is set, BDMA is not the owner of the current data  
frame. The BRxSTSKO bit is set and BDMA Rx is stopped.  
BDMA Rx maximum size over If this bit is set, the received frame size is larger than the value  
(BRxMSO)  
in the Rx frame maximum size register, BDMARXLSZ.  
BDMA Rx buffer empty  
(BRxEmpty)  
If this bit is set, the BDMA Rx buffer is empty.  
Early notification (BRxSEarly) This bit is set when the BDMA receiver has received the  
length/Ether-type field of the current frame.  
[6]  
[7]  
Reserved  
Not applicable.  
One more frame data in  
BDMA receive buffer  
(BRxFRF)  
This bit is set whenever an additional data frame is received in  
the BDMA receive buffer.  
[15:8]  
[16]  
Number of frames in BDMA  
receive buffer (BRxNFR)  
This value indicates the total number of data frames currently  
in the BDMA receive buffer.  
BDMA Tx complete to send  
control packet (BTxCCP)  
Bit [16] is set each time the MAC sends a complete control  
packet.  
[17]  
BDMA Tx null list (BTxNL)  
If this bit is set, the BDMATXPTR value is a null address. In  
this case, BDMA Tx is disabled but data continues to be  
transferred from the BDMA Tx buffer to the MAC Tx FIFO until  
the BDMA Tx buffer underflows. This bit is read only.  
If you set BDMA Tx reset bit by software, this bit is cleared  
automatically. To resume data transfer, you must then set the  
new frame descriptor pointer and enable BDMA Tx.  
[18]  
BDMA Tx not owner (BTxNO) If [18] is set, BDMA is not owner of the current frame. In this  
case, the BSTSKO bit is set and BDMA Tx is stopped.  
[19]  
[20]  
Reserved  
Not applicable.  
BDMA Tx buffer empty  
(BTxEmpty)  
If this bit is set, the BDMA Tx buffer is empty.  
[31:21]  
Reserved  
Not applicable.  
7-31  
ETHERNET CONTROLLER  
S3C4510B  
31  
21 20 19 18 17 16 15  
8
7
6
5
4
3
2
1
0
B
T
x
E
m
p
t
B
R
x
S
E
a
r
B
R
x
B
T
x
C
C
P
B
R
x
F
R
F
B
R
x
M
S
O
B
R
x
R
D
F
B
T
x
N
O
B
T
x
N
L
B
R
x
N
O
B
R
x
N
L
E
m
p
t
X
Reserved  
X
BRxNFR  
l
y
y
y
[0] BDMA Rx done evert received frame (BRxRDF)  
0 = Reset frame data receive state.  
1 = Receipt of the data frame is complete.  
[1] BDMA Rx Null list (BRxNL)  
0 = Reset state of new frame descriptor (BDMARXPTR) is set.  
1 = Current frame descriptor address is Null (0x00000000).  
[2] BDMA Rx not owner (BRxNO)  
0 = BDMA is owner of the current frame.  
1 = The owner of the current frame is not BDMA (CPU). In this case, BDMA Rx is  
stopped and the BSTSKO bit is set.  
[3] BDMA Rx maximum size over (BRxMSO)  
0 = Reset state or next frame arrived at BDMA Rx buffer.  
1 = Received frame exceeds the maximum frame size.  
[4] BDMA Rx buffer empty (BRxEmpty)  
0 = Not empty.  
1 = BDMA Rx buffer empty.  
[5] Early notify (BRxSEarly)  
0 = Normal operation.  
1 = Lengthe of current frame can be accessed by reading the BDMA receive maximum  
frame size register, BDMARXLSZ [31:16].  
[7] One more frame data in BDMA receive buffer (BRxFRF)  
0 = Only one frame data in BDMA receive buffer.  
1 = One more frame data was in the BDMA receive buffer.  
[15:8] Number of frame data in BDMA receive buffer (BRxNFR)  
[16] BDMA Tx complete to send control packet (BTxCCP)  
0 = Clear but by writing a 1 to this bit or by resetting BDMA Tx.  
1 = MAC complete to send the control packet.  
[17] BDMA Tx Null list (BTxNL)  
0 = Reset stste of new frame descriptor (BDMATXPTR) is set.  
1 = Current frame descriptor address is Null (0x00000000).  
[18] BDMA Tx not owner (BTxNO)  
0 = BDMA is owner of the current frame.  
1 = The owner of the current frame is not BDMA (CPU). In this case, BDMA Tx is  
stopped if the BTxSTSKO bit is set to one.  
[19] Reserved  
[20] BDMA Tx buffer empty (BTxEmpty)  
0 = Not empty  
1 = BDMA Tx buffer empty.  
[31:21] Reserved  
NOTE:  
Bit 0, 1, 2, 3, 4, 16, 17, 18 and 20 should be cleared for interrupt generation  
for the next frame. The method is write 1 to the corresponding bit location.  
Figure 7-14. BDMA Status Register  
7-32  
S3C4510B  
ETHERNET CONTROLLER  
Content Address Memory (CAM) Register  
There are 21 CAM entries for the destination address and the pause control packet. For the destination address  
CAM value, one destination address consists of 6 bytes. Using the 32-word space (32 ´ 4 bytes), you can  
therefore maintain up to 21 separate destination addresses.  
You use CAM entries 0, 1, and 18 to send pause control packets. To send a pause control packet, you write the  
CAM0 entry with the destination address, the CAM1 entry with the source address, and the CAM 18 entry with  
length/type, opcode, and operand. You then set the send pause bit in the MAC transmit control register.  
Table 7-15. CAM Register  
Registers  
CAM  
Offset  
R/W  
Description  
Reset Value  
0x9100–0x917C  
W
CAM content (32 words)  
Undefined  
Table 7-16. Content Address Memory (CAM) Register Description  
Bit Number  
Bit Name  
Description  
[31:0]  
CAM content (CAM)  
The CPU uses the CAM content register as a data base for  
destination address. To activate the CAM function, you must  
set the appropriate enable bits in CAM enable register.  
7-33  
ETHERNET CONTROLLER  
S3C4510B  
MEDIA ACCESS CONTROL (MAC) REGISTERS  
This section describes the control and status registers for the flow control 100-/10-Mbit/s ethernet MAC. These  
include a master MAC control register, control registers for transmit and receive, control registers for the CAM, a  
counter for network management, and various flow control registers (see Table 7-17).  
Table 7-17. MAC Control and Status Registers  
Registers  
MACON  
Offset  
0XA000  
0xA004  
0xA008  
0xA00C  
0xA010  
0xA014  
0xA018  
0xA01C  
0xA028  
0xA03C  
0xA040  
0xA044  
0x9040  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
Description  
Reset Value  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00006000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
MAC control  
CAMCON  
CAM control  
MACTXCON  
MACTXSTAT  
MACRXCON  
MACRXSTAT  
STADATA  
STACON  
Transmit control  
Transmit status  
Receive control  
Receive status  
Station management data  
Station management control and address  
CAM enable  
CAMEN  
EMISSCNT  
EPZCNT  
RClr/W Missed error count  
R
R
R
Pause count  
ERMPZCNT  
ETXSTAT  
Remote pause count  
Transmit control frame status  
NOTE: MAC transmit/receive interrupt is generated whenever the Tx/Rx status field of Tx/Rx frame descriptor is written.  
7-34  
S3C4510B  
ETHERNET CONTROLLER  
MAC Control Register  
The MAC control register provides global control and status information for the MAC. The missed roll/link10 bit is  
a status bit. All other bits are MAC control bits.  
MAC control register settings affect both transmission and reception. You can also control transmit and receive  
operations separately. To select customized operating features, you should write this register during power-up.  
This way, you will not need to write or read it again during normal operation.  
After a reset is complete, the MAC controller clears the reset bit. Not all PHYs support full-duplex operation.  
(setting the MAC loopback bit overrides the full-duplex bit.) Also, some 10-Mb/s PHYs may interpret the loop10  
bit to control different functions, and manipulate the link10 bit to indicate a different status condition.  
Table 7-18. MACON Register  
Registers  
MACON  
Offset  
R/W  
Description  
Reset Value  
0XA000  
R/W  
MAC control  
0x00000000  
Table 7-19. MAC Control Register Description  
Bit Name Description  
Bit Number  
[0]  
Halt request (HaltReq)  
Set this bit to stop data packet transmission and reception as  
soon as Tx/Rx of any current packets has been completed.  
[1]  
[2]  
Halt immediate (HaltImm)  
Software reset (Reset)  
Set this bit to immediately stop all transmission and reception.  
Set this bit to reset all MAC control and status register and  
MAC state machines.  
[3]  
[4]  
Full-duplex (FullDup)  
Set this bit to start transmission while reception is in progress.  
MAC loopback (MACLoop)  
Set this bit to cause transmission signals to be presented as  
input to the receive circuit without leaving the controller.  
[5]  
[6]  
Reserved  
MII-OFF  
Not applicable  
Use this bit to select the connection mode. If this bit is set to  
one, 10 M bits/s interface will select the 10 M bits/s endec.  
Otherwise, the MII will be selected.  
[7]  
Loop 10 Mb/s (Loop10)  
If this bit is set, the Loop_10 external signal is asserted to the  
10-Mb/s endec.  
[9:8]  
[10]  
Reserved  
Not applicable.  
Missed roll (MissRoll)  
This bit is automatically set when the missed error counter  
rolls over.  
[11]  
[12]  
Reserved  
MDC-OFF  
Not applicable.  
Clear this bit to enable the MDC clock generation for power  
management. If it is set to one, the MDC clock generation is  
disabled.  
[13]  
Enable missed roll  
(EnMissRoll)  
Set this bit to generate an interrupt whenever the missed error  
counter rolls over.  
[14]  
[15]  
Reserved  
Not applicable  
Link status 10 Mb/s (Link10)  
Reserved  
This bit value is read as a buffered signal on the link 10 pin.  
Not applicable.  
[31:16]  
7-35  
ETHERNET CONTROLLER  
CAM Control Register  
S3C4510B  
The three accept bits in the CAM control register are used to override CAM rejections. To place the MAC in  
promiscuous mode, use CAM control register settings to accept packets with all three types of destination  
addresses. The three types of destination address packets are as follows:  
— Station packets, which has an even first byte. For example, 00-00-00-00-00-00.  
— A multicast-group, which has an odd first byte, but which is not FF-FF-FF-FF-FF-FF. For example, 01-00-00-  
00-00-00.  
— A broadcast, defined as FF-FF-FF-FF-FF-FF.  
When you enable CAM compare mode, the CAM memory reads the destination addresses to filter incoming  
messages. (You will recall that the CAM memory consists of 6-byte entries.) An alternative way to place the MAC  
in promiscuous mode is to set, in turn, to accept the them. To reject all packets, simply clear all of the bits in the  
CAMCON register.  
Table 7-20. CAMCON Register  
Registers  
CAMCON  
Offset  
R/W  
Description  
Reset Value  
0XA004  
R/W  
CAM control  
0x00000000  
Table 7-21. CAM Control Register Description  
Bit Name Description  
Bit Number  
[0]  
Station accept (StationAcc)  
Set this bit to accept any packet with a "unicast" station  
address.  
[1]  
[2]  
[3]  
Group accept (GroupAcc)  
Accept any packet with a multicast-group address.  
Broadcast accept (BroadAcc) Accept any packet with a broadcast address.  
Negative CAM (NegCAM)  
When this bit is "0", packets the CAM recognizes are accepted  
and others are rejected. When "1", packets the CAM  
recognizes are rejected and others are accepted.  
[4]  
Compare enable (CompEn)  
Reserved  
Set this bit to enable compare mode.  
Not applicable.  
[31:5]  
7-36  
S3C4510B  
ETHERNET CONTROLLER  
MAC Transmit Control Register  
To generate an interrupt after each packet, set the enable completion bit and all of the MAC error enable bits.  
Using MAC transmit control register settings, you can also selectively enable interrupts for specific conditions.  
Table 7-22. MACTXCON Register  
Registers  
Offset  
R/W  
Description  
Transmit control  
Reset Value  
MACTXCON  
0XA008  
R/W  
0x00000000  
Table 7-23. MAC Transmit Control Register Description  
Bit Number  
Bit Name  
Description  
[0]  
Transmit enable (TxEn)  
Set this bit to enable transmission. To stop transmission  
immediately, clear the transmit enable bit to "0".  
[1]  
Transmit halt request (TxHalt) Set this bit to halt transmission after completing any current  
packet.  
[2]  
[3]  
[4]  
[5]  
Suppress padding (NoPad)  
Suppress CRC (NoCRC)  
Fast back-off (FBack)  
No defer (NoDef)  
Set to not generate pad bytes for packets of less than 64 bytes.  
Set to suppress addition of a CRC at the end of a packet.  
Set this bit to use faster back-off times for testing.  
Set to disable the defer counter. (The defer counter keeps  
counting until the carrier sense (CrS) bit is turned off.)  
[6]  
Send Pause (SdPause)  
Set this bit to send a pause command or other MAC control  
packet. The send pause bit is automatically cleared when a  
complete MAC control packet has been transmitted. Writing a  
"0" to this register bit has no effect.  
[7]  
[8]  
[9]  
MII 10-Mb/s SQE test mode  
enable (SQEn)  
Set this bit to enable MII 10-Mb/s SQE test mode.  
Enable underrun (EnUnder)  
Set this bit to generate an interrupt if the MAC transmit FIFO is  
empty during a transmission.  
Enable deferral (EnDefer)  
Set this bit to generate an interrupt if the MAC defers for  
MAX_DEFERRAL time: "0" = 0.32768 ms at 100 Mb/s; "1" =  
3.2768 ms at 10-Mb/s.  
[10]  
[11]  
Enable no carrier (EnNCarr)  
Set this bit to generate an interrupt if a carrier sense is not  
detected while an entire packet is transmitted.  
Enable excessive collision  
(EnExColl)  
Set this bit to enable an interrupt if 16 collisions occur in the  
same packet.  
[12]  
Enable late collision  
(EnLateColl)  
Set this bit to generate an interrupt if a collision occurs after 512  
bit times (or 64 byte times).  
[13]  
Enable transmit parity  
(EnTxPar)  
Set this bit to generate an interrupt if a parity error is detected in  
the MAC transmit FIFO.  
[14]  
Enable completion (EnComp) Set this bit to generate an interrupt whenever the MAC  
transmits or discards one packet.  
[31:15]  
Reserved  
Not applicable.  
7-37  
ETHERNET CONTROLLER  
S3C4510B  
MAC Transmit Status Register  
A transmission status flag is set in the transmit status register, MACTXSTAT, whenever the corresponding event  
occurs. In addition, an interrupt is generated if the corresponding enable bit in the transmit control register is set.  
A MAC transmit FIFO parity error sets TxPar, and also clears TxEn, if the interrupt is enabled.  
You can read and mask the five low-order bits as a single collision count. That is, when ExColl is "1", TxColl is  
"0". If TxColl is not "0", then ExColl is "0".  
Table 7-24. MACTXSTAT Register  
Registers  
Offset  
R/W  
Description  
Transmit status  
Reset Value  
MACTXSTAT  
0XA00C  
R/W  
0x00000000  
Table 7-25. MAC Transmit Status Register Description  
Bit Number  
Bit Name  
Description  
[3:0]  
Transmit collision count  
(TxColl)  
This 4-bit value is the count of collisions that occurred while  
successfully transmitting the packet.  
[4]  
[5]  
[6]  
[7]  
[8]  
[9]  
Excessive collision (ExColl)  
This bit is set if 16 collisions occur while transmitting the  
same packet. In this case, packet transmission is aborted.  
Transmit deferred (TxDeferred) This bit is set if transmission of a packet was deferred  
because of a delay during transmission.  
Paused (Paused)  
This bit is set if transmission of a packet was delayed due to  
a Pause being received.  
This bit is set if transmission of a packet causes an interrupt  
condition.  
This bit is set if the MAC transmit FIFO becomes empty  
during a packet transmission.  
This bit is set if the MAC defers a transfer because of  
MAX_DEFERRAL at 0.32768 ms for 100 Mb/s or 3.2768 ms  
for 10Mb/s.  
Interrupt on transmit (IntTx)  
Underrun (Under)  
Deferral (Defer)  
[10]  
[11]  
No carrier (NCarr)  
This bit is set if no carrier sense is detected during the  
transmission a packet.  
Signal quality error (SQE)  
According to the IEEE802.3 rule, the SQE signal reports the  
status of the PMA (MAU or transceiver) operation to the MAC  
layer. After transmission is complete and 1.6 ms has elapsed,  
a collision detection signal is issued for 1.5 ms to the MAC  
layer. This signal is called the SQE test signal. The MAC sets  
the SQE bit in the MACTXSTAT register if this signal is not  
reported within the IFG time of 6.4ms.  
[12]  
[13]  
Late collision (LateColl)  
Transmit parity error (TxPar)  
Completion (Comp)  
This bit is set if a collision occurs after 512 bit times (or 64  
byte times).  
This bit is set if a collision occurs after 512 bit times (or 64  
byte times).  
This bit is set when the MAC transmits, or discards, one  
packet.  
[14]  
[15]  
Transmission halted (TxHalted) Transmission was halted by clearing the TxEn bit or the halt  
immediate (HaltImm) bit.  
[31:16]  
Reserved  
Not applicable.  
7-38  
S3C4510B  
ETHERNET CONTROLLER  
MAC Receive Control Register  
To issue an interrupt after each packet is received, set the enable good bit and all of the error enable bits in the  
MACRXCON register. You can also enable interrupts for specific conditions. Standard packet length values do  
not include a preamble or a start frame delimiter (SFD).  
Table 7-26. MACRXCON Register  
Registers  
Offset  
R/W  
Description  
Receive control  
Reset Value  
MACRXCON  
0XA010  
R/W  
0x00000000  
Table 7-27. MAC Receive Control Register Description  
Bit Number  
Bit Name  
Description  
[0]  
Receive enable (RxEn)  
Set this bit to "1" to enable MAC receive operation. If "0", stop  
reception immediately.  
[1]  
[2]  
Receive halt request (RxHalt)  
Long enable (LongEn)  
Set this bit to halt reception after completing the reception of  
any current packet.  
Set this bit to receive frames with lengths greater than 1518  
bytes.  
[3]  
[4]  
Short enable (ShortEn)  
Set this bit to receive frames with lengths less than 64 bytes.  
Strip CRC value (StripCRC)  
Set this bit to check the CRC, and then strip it from the  
message.  
[5]  
[6]  
Pass control packet (PassCtl)  
Set this bit to enable the passing of control packets to a MAC  
client.  
Ignore CRC value  
(IgnoreCRC)  
Set this bit to disable CRC value checking.  
[7]  
[8]  
Reserved  
Not applicable.  
Enable alignment (EnAlign)  
Set this bit to enable the alignment interrupt. An alignment  
interrupt occurs when a packet is received whose length (in bits)  
is not a multiple of eight, and whose CRC is invalid.  
[9]  
Enable CRC error  
(EnCRCErr)  
Set this bit to enable the CRC interrupt. A CRC interrupt occurs  
when a packet is received whose CRC is invalid or if, during its  
reception, the PHY asserts Rx_er.  
[10]  
[11]  
Enable overflow (EnOver)  
Enable long error (EnLongErr)  
Reserved  
Set this bit to enable the overflow interrupt. An overflow  
interrupt is generated when a packet is received and the MAC  
receive FIFO is full.  
Set this bit to enable the long error interrupt. A long error  
interrupt is generated when a frame longer than 1518 bytes is  
received (unless the long enable bit is set).  
[12]  
[13]  
Not applicable.  
Enable receive parity  
(EnRxPar)  
Set this bit to enable a receive parity interrupt if the MAC  
receive FIFO detects a parity error.  
[14]  
Enable Good (EnGood)  
Set this bit to enable the good (packet) interrupt upon error-free  
reception of a complete data packet.  
[31:15]  
Reserved  
Not applicable.  
NOTE: The frame lengths given above do not include preamble and start frame delimiter (SFD).  
7-39  
ETHERNET CONTROLLER  
S3C4510B  
MAC Receive Status Register  
A receive status flag is set in the MAC receive status register, MACRXSTAT, whenever the corresponding event  
occurs. When a status flag is set, it remains set until another packet arrives, or until software writes a "1" to the  
flag to clear the status bit. If the corresponding interrupt enable bit in the receive control register is set, an  
interrupt is generated whenever a status flag is set. A MAC receive parity error sets RxPar, and also clears the  
RxEn bit (if an interrupt is enabled).  
Table 7-28. MACRXSTAT Register  
Registers  
Offset  
R/W  
Description  
Reset Value  
MACRXSTAT  
0XA014  
R/W  
Receive status  
0x00000000  
Table 7-29. MAC Receive Status Register Description  
Bit Name Description  
Bit Number  
[4:0]  
[5]  
Reserved  
Not applicable.  
Control frame received (CtlRecd) This bit is set if the packet received is a MAC control frame  
(type = 8808H), if the CAM recognizes the packet address,  
and if the frame length is 64 bytes.  
[6]  
Interrupt on receive (IntRx)  
This bit is set if the reception of a packet caused an  
interrupt to be generated. This includes a good received  
interrupt, if the EnGood bit is set.  
[7]  
[8]  
[9]  
Receive 10-Mb/s status  
(Rx10Stat)  
This bit is set to "1" if a packet was received over the 7-wire  
interface or to "0" if a packet was received over the MII.  
Alignment error (AlignErr)  
This bit is set if the frame length in bits was not a multiple of  
eight and the CRC was invalid.  
CRC error (CRCErr)  
This bit is set if the CRC at the end of a packet did not  
match the computed value, or else the PHY asserted Rx_er  
during packet reception.  
[10]  
[11]  
Overflow error (overflow)  
Long error (LongErr)  
This bit is set if the MAC receive FIFO was full when it  
needed to store a received byte.  
This bit is set if the MAC received a frame longer than 1518  
bytes. (It is not set if the long enable bit in the receive  
control register, MACRXCON, is set.)  
[12]  
[13]  
Reserved  
Not applicable.  
Receive parity error (RxPar)  
This bit is set if a parity error is detected in the MAC receive  
FIFO.  
[14]  
[15]  
Good received (Good)  
This bit is set if a packet was successfully received with no  
errors. If EnGood = "1", an interrupt is also generated.  
Reception halted (RxHalted)  
This bit is set if reception was halted by clearing RxEn or by  
setting the HaltImm bit in the MAC control register,  
MACON.  
[31:16]  
Reserved  
Not applicable.  
7-40  
S3C4510B  
ETHERNET CONTROLLER  
MAC Station Management Data Register  
Table 7-30. STADATA Register  
Registers  
STADATA  
Offset  
R/W  
Description  
Reset Value  
0XA018  
R/W  
Station management data  
0x00000000  
Table 7-31. Station Management Register Description  
Bit Number  
Bit Name  
Description  
[15:0]  
Station management data.  
This register contains a 16-bit data value for the station  
management function.  
7-41  
ETHERNET CONTROLLER  
S3C4510B  
MAC Station Management Data Control and Address Register  
The MAC controller provides support for reading and writing station management data to the PHY. Setting  
options in station management registers does not affect the controller. Some PHYs may not support the option to  
suppress preambles after the first operation.  
Table 7-32. STACON Register  
Registers  
STACON  
Offset  
R/W  
Description  
Reset Value  
0XA01C  
R/W  
Station management control and address  
0x00008000  
Table 7-33. STACON Register Description  
Bit Name Description  
Bit Number  
[4:0]  
PHY register address (Addr)  
A 5-bit address, contained in the PHY, of the register to be  
read or written.  
[9:5]  
[10]  
PHY address (PHY)  
Write (Wr)  
The 5-bit address of the PHY device to be read or written.  
To initiate a write operation, set this bit to "1". For a read  
operation, clear it to "0".  
[11]  
Busy bit (Busy)  
To start a read or write operation, set this bit to "1". The MAC  
controller clears the Busy bit automatically when the operation  
is completed.  
[12]  
Preamble suppress (PreSup) If you set this bit, the preamble is not sent to the PHY. If it is  
clear, the preamble is sent.  
[15:13]  
MDC clock rating  
Control the MDC period.  
MD_CA[15:13]  
MDC period  
000  
001  
010  
16 ´ (1/fMCLK)  
18 ´ (1/fMCLK)  
20 ´ (1/fMCLK)  
.
.
.
.
111  
30 ´ (1/fMCLK)  
MDC period = MD_CA[15:13] ´ 2 + 16  
Default MDC_CA[15:13] = 100  
[31:16]  
Reserved  
Not applicable.  
7-42  
S3C4510B  
ETHERNET CONTROLLER  
CAM Enable Register  
The CAM enable register, CAMEN, indicates which CAM entries are valid, using a direct comparison mode. Up  
to 21 entries, numbered 0 through 20, may be active, depending on the CAM size. If the CAM is smaller than 21  
entries, the higher bits are ignored.  
Table 7-34. CAMEN Register  
Registers  
CAMEN  
Offset  
R/W  
Description  
Reset Value  
0XA028  
R/W  
CAM enable  
0x00000000  
Table 7-35. CAM Enable Register Description  
Bit Name Description  
Bit Number  
[20:0]  
CAM enable (CAMEn)  
Set the bits in this 21-bit value to selectively enable CAM  
locations 20 through 0. To disable a CAM location, clear the  
appropriate bit.  
[31:21]  
Reserved  
Not applicable.  
7-43  
ETHERNET CONTROLLER  
S3C4510B  
MAC Missed Error Count Register  
The value in the missed error count register, EMISSCNT, indicates the number of packets that were discarded  
due to various type of errors. Together with status information on packets transmitted and received, the missed  
error count register and the two pause count registers provide the information required for station management.  
Reading the missed error counter register clears the register. It is then the responsibility of software to maintain a  
global count with more bits of precision.  
The counter rolls over from 0x7FFF to 0x8000 and sets the corresponding bit in the MAC control register. It also  
generates an interrupt if the corresponding interrupt enable bit is set. If station management software wants more  
frequent interrupts, you can set the missed error count register to a value closer to the rollover value of 0x7FFF.  
For example, setting a register to 0x7F00 would generate an interrupt when the count value reaches 256  
occurrences.  
Table 7-36. EMISSCNT Register  
Registers  
Offset  
R/W  
Description  
Reset Value  
EMISSCNT  
0XA03C  
R(Clr)/W Missed error count  
0x00000000  
Table 7-37. Missed Error Count Register Description  
Bit Number  
Bit Name  
Description  
[15:0]  
Alignment error count  
(AlignErrCnt)  
The number of packets received with alignment errors. This  
software counter increments at the end of a packet reception if  
the Rx_Stat value indicates an alignment error.  
CRC error count (CRCErrCnt) The number of packets received with a CRC error. This  
software counter increments if the Rx_Stat value indicates a  
CRC error. If the Rx_Stat value indicates another type of error,  
such as an alignment error, this counter is not incremented.  
Missed error count  
(MissErrCnt)  
The number of valid packets rejected by the MAC unit  
because of MAC receive FIFO overflows, parity errors, or  
because the Rx_En bit was cleared. This count does not  
include the number of packets rejected by the CAM.  
[31:16]  
Reserved  
Not applicable.  
7-44  
S3C4510B  
ETHERNET CONTROLLER  
MAC Received Pause Count Register  
The received pause count register, EPZCNT, stores the current value of the 16-bit received pause counter.  
Table 7-38. EPZCNT Register  
Registers  
EPZCNT  
Offset  
R/W  
Description  
Reset Value  
0XA040  
R
Pause count  
0x00000000  
Table 7-39. Received Pause Count Register Description  
Bit Number  
Bit Name  
Description  
[15:0]  
Received pause count  
(EPZCNT)  
The count value indicates the number of time slots the  
transmitter was paused due to the receipt of control pause  
operation packets from the MAC.  
MAC Remote Pause Count Register  
The remote Pause count register, ERMPZCNT, stores the current value of the 16-bit remote Puase counter.  
Table 7-40. ERMPZCNT Register  
Registers  
Offset  
R/W  
Description  
Remote pause count  
Reset Value  
ERMPZCNT  
0XA044  
R
0x00000000  
Table 7-41. Remote Pause Count Register Description  
Bit Number  
Bit Name  
Description  
[15:0]  
Received pause count  
(EPZCNT)  
The count value indicates the number of time slots that a  
remote MAC was paused as a result of its sending control  
pause operation packets.  
7-45  
ETHERNET CONTROLLER  
S3C4510B  
MAC Transmit Control Frame Status  
The transmit control frame status register, ETXSTAT, is a RAM-based register which provides the status of a  
MAC control packet as it is sent to a remote station. This operation is controlled by the SdPause bit in the  
transmit control register, MACTXCON.  
It is the responsibility of the DMA engine to read this register, and to generate an interrupt to notify the system  
that the transmission of a MAC control packet has been completed.  
Table 7-42. ETXSTAT Register  
Registers  
ETXSTAT  
Offset  
R/W  
Description  
Reset Value  
0X9040  
R
Transmit control frame status  
0x00000000  
Table 7-43. Transmit Control Frame Register Description  
Bit Name Description  
Tx_Stat value  
Bit Number  
[15:0]  
A 16-bit value indicating the status of a MAC control packet as  
it is sent to a remote station. Read by the DMA engine.  
7-46  
S3C4510B  
ETHERNET CONTROLLER  
ETHERNET CONTROLLER OPERATIONS  
This section contains additional details about the following operations of the S3C4510B ethernet controller:  
— MAC frame and packet formats  
— Transmitting a frame  
— Receiving a frame  
— Full-duplex pause operation  
— Error signalling and network management  
MAC Frame and Packet Formats  
The MAC transmits each byte of all fields, except the FCS, least-significant bit first. In this document, the term  
"packet" is used to denote all of the bytes that are transmitted and received, while "frame" refers only to the bytes  
delivered by the station for transmission, and to the station who is receiving.  
Table 7-44 lists the eight fields in a standard data packet (IEEE 802.3/Ethernet frame). See also Figure 7-13.  
Table 7-44. MAC Frame and Package Format Description  
Field Name  
Preamble  
Field Size  
Description  
7 bytes  
The bits in each preamble byte are 10101010, transmitted from left  
to right.  
Start frame delimiter  
(SFD)  
1 byte  
6 bytes  
6 bytes  
The SFD bits are 10101011, transmitted from left to right.  
Destination address  
The destination address can be an individual address or a multicast  
(or broadcast) address.  
Source address  
The MAC does not interpret the source address bytes. However, to  
qualify as a valid station address, the first bit transmitted (the LSB  
of the first byte) must be a "0".  
Length or type  
2 bytes  
The MAC treats length fields greater than 1500 bytes as type fields.  
Byte values less than or equal to 1500 indicate the number of  
logical link control (LLC) data bytes in the data field. The MAC  
transmits the high-order byte first.  
Logical link control  
(LLC) data  
46 to 1500 bytes Data bytes used for logical link control.  
PAD  
0 to 46 bytes  
4 bytes  
If the LLC data is less than 46 bytes long, the MAC transmits pad  
bytes of all zeros.  
Frame check  
sequence (FCS)  
The FCS field contains a 16-bit error detection code that is  
computed as a function of all fields except the preamble, the SFD,  
and the FCS itself. The FCS - 32 polynomial function is as follows: "  
X32 + X26 + X23 + X16 + X12 + X11 + X10 + X8 + X7 + X5 + X4 +  
X2 + X1 + 1".  
7-47  
ETHERNET CONTROLLER  
S3C4510B  
Packet (Encoded on the Medium)  
Data Frame (sent by user)  
Added by transmitter  
Added by  
Transmitter,  
Stripped by  
Receiver  
Data frame (delivered to user)  
Optionaly stripped  
by receiver  
S
F
D
Destination  
Address  
Source  
Address  
Length or  
type  
Preamble  
7 bit  
LLC data  
PAD  
0-46  
FCS  
46-1500  
bytes  
1
6 bytes  
6 bytes  
2 bytes  
4 bytes  
LLC header  
LLC information field  
IP/X.25/......  
DSAP SSAP CTRL  
OR  
SNAP  
OUI PID  
DSAP SSAP CTRL  
IP/X.25/......  
1 byte 1 byte 1 byte 3 bytes 2 bytes  
DSAP = Destination service access point  
CTRL = Control field  
OUI = Origanizationally unique identifier  
SFD = Starting frame delimiter  
SSAP = Source service access point  
SNAP = Subnetwork access protocol  
PID = Protocol identifier  
LLC = Logical lick control  
FCS = Frame check sequence  
Figure 7-15. Fields of an IEEE802.3/Ethernet Packet (Frame)  
Options That Affect the Standard MAC Frame  
There are a number of factors and options which can affect the standard MAC frame, as described in Table 7-44:  
— Some PHYs may deliver a longer or shorter preamble.  
— Short packet mode permits LLC data fields with less than 46 bytes. Options are available to suppress  
padding and to support the reception of short packets.  
— Long packet mode supports LLC data fields with more than 1500 bytes. An option is also available to support  
to reception of long packets.  
— "No CRC" mode suppresses the appending of a CRC field.  
— "Ignore CRC" mode allows the reception of packets without valid CRC fields.  
7-48  
S3C4510B  
ETHERNET CONTROLLER  
Destination Address Format  
Bit 0 of the destination address is an address type designation bit. It identifies the address as either an individual  
or a group address. Group addresses are sometimes called "multicast" addresses and individual addresses are  
called "unicast" addresses. The broadcast address is a special group address in the special hex format: FF-FF-  
FF-FF-FF-FF.  
Bit 1 of the destination address distinguishes between locally or globally administered addresses. For globally  
administered or universal (U) addresses, the bit value is "0". If an address is to be assigned locally, you must set  
this bit to "1". For the broadcast address, this bit must also be set to "1".  
Destination Address  
MAC Address (3 bytes)  
Block ID or OUI (3 bytes)  
U/L  
I/G  
[0] Individual or group flag (I/G)  
0 = Individual (= unicast) address.  
1 = Group (= multicast) address.  
[1] Universal or local address flag (U/L)  
0 = Universal address.  
1 = Local address.  
Figure 7-16. Destination Address Format  
Special Flow Control Destination Address  
The current specification for full-duplex flow control specifies a special destination address for the Pause  
operation packet. In order for the MAC to receive packets which contain this special destination address, the  
address must be programmed in one of the CAM entries. This CAM entry must then be enabled, and the CAM  
activated.  
Some CAM entries are also used when generating a flow control packet using the SdPause bit in the MAC  
transmit control register.  
7-49  
ETHERNET CONTROLLER  
S3C4510B  
TRANSMITTING A FRAME  
To transmit a frame, the transmit enable bit in the transmit control register must be set and the transmit halt  
request bit must be zero. In addition, the halt immediate and halt request bits in the MAC control register must be  
"0". These conditions are normally set after any BDMA controller initialization has occurred. The system then  
uses the Tx_wr# and Tx_EOF signals to transfer bytes to the transmit data buffer.  
The transmit state machine starts transmitting the data in the FIFO, and will retain the first 64 bytes until after  
this station has acquired the net. At that time, the transmit block requests more data and transmits it until the  
system asserts the Tx_EOF input, signaling the end of data to be transmitted. The transmit block appends the  
calculated CRC to the end of the packet, and transmission ends. It then sets the transmit status register bit 0,  
signaling a successful transmission. This action may causes an interrupt, if enabled.  
A frame transmit operation can be subdivided into two operations, 1) a MII interface operation, and 2) a BDMA/  
MAC interface operation.  
BDI TRANSMIT OPERATION  
The BDI transmit operation is a simple FIFO mechanism. The BDMA engine stores data to be transmitted, and  
the transmit state machine empties it when the MAC successfully acquires the net.  
Note that the two time domains intersect at the FIFO controller. The writing and reading of data is asynchronous  
and on different clocks. Reading is driven by either a 25-MHz or a 2.5-MHz transmit clock. Writing is driven by  
the synchronous Sys_clk, which is asynchronous to Tx_clk.  
After a reset, the transmit FIFO is empty. The transmit block asserts the Tx_rdy signal, and transmission is  
disabled. To enable transmission, the system must set the transmit enable bit in the transmit control register. In  
addition, eight bytes of data must be present in the transmit FIFO. The BDMA engine can start stuffing data into  
the FIFO, and then enable the transmit bit. (Or it can enable the transmit bit first and then start stuffing data into  
the FIFO.) The transmit operation can only start if both of these conditions are met.  
7-50  
S3C4510B  
ETHERNET CONTROLLER  
BDI Transmit Timing  
When the transmit block asserts the Tx_rdy signal, the BDMA engine can write data into the transmit FIFO by  
asserting the Tx_wr# signal. Figure 7-15 shows timing sequences for back-to-back transfers and transfers with  
wait states. This is a synchronous interface, which means that data is latched in at the rising edge of the Sys_clk  
when Tx_wr# is asserted. For slower interfaces, the rising edge of Tx_wr# can be delayed.  
This is the equivalent of asserting a wait state in a synchronous operation. The transmit FIFO machine checks  
the Tx_par and the Tx_EOF bits. If there is a parity error, the transmit block aborts the transmission, resets the  
FIFO, and generates an interrupt by setting the TxPar bit in the transmit status register.  
The Tx_EOF bit signals the end of one frame to be transmitted. When it detects this bit, the transmit block de-  
asserts Tx_rdy until it has transmitted the packet. It then re-asserts Tx_rdy when the BDMA can transfer the next  
packet into the MAC FIFO.  
SYS_CLK  
Rx_rdy  
Rx_wr#  
B1  
B1  
B1  
B2  
B2  
B2  
B3  
B3  
B3  
Rx_DB  
Rx_BE#  
Rx_par  
Rx_EOF  
Figure 7-17. BDI Transmit Data Timing  
7-51  
ETHERNET CONTROLLER  
S3C4510B  
MII TRANSMIT OPERATION  
The transmit block consists of three state machines: the gap_ok state machine, the back_off state machine, and  
the main transmit state machine.  
The gap_ok State Machine  
The gap_ok state machine tracks and counts the inter-gap timing between the frames. When not operating in  
full-duplex mode, it counts 96 bit times from the deassertion of the carrier sense (CrS) signal. If there is any  
traffic within the first 64 bit times, the gap_ok state machine reset itself and starts counting from zero.  
If there is any traffic in the last 1/3 of the inter-frame gap, the gap_ok state machine continues counting.  
Following a successful transmission, a gap_ok is sent at the end of the next 96 bit times, regardless of the  
network traffic.  
In full-duplex mode, the gap_ok state machine starts counting at the end of the transmission and the gap_ok  
signal is sent at the end of the 96 bit times, regardless of the network traffic.  
Assemble MAC frame  
Yes  
Carrier sense==ON?  
Wait for interframe gap  
(96-bit time), start Tx  
with preamble + SFD  
Continue  
transmission  
Yes  
Collision detected?  
Preamble and SFD  
transmitted?  
Done. Complete Tx  
Yes  
Stop transmission,  
send 32-bit jam,  
++ Attemp_count  
Wait for back-off time:  
(=slot time x r),  
Attempt_count>=  
Max_attempt?  
k = minimum (n, back-off limit (=10))  
0<=n <Max_attempt (=16)  
0<= random integer (r) <= 2k  
Yes  
Report attempt limit  
exceeded error  
; To upper level layer  
Figure 7-18. CSMA/CD Transmit Operation  
7-52  
S3C4510B  
ETHERNET CONTROLLER  
The back_off State Machine  
The back_off state machine implements the back-off and retry algorithm of the 802.3 CSMA/CD. When a  
collision is detected, the main transmit state machine starts the back_off state machine¢s counters and waits for  
the back-off time (including zero) to elapse. This time is a multiple of 512 bit times that elapse before the packet  
that caused the collision is re-transmitted.  
Each time there is a collision (for one single packet), the back_off state machine increments an internal retry  
attempt countner. A 11-bit pseudo random number generator outputs a random number by selecting a subset of  
the value of the generator at any time. The subset is incremented by one bit for each subsequent attempt. This  
implementation is represented by the following equation:  
0 =< random integer(r) < 2K  
K = min (n, backoff limit (= 10))  
where "r" is the number of slot times the MAC must wait in case of a collision, and "n" is the number of retry  
attempts.  
For example, after the first collision, "n" is 1 and "r" is a random number between 0 and 1. The pseudo random  
generator in this case is one-bit wide and gives a random number of either 0 or 1. After the second attempt, "r" is  
a random number between 0 and 3. Therefore, the state machine looks at the two least-significant bits of the  
random generator (n = 2), which gives a value between 0 and 3.  
The Main Transmit State Machine  
The main transmit state machine implements the remaining MAC layer protocols. If there is data to be  
transferred, if the inter-frame gap is valid, and if the MII is ready (that is, if there are no collisions and no CRS in  
full-duplex mode), the transmit block then transmits the preamble followed by the SFD.  
After the SFD and preamble are transmitted, the block transmits 64 bytes of the data, regardless of the packet  
length, unless short transmission is enabled. This means that if the packet is less than 64 bytes, it will pad the  
LLC data field with zeros. It will also appends the CRC to the end of the packet, if CRC generation is enabled.  
If there is any collision during this first 72 bytes (8 bytes of preamble and SFD, and 64 bytes of the frame), the  
main transmit state machine stops the transmission and transmits a jam pattern (32 bits of 1¢s). It then  
increments the collision attempt counter, returns control to the back_off state machine, and re-transmits the  
packet when the back-off time has elapsed and the gap time is valid.  
If there are no collisions, the transmit block transmits the rest of the packet. At this time (that is, after the first 60  
bytes have been transmitted without collisions), the main transmit state machine lets the BDMA engine overwrite  
the packet. After it transmits the first 64 bytes, the transmit block transmits the rest of the packet, appending the  
CRC to the end. parity errors, FIFO errors, or more than 16 collisions will cause the transmit state machine to  
abort the packet (no retry) and queue up the next packet.  
In case of any transmission errors, the transmit block sets the appropriate error bit in the transmit status register.  
It may also generate an interrupt, depending on the enable bit settings in the transmit control register.  
7-53  
ETHERNET CONTROLLER  
S3C4510B  
Tx_clk  
Tx_en  
P
R
E
A
M
B
L
E
TxD [3:0]  
Crs  
Col  
Figure 7-19. Timing for Transmit without Collision  
Tx_clk  
Tx_en  
P1 P2 P3 P4 P5 P6 P7 P8 J1 J2 J3  
J4  
TxD [3:0]  
Crs  
Col  
Figure 7-20. Timing for Transmit with Collision in Preamble  
7-54  
S3C4510B  
ETHERNET CONTROLLER  
RECEIVING A FRAME  
The receive block, when enabled, constantly monitors a data stream coming either from the MII or, if in loop-  
back mode, from the transmit block. The MII supplies from zero to seven bytes of preamble, followed by the start  
frame delimiter (SFD). The receive block checks that the first nibbles received are preamble, and then looks for  
the SFD (10101011) in the first eight bytes. If it does not detect the SFD by then, it treats the packet as a  
fragment and discards it.  
The first nibble of destination address follows the SFD, least-significant bits first. When it has received a byte,  
the receive block generates parity, stores the byte with its parity in the receive FIFO, and asserts Rx_rdy. It  
combines subsequent nibbles into bytes and stores them in the FIFO.  
BDI RECEIVE DATA TIMING  
When the system asserts Rx_rd#, the receive block reads the first byte from the FIFO, checks parity, and drives  
the byte on Rx_DB, and the byte's parity on Rx_par. If the FIFO is now empty, it drops Rx_rdy. When it drives  
out the last byte of a packet, it asserts Rx_EOF.  
Figure 7-19 shows the timing sequence for transmitting bytes back-to-back, transmitting with wait states, and  
transmitting the last byte.  
Sys_clk  
Rx_rdy  
Rx_rd#  
B1  
B2  
B3  
BN  
Rx_DB  
Rx_par  
PAR  
PAR  
PAR  
PAR  
Rx_EOF  
Figure 7-21. BDI Receive Data Timing  
7-55  
ETHERNET CONTROLLER  
S3C4510B  
RECEIVE FRAME TIMING WITH/WITHOUT ERROR  
If, during frame reception, both Rx_DV and Rx_er are asserted, a CRC error is reported for the current packet.  
As each nibble of the destination address is received, the CAM block attempts to recognize it. After receiving the  
last destination address nibble, if the CAM block rejects the packet, the receive block asserts the Rx_toss signal,  
and discards any bytes not yet removed from the receive FIFO that came from the current packet. If this  
operation leaves the FIFO empty, it drops Rx_rdy.  
Figure 7-20 shows the MII receive data timing without error. The RX_DV signal, which entered the MII from the  
PCS layer, will be ON when the PCS layer recovers the Rx_clk from the receive bit stream and delivers the  
nibble data on RxD[3:0] data line. The RX_DV signal must be ON before the starting frame delimiter(SFD) is  
received. When the Rx_DV signal is ON, the preamble and SFD parts of the frame header are delivered to MII,  
synchronized with the 25-MHz Rx_clk. (The carrier sense (CrS) signal was turned on during receive frame.)  
As its response to the Rx_er signal, the MII immediately inserts an alternative data bit stream into the receive  
data stream. As a result, the MAC discards this received error frame using the FCS.  
Rx_clk  
Rx_DV  
Preamble  
SFD  
DA  
SFD  
RxD [3:0]  
Crs  
Rx_er  
Figure 7-22. Receiving Frame without Error  
Rx_clk  
Rx_DV  
Preamble  
SFD  
DA  
SFD  
RxD [3:0]  
Crs  
Rx_er  
Figure 7-23. Receiving Frame with Error  
7-56  
S3C4510B  
ETHERNET CONTROLLER  
Carrier Sense== On  
yse  
Carrier sense = On,  
after detection SFD,  
store byte-stream in in FISO  
no  
Discard the Frame  
Report Error Status  
Recognize Address?  
Move the byte stream in  
the FIFO to the receive  
buffer memory  
Frame too short ?  
Frame too long?  
Valid FCS ?  
Interrput CPU for  
Handing the Frame  
Check ethertype or length field  
Disassemble Frame  
MAC Drive Software  
(Software jobs for typical LAN cards)  
Signal to Upper Layer  
Figure 7-24. CSMA/CD Receive Operation  
7-57  
ETHERNET CONTROLLER  
S3C4510B  
THE MII STATION MANAGER  
The MDIO (management data input/output) signal line is the transmit and receive path for control/status  
information for the station management entity, STA. The STA controls and reads the current operating status of  
the PHY layer. The speed of transmit and receive operations is determined by the management data clock,  
MDC.  
The frame structure of the STA which writes command to control registers, or which reads the status register of a  
PHY device, is shown Table 7-45. The PHY address is defined as the identification (ID) value of the various PHY  
devices that may be concected to a single MAC. Register addresses can contain the ID value for up to 32 types  
of PHY registers.  
Turn-around bits are used to regulate the turn-around time of the transmit/receive direction between the STA and  
a PHY device. So that the STA can read the set value of a PHY device register, it must transmit the frame data,  
up to a specific register address, to the PHY device. During the write time (which is an undirected transmission),  
the STA transmits a stream of turn-around bits. As a result, by transmitting a write or read message to a PHY  
device through the MDIO, the STA can issue a request to set the operation or to read the operation status.  
As its response this message, the PHY device resets itself, sets loop-back mode, selects active/non-active auto-  
negotiation process, separates the PHY and MII electrically, and determines whether or not to activate the  
collision detection process.  
When it receives a read command, the PHY reports the kind of PHY device it is, such as 100Base-T4, FDX  
100base-X, HDX 100Base-X, 10-Mb/s FDX, or 10-Mb/s HDX.  
Table 7-45. STA Frame Structure Description  
Preamble Start of Operation  
PHY  
Register Turnaround  
Data  
Idle  
Frame  
Code  
Address Address  
Write  
(Command)  
11111111  
(32 bits)  
01  
01 (write)  
5 bits  
5 bits  
5 bits  
5 bits  
10 (2 bits) 16 bits  
(register  
Z
value)  
Read (Status) 11111111  
(32 bits)  
01  
10 (read)  
Z0  
16 bits  
(register  
value)  
Z
Direction: STA to PHY  
Direction: PHY to STA  
7-58  
S3C4510B  
ETHERNET CONTROLLER  
FULL-DUPLEX PAUSE OPERATIONS  
Transmit Pause Operation  
To enable a full-duplex Pause operation, the special broadcast address for MAC control packets must be  
programmed into the CAM, and the corresponding CAM enable bit set. The special broadcast address can be a  
CAM location. To optimize the utilization CAM entries, you can specify a preference for specific CAM locations.  
This feature is described below.  
The MAC receive circuit recognizes a full-duplex Pause operation when the following conditions are met:  
— The type/length field has the special value for MAC Control packets, 0x8808.  
— The packet is recognized by the CAM.  
— The length of the packet is 64 bytes.  
— The operation field specifies a Pause operation.  
When a full-duplex pause operation is recognized, the MAC receive circuit loads the operand value into the  
pause count register. It then signals both the MAC and the BDMA engine that the pause should begin at the end  
of the current packet, if any.  
The pause circuit maintains the pause counter, and decrements it to zero. It does this before it signals the end of  
the pause operation, and before allowing the transmit circuit to resume its operation.  
If a second full-duplex pause operation is recognized while the first operation is in effect, the pause counter is  
reset with the current operand value. Note that a count value of zero may cause pre-mature termination of a  
pause operation that is already in progress.  
Remote Pause Operation  
To send a remote pause operation, following these steps:  
1. Program CAM location 0 with the destination address.  
2. Program CAM location 1 with the source address.  
3. Program CAM location 18 with length/type field, opcode, and operand.  
4. Program the 2 bytes that follow the operand with 0000H.  
5. Program the three double words that follow CAM location 18 with zeros.  
6. Write the transmit control register to set the SdPause bit.  
The destination address and source address are commonly used as the special broadcast address for MAC  
control frames and the local station address, respectively. To support future uses of MAC control frames, these  
values are fully programmable in the flow control 100-/10-Mbit/s Ethernet MAC.  
When the remote Pause operation is completion, the transmit status is written to the transmit control frame status  
register. The BDMA engine is responsible for providing an interrupt enable control.  
7-59  
ETHERNET CONTROLLER  
Error Signalling  
S3C4510B  
The error/abnormal operation flags asserted by the MAC are arranged into transmit and receive groups. These  
flag groups are located either in the transmit status register (Tx_stat) or the receive status register (Rx_stat). A  
missed packet error counter is included for system network management purposes.  
Normally, software does not have enough direct control to examine the status registers directly. Therefore, the  
BDMA engine must store the values in system memory so that they can be examined there by software.  
Reporting of Transmission Errors  
A transmit operation terminates when the entire packet (preamble, SFD, data, and CRC) has been successfully  
transmitted through the MII without a collision. In addition, the transmit block detects and reports both internal  
and network errors.  
Under the following conditions, the transmit operation will be aborted (in most cases).  
Parity error  
The 8 bits of data coming in through the BDII has an optional parity bit. A  
parity bit also protects each byte in the MAC transmit FIFO. If a parity error  
occurs, it is reported to the transmit state machine, and the transmission is  
aborted. A detected parity error sets the TxPar bit in the transmit status register.  
Transmit FIFO underrun  
No CRS  
The 80-byte transmit FIFO can handle a system latency of 6.4bi (640 bit times).  
An underrun of the transmit FIFO during transmission indicates a system  
problem (namely, that the system cannot keep up with the demands of the  
MAC), and the transmission is aborted.  
The carrier sense signal (CrS) is monitored from the beginning of the start of  
frame delimiter (SFD) to the last byte transmitted. A "No CrS" indicates that CrS  
was never present during transmission (a possible network problem), but the  
ransmission will NOT be aborted. Note that during loop-back mode, the MAC is  
disconnected from the network, and a "No CRC" will not be detected.  
Excessive collision error  
Late collision error  
Whenever the MAC encounters a collision during transmit, it will back off,  
update the "attempt counter," and retry the transmission later on. When the  
attempt counter reaches 16 (16 attempts that all resulted in a collision), the  
transmission is aborted. This indicates a network problem.  
(Transmit out of window collision)  
Normally, the MAC would detect a collision (if one occurs) within the first 64  
bytes of data that are transmitted, including the preamble and SFD. If a collision  
occurs after this time frame, a possible network problem is indicated. The error  
is reported to the transmit state machine, but the transmission is NOT aborted.  
Instead, it performs a back-off, as usual.  
Excessive deferral error  
During its first attempt to send a packet, the MAC may have to defer the  
transmission because the network is busy. If this deferral time is longer than 32K  
bit times, the transmission is aborted. Excessive deferral errors indicate a  
possible network problem.  
7-60  
S3C4510B  
ETHERNET CONTROLLER  
Reporting of Receive Errors  
When it detects a start of frame delimiter (SFD), the receive state machine starts putting data it has received  
from the MII into the receive FIFO. It also checks for internal errors (FIFO overruns) while reception is in  
progress.  
When the receive operation is completed, the receive state machine checks for external errors, such as frame  
alignment, length, CRC, and frame too long.  
The following is a description of the types of errors that may occur during a receive operation:  
Priority error  
A parity bit protects each byte in the MAC receive FIFO. If a parity error occurs,  
it is reported to the receive state machine. A detected parity error sets the RxPar  
bit in the receive status register.  
Frame Alignment Error  
(Dribble)  
After receiving a packet, the receive block checks that the incoming packet  
(including CRC) was correctly framed on an 8-bit boundary. If it is not and if the  
CRC is invalid, data has been disrupted through the network, and the receive  
block reports a frame alignment error. A CRC error is also reported.  
CRC Error  
After receiving a packet, the receive block checks the CRC for validity, and  
reports a CRC error if it is invalid. The receive unit can detect network-related  
errors such as CRC, frame alignment, and length errors. It can also detect these  
types of errors in the following combinations:  
CRC errors only  
Frame alignment and CRC errors only  
Length and CRC errors only  
Frame alignment, length, and CRC errors  
Frame too long  
Receive FIFO overrun  
MII error  
The receive block checks the length of the incoming packet at the end of  
reception (including CRC, but excluding preamble and SFD). If the length is  
longer than the maximum frame size of 1518 bytes, the receive block reports  
receiving a "long packet", unless long frame mode is enabled.  
During reception, the incoming data are put into the receive FIFO temporarily  
before they are transferred to the system memory. If the FIFO is filled up  
because of excessive system latency or for other reasons, the receive block sets  
the overrun bit in the receive status register.  
The PHY informs the MAC if it detects a medium error (such as a coding  
violation) by asserting the input pin Rx_er. When the MAC sees Rx_er asserted,  
it sets CRCErr bit of the receive status register.  
7-61  
ETHERNET CONTROLLER  
S3C4510B  
Timing Parameters for MII Transactions  
The timing diagrams in this section conform to the guidelines described in the "Draft Supplement to ANSI/IEEE  
Std. 802.3, Section 22.3, Signal Characteristics."  
Tx_clk  
0ns MIN, 25ns MAX  
TxD[3:0]  
Tx_en  
Figure 7-25. Transmit Signal Timing Relationship at MII  
Rx_clk  
10ns MIN 10ns MIN  
RxD[3:0],  
Rx_DV,  
Rx_er  
INPUT VALID  
Figure 7-26. Receive Signal Timing Relationship at MII  
7 Cycles  
7 Cycles  
MDC  
0ns MIN, 300ns MAX  
MDIO  
Figure 7-27. MDIO Sourced by PHY  
MDC  
10ns MIN 10ns MIN  
MDIO  
INPUT VALID  
Figure 7-28. MDIO Sourced by STA  
7-62  
S3C4510B  
ETHERNET CONTROLLER  
MAC CONTROLLER 7–WIRE INTERFACE TIMING  
Table 7-46. 7-Wire Interface Receive Timing  
Symbol  
Ts_crs  
Th_crs  
Ts_dv  
Th_dv  
Ts_d  
Condition  
CRS low to high setup time  
CRS low to high hold time  
RX_DV set-up time  
RX_DV hold time  
Min  
0.92  
0.38  
0.9  
Typ  
Max  
Unit  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
0.4  
RxD set-up time  
0.79  
0.51  
0.9  
Th_d  
RxD hold time  
Ts_er  
Th_er  
Tcyc  
Rx_er set-up time  
Rx_er hold time  
0.4  
Rx_clk clock period  
100  
Th_crs  
Th_dv Ts_dv  
Tcyc  
Rx_clk  
Rx_DV  
RxD  
Ts_crs  
Preamble  
SFD  
DA  
CRC  
Crs  
Th_d Ts_d  
Rx_er  
Th_er Ts_er  
Figure 7-28. Rx Timing in 7 Wire Interface  
7-63  
ETHERNET CONTROLLER  
S3C4510B  
Table 7-47. 7-Wire Interface Transmit Timing  
Symbol  
Condition  
Tx_en set-up time  
Tx_en hold time  
Min  
0.8  
Typ  
Max  
Unit  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
ns  
Ts_en  
Th_en  
Ts_crs  
Th_crs  
Ts_d  
0.71  
0.72  
0.75  
1.2  
CRS set-up time  
CRS hold time  
TxD set-up time  
TxD hold time  
Th_d  
0.5  
Ts_col  
Th_col  
Tcol  
COL set-up time  
COL hold time  
0.82  
0.79  
200  
COL minimum active time  
Ts_col  
Th_col  
Th_cn Ts_en  
Tx_clk  
Tx_en  
TxD  
Th_d  
Ts_d  
Crs  
Ts_crs  
Th_crs  
Col  
Tcol  
Figure 7-29. Tx Timing in 7 Wire Interface  
7-64  
S3C4510B  
HDLC CONTROLLERS  
8
HDLC CONTROLLERS  
OVERVIEW  
The S3C45310B has two high-level data link controllers (HDLCs) to support two-channel serial communications.  
The HDLC module supports a CPU/data link interface that conforms to the synchronous data link control (SDLC)  
and high-level data link control (HDLC) standards. In addition, the following function blocks are integrated into the  
HDLC module:  
— Two-channel DMA engine for Tx/Rx  
— Support buffer descriptors per frame  
— Digital phase-locked loop (DPLL) block  
— Baud rate generator (BRG)  
8-1  
HDLC CONTROLLERS  
S3C4510B  
FEATURES  
Important features of the S3C4510B HDLC block are as follows:  
— Protocol features:  
Flag detection and synchronization  
Zero insertion and deletion  
Idle detection and transmission  
FCS encoding and detection (16-bit)  
Abort detection and transmission  
— Four address station registers and one mask register for address search mode  
— Selectable CRC/No-CRC mode  
— Automatic CRC generator preset  
— Digital PLL block for clock recovery  
— Baud rate generator  
— NRZ/NRZI/FM/Manchester data formats for Tx/Rx  
— Loop-back and auto-echo mode  
— Tx and Rx clock inversion  
— Tx and Rx FIFOs with 8-word (8 x 32-bit) depth  
— Selectable 1-word or 4-word data transfer mode for Tx/Rx  
— Data alignment logic  
— Endian translation  
— Programmable interrupts  
— Modem interface  
— Hardware flow control  
— Buffer descriptor for Tx / Rx  
— Two-channel DMA Controller  
Two channels for HTxFIFO and HRXFIFO  
Single or 4-word (4 x 32-bit) burst transfer mode  
Maximum frame size allows for up to 64K bytes  
— Up to 10 Mbps full-duplex operation using an external/internal clock  
— HDLC frame length based on octets  
8-2  
S3C4510B  
HDLC CONTROLLERS  
FUNCTION DESCRIPTIONS  
Figure 8-1 shows the HDLC module's function blocks. These function blocks are described in detail in the  
following sections.  
Tx FIFO  
(8 Words)  
FCS Generator  
autoecho  
Address  
DMA  
Controlller  
Zero  
Insertion  
Flag/Abort/Idle  
Generateor and  
Transmitter  
Encoder  
TxD  
HDLC Control  
and Status  
Registers  
Flag/Abort/Idle  
Detection  
Word  
Zero  
Deletion  
FCS Checker  
Control  
Data  
loop  
Bus Arbiter/  
Controller  
Receive shift  
Register  
Decoder  
RxD  
TxC  
Address  
dplloutR  
dplloutT  
Rx FIFO  
(8 words)  
DPLL  
RxC  
brgout1  
BRG  
brgout2  
MCLK2  
(= 25 MHz)  
Figure 8-1. HDLC Module Block Diagram  
8-3  
HDLC CONTROLLERS  
S3C4510B  
HDLC FRAME FORMAT  
The HDLC transmits and receives data (address, control, information and CRC field) in a standard format called  
a frame. All frames start with an opening flag (beginning of flag, BOF, 7EH) and end with a closing flag (end of  
flag, EOF, 7EH). Between the opening and the closing flags, a frame contains an address (A) field, a control (C)  
field, an information (I) field (optional), and a frame check sequence (FCS) field (see Table 8-1).  
Table 8-1. HDLC Data Frame Format  
Opening  
Flag  
Address  
Field  
Control  
Field  
Information  
Field  
Frame Check  
Sequence Field  
Closing  
Flag  
01111110  
8 bits per byte  
8 bits per byte  
8 bits per byte;  
variable length  
16 bits  
01111110  
NOTE: The address field can be extended up to four bytes using a optional software control setting.  
Flag (F)  
A flag is a unique binary pattern (01111110) that is used to delimit HDLC frames. This pattern is generated  
internally by the transmitter. An opening flag starts a frame and a closing flag ends the frame. Opening flags and  
closing flags are automatically appended to frames.  
A single flag pattern can optionally serve as both the closing flag of one frame and the opening flag of the next  
one. This feature is controlled by the double-flag (FF), single-flag (F), or frame separator selection bit (the  
TxSDFL bit in the HCON register).  
Order of Bit Transmission  
Address field, control field, and information field bytes are transferred between the CPU and the HDLC module in  
parallel over the data bus. These bytes are transmitted and received LSB first. The 16-bit frame check sequence  
(FCS) field is, however, transmitted and received MSB first.  
8-4  
S3C4510B  
HDLC CONTROLLERS  
Address (A) Field  
The eight bits that follow the opening flag are called address (A) field. The address field are expendable. To  
extend this address byte, simply user-defined address write to the station address register. To check address byte  
against the incoming data, have to be used the MASK register. If match occurred, the frame's data including  
address and CRC(16-bit) into the HRXFIFO and then moved to system memory. If it is not matched, simply  
discarded. S3C4510B allows up to 32-bits address. For instance, SDLC and LAPB use an 8-bit address. LAPD  
further divides its 16-bit address into different fields to specify various access points one piece of equipment.  
Some HDLC-type protocol allows for extended addressing beyond 16-bit.  
Control (C) Field  
The eight bits that follow the address field are called the control (link control, C) field. The S3C4510B HDLC  
module treats the control field in the same way as the information field. That is, it passes the eight bits to the  
CPU or memory during reception. The CPU is responsible for how the control field is handled and what happens  
to it.  
Information (I) Field  
The information (I) field follows the control (C) field and precedes the frame check sequence (FCS) field. The  
information field contains the data to be transferred. Not every frame, however, must actually contain information  
data. The word length of the I-field is eight bits in the S3C4510B HDLC module. And Its total length can be  
extended by 8 bits until terminated by the FCS field and the closing flag.  
Frame Check Sequence (FCS) Field  
The 16 bits that precede the closing flag comprise the frame check sequence (FCS) field. The FCS field contains  
the cyclic redundancy check character, CRCC. The polynomial x16 + x12 + x5 + 1 is used both for the  
transmitter and the receiver. Both the transmitter and the receiver polynomial registers are all initialized to 1 prior  
to calculating of the FCS. The transmitter calculates the frame check sequence of all address bits, control bits,  
and information fields. It then transmits the complement of the resulting remainder as the FCS value.  
The receiver performs a similar calculation for all address, control, and information bits, as well as for all the FCS  
fields received. It then compares the result to F0B8H. When a match occurs, the frame valid (RxFV) status bit is  
set to '1'. When the result does not match, the receiver sets the CRC error bit (RxCRCE) to '1'. The transmitter  
and the receiver automatically perform these FCS generation, transmission and checking functions. The  
S3C4510B HDLC module also supports NO CRC operation mode. In NO CRC mode, transmitter does not  
append FCS to the end of data and the receiver also does not check FCS. In this mode, the data preceding the  
closing flag is transferred to the HRXFIFO. In CRC mode, the FCS field is transferred to the HRXFIFO.  
8-5  
HDLC CONTROLLERS  
S3C4510B  
PROTOCOL FEATURES  
INVALID FRAME  
A valid frame must have at least the A, C, and FCS fields between its opening and closing flags. Even if no-CRC  
mode is set, the frame size should not be less than 32 bits. There are three invalid frame conditions:  
— Short frame: a frame that contains less than 25 bits between flags. Short frames are ignored.  
— Invalid frame: a frame with 25 bits or more, having a CRC compare error or non- byte-aligned. Invalid frames  
are transferred to the HRXFIFO, then the invalid frame error flag (RxCRCE, RxNO in the status register) is  
set to indicate that an invalid frame has been received.  
— Aborted frame: a frame aborted by the reception of an abort sequence is handled as an invalid frame.  
ZERO INSERTION AND ZERO DELETION  
The zero insertion and zero deletion feature, which allows the content of a frame to be transparent, is handled  
automatically by the HDLC module. While the transmitter inserts a binary '0' following any sequence of five 1s  
within a frame, the receiver deletes a binary '0' that follows a sequence of five 1s within a frame.  
ABORT  
The function of early termination of a data link is called an abort The transmitter aborts a frame by sending at  
least eight consecutive 1s immediately after the abort transmitter control bit (TxABT in HCON) is set to '1'.  
(Setting this control bit automatically clears the HTxFIFO.)  
The abort sequence can be extended up to (at least) 16 consecutive 1s by setting the abort extend control bit  
(TxABTEXT in HCON) to '1'. This feature is useful for forcing the mark idle state. The receiver interprets the  
reception of seven or more consecutive 1s as an abort.  
The receiver responds the abort received as follows:  
— An abort in an 'out of frame' condition: an abort has no meaning during the idle or the time fill  
— An abort 'in frame' after less than 25 bits are received after an opening flag: under this condition, no field of  
the aborted frame is transferred to the HRXFIFO. The HDLC module clears the aborted frame data in the  
receiver and flag synchronization. The aborted reception is indicated in the status register.  
— An abort 'in frame' after 25 bits or more are received after an opening flag: in this condition, some fields of  
the aborted frame may be transferred to the HRXFIFO. The abort status is set in the status register and the  
data of the aborted frame in the HRXFIFO is cleared. Flag synchronization is also cleared and the DMA  
operation for receiving is aborted too.  
IDLE AND TIME FILL  
When the transmitter is not transmitting a frame, it is in an idle state. The transmitter signals that it has entered  
an idle state in one of the following two ways: 1) by transmitting a continuous series of flag patterns (time fill), or  
2) by transmitting a stream of consecutive 1s (mark idle). The flags and mark idle are not transferred to the  
HRXFIFO.  
The flag or mark idle selection bit (TxFLAG in HCON) controls this function: when TxFLAG is '0', mark idle is  
selected; when TxFLAGIDLE is '1', the time fill method is selected.  
8-6  
S3C4510B  
HDLC CONTROLLERS  
FIFO STRUCTURE  
In both transmit and receive directions, 32-byte (8 word) deep FIFOs are provided for the intermediate storage of  
data between the serial interface and the CPU Interface.  
TWO-CHANNEL DMA ENGINE  
The HDLC module has a two-channel DMA engine for Tx/Rx FIFOs. The DMA Tx channel programming and the  
RX channel programming are described in the transmitter and receiver operation sections, respectively.  
BAUD RATE GENERATOR  
The HDLC module contains a programmable baud rate generator(BRG). The BRG register contains a 16-bit time  
constant register, a 12-bit down counter for time constant value, two control bit to divide 16, and another two  
control bits to divide 16 or 32.  
A clock diagram of the BRG is shown in Figure 8-2.  
At a start-up, the flip-flop on the output is set in a High state, the value in the time constant register is loaded into  
the counter, and the counter starts counting down. The output of the baud rate generator may toggle upon  
reaching zero, the value in the time constant register is loaded into the counter, and the process is repeated. The  
time constant may be changed any time, but the new value does not take effect until the next load of the counter.  
The output of the baud rate generator may be used as either the transmit clock, the receive clock, or both. It can  
also drive the digital phase-locked loop. If the receive or transmit clock is not programmed to come from the TXC  
pin, the output of the baud rate generator may be echoed out via the TXC pin.  
The following formula relates the time constant to the baud rate where MCLK2 or RXC is the baud rate generator  
input frequency in Hz. BRG generates 2 output signals, BRGOUT1, BRGOUT2, for transmit/receive clocks and  
the DPLL input clock.  
BRGOUT1 = (MCLK2 or RXC) / (CNT0 + 1) / (16CNT1  
BRGOUT2 = BRGOUT1 / (1 or 16 or 32 according to CNT2 value of the HBRGTC)  
)
CNT0  
CNT1  
CNT2  
RxC  
BRGOUT2  
BRGOUT1  
Divide by  
1 or 16  
Divide by  
1 or 16 or 32  
12-bit counter  
MCLK2  
CNT0: HBRGTC [15:4]  
CNT1: HBRGTC [3:2]  
CNT2: HBRGTC [1:0]  
BRGCLK: HMODE [19]  
BRGCLK  
Figure 8-2. Baud Rate Generator Block Diagram  
8-7  
HDLC CONTROLLERS  
S3C4510B  
The example in the following Table assumes a 25 MHz clock from MCLK2, a 24.576 MHz clock from RxC,  
showing a time constant for a number of commonly used baud rates.  
Table 8-2. Baud Rate Example of HDLC  
Baud Rate  
(BRGOUT2)  
1200  
MCLK = 25 MHz  
R´ C = 24.576 MHz  
CNT0  
1301  
650  
324  
162  
80  
CNT1  
CNT2  
Freq. Dev.(%) CNT0  
CNT1  
CNT2  
Freq.  
Dev.(%)  
0.0  
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1200.1  
2400.2  
4807.7  
9585.9  
19290.1  
38109.8  
57870.4  
0.0  
0.0  
1279  
639  
319  
159  
79  
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
1200.0  
2400.0  
2400  
0.0  
4800  
0.2  
4800.0  
0.0  
9600  
- 0.1  
0.5  
9600.0  
0.0  
19200  
19200.0  
38400.0  
56888.9  
118153.8  
0.0  
38400  
40  
- 0.8  
0.5  
39  
0.0  
57600  
26  
26  
-1.2  
2.6  
115200  
13  
111607.1 - 3.1  
12  
8-8  
S3C4510B  
HDLC CONTROLLERS  
DIGITAL PHASE-LOCKED LOOP (DPLL)  
The HDLC module contains a digital phase-locked loop (DPLL) function to recover clock information from a data  
stream with NRZI or FM encoding. The DPLL is driven by a clock that is normally 32 (NRZI) or 16 (FM) times the  
data rate. The DPLL uses this clock, along with the data stream, to construct the clock.  
This clock may then be used as the receive clock, the transmit clock, or both.  
Figure 8-3 shows a block diagram of the digital phase-locked loop. It consists of a 5-bit counter, an edge detector  
and a pair of output decoders.  
Receive Clock  
Transmit clock  
RxD  
Edge  
Detector  
Count Modifier  
5-bit Counter  
Decoder  
Decoder  
dplloutR  
dplloutT  
TxC  
RxC  
MCLK  
BRGOUT1  
BRGOUT2  
HMODE[18:16]  
Figure 8-3. DPLL Block Diagram  
CLOCK USAGE METHOD  
BRGCLK  
DPLLCLK  
TxC  
RxC  
BRGOUT1  
BRGOUT2  
DPLLOUTT  
RxC  
Baud Rate  
Generator  
DPLL  
MCLK  
MCLK2  
BRGOUT1  
BRGOUT2  
DPLLORTR  
TxCLK  
RxCLK  
TxC  
TxC  
RxC  
DPLLOUTT  
BRGOUT1  
BRGOUT2  
RxC  
DPLLOUTT  
BRGOUT1  
BRGOUT2  
Transmit  
Transmit  
Receive  
Clock  
Receive  
Data  
Transmitter  
Receiver  
Clock  
Data  
NOTE:  
BRGCLK = HMODE [19]  
DPLLCLK = HMODE [18:16]  
TxCLK = HMODE [22:20]  
RxCLK = HMODE [26:24]  
Figure 8-4. Clock Usage Method Diagram  
8-9  
HDLC CONTROLLERS  
S3C4510B  
In the NRZ/NRZI mode, the DPLL source clock must be 32 times the data rates. In this mode, the transmit and  
receive clock outputs of the DPLL are identical, and the clocks are phased so that the receiver samples the data  
in the middle of the bit cell.  
The DPLL counts the 32x clock using an internal 5-bit counter. As the 32x clock is counted, the DPLL searches  
the incoming data stream for edges (either positive or negative transition). The output of DPLL is High while the  
DPLL is waiting for an edge in the incoming data stream. When it detects a transition, the DPLL starts the clock  
recovery operation.  
The first sampling edge of the DPLL occurs at the counter value of 16 after the first edge is detected in the  
incoming data stream. The second sampling edge occurs following the next 16. When the transition of incoming  
data occurs at a count value other than 16, the DPLL adjusts its clock outputs during the next 0 to 31 counting  
cycle by extending or shortening its count by one, which effectively moves the edge of the clock sampling the  
receive data closer to the center of the bit cell.  
The adding or subtracting of a count of 1 will produce a phase jitter of 5.63 degrees on the output. Because the  
DPLL uses both edges of the incoming signal for its clock source comparison, the mark-space ratio (50%) of the  
incoming signal must not deviate more than 1.5% of its baud rate if proper locking is to occur.  
In the FM mode, the DPLL clock must be 16 times the data rate. The 5-bit counter in the DPLL counts from 0 to  
31, so the DPLL makes two sampling clocks during the 0 to 31 counting cycle. The DPLL output is Low while the  
DPLL is waiting for an edge in the incoming data stream. The first edge the DPLL detects is assumed to be a  
valid clock edge. From this point, the DPLL begins to generate output clocks.  
In this mode, the transmit clock output of the DPLL lags the receive clock outputs by 90 degrees to make the  
transmit and receive bit cell boundaries the same, because the receiver must sample the FM data at a one-  
quarter and three-quarters bit time.  
You can program the 32X clock for the DPLL to originate from one of the RxC input pins, from the TxC pin, or  
from the baud rate generator output. You can also program the DPLL output to be "echoed out" of the HDLC  
module over the TXC pin(if the TXC pin is not being used as an input).  
During idle time, you can set the TxPRMB in HCON to send the special pattern required for a remote DPLL to  
lock the phase. In this case, the content of the HPRMB register is sent repeatedly. The length of preamble is  
determined by TxPL bit in HMODE[10:8].  
It is noticed that the frequency of the receive clock (RxC) should be slower than half of the internal system clock  
i.e., MCLK/2. Otherwise, the data transfer from receive FIFO to memory could be lost.  
8-10  
S3C4510B  
HDLC CONTROLLERS  
HDLC OPERATIONAL DESCRIPTION  
The following sections describe the operation of the HDLC module.  
HDLC INITIALIZATION  
A power-on or reset operation initializes the HDLC module and forces it into the reset state. After a reset, the  
CPU must write a minimum set of registers, as well as any options set, based on the features and operating  
modes required.  
First, the configuration of the serial port and the clock mode must be defined. These settings include the  
following:  
— Data format select  
— BRG clock select  
— DPLL clock select  
— Transmit clock select  
— Receive clock select  
— BRG/DPLL enable to use internal clock  
You must also set the clock for various components before each component is enabled. Additional registers may  
also have to be programmed, depending on the features you select. All settings for the HDLC mode register,  
HMODE, and the HDLC control register, HCON, must be programmed before the HDLC is enabled.  
To enable the HDLC module, you must write a '1' to the receiver enable bit and/or the transmitter enable bit.  
During normal operation, you can disable the receiver or the transmitter by writing a '0' to the RxEN or TxEN bit,  
respectively. You can disable the receiver and HRXFIFO or the transmitter and HTxFIFO by writing a '1' to the  
RxRS or TxRS bit, respectively.  
8-11  
HDLC CONTROLLERS  
S3C4510B  
HDLC DATA ENCODING/DECODING  
Data encoding is utilized to allow the transmission of clock and data information over the same medium. This  
saves the need to transmit clocks and data over a separate medium as would normally be required for  
synchronous data. The HDLC provides four different data encoding methods, selected by bits in HCON1[18:16].  
An example of these four encoding methods is shown in figure 8-5.  
Data  
NRZ  
Bit Cell Level:  
1
1
0
0
1
0
High = 1  
Low = 0  
No Change = 1  
Change = 0  
NRZI  
Bit Center Transition:  
Transition = 1  
No Transition = 0  
FM1  
(Biphase Mark)  
FM0  
(Biphase Space)  
No Transition = 1  
Transition = 0  
High  
Low  
Low = 1  
High = 0  
Manchester  
NRZ, NRZI Type  
TxClock  
Data  
RxClock  
FM0/FM1/Manchester type  
TxClock  
Data  
RxClock  
Figure 8-5. Data Encoding Methods and Timing Diagrams  
8-12  
S3C4510B  
HDLC CONTROLLERS  
HDLC DATA SETUP AND HOLD TIMING WITH CLOCK  
You can see the timing of TxD and RxD in terms of TxC and RxC HDLC clock in Figure 8-6.  
Table 8-3. HMODEA and HMODEB Register  
Symbol  
Ttxdf  
Condition  
TxD falling edge delay time  
TxD falling edge delay time  
Min  
9.82  
1.0  
Typ  
Max  
Unit  
ns  
10.66  
Trxdf  
ns  
40 ns  
TxC  
TxD  
9.82 ns  
10.66 ns  
RxC  
RxD  
0.2 ns  
1.0 ns  
Figure 8-6. Data Encoding Methods and Timing Diagrams  
Tx data will be sent with delayed 9.82 nsec to 10.66 nsec from the falling edge of Tx Clock. In case of RxD, the  
black period should not be changed. That is, the RxD should be stable from 0.2nsec to 1.0nsec after RxC rising  
edge. (It does not allow data transition during this period) The RxC will be Rx(receiver) clock through Rx clock  
selection part with some delay. And this RxC delay is larger then RxD delay. In Figure 8-6, the dotted-clock is  
real internal Rx clock used by the receiver. Therefore, there should not be transit in Rx data to avoid setup or  
hold violation.  
8-13  
HDLC CONTROLLERS  
S3C4510B  
HDLC TRANSMITTER OPERATION  
The HTxFIFO register cannot be pre-loaded when the transmitter is disabled. After the HDLC Tx is enabled, the  
flag or mark idle control bit (TxFLAG in HCON) is used to select either the mark idle state (inactive idle) or the  
flag 'time fill' (active idle) state. This active or inactive idle state will continue until data is loaded into the  
HTxFIFO.  
The content of the HPRMB register can be sent out by setting the TxPRMB in HCON for the remote DPLL before  
the data is loaded into the HTxFIFO. The length of preamble to be transmitted is determined by TxPL bits in  
HMODE.  
The availability of data in the HTxFIFO is indicated by the HTxFIFO available bit (TxFA in HSTAT) under the  
control of the 4-word transfer mode bit (Tx4WD in HCON).  
When you select 1-word transfer mode (not 4-word select mode), one word can be loaded into the HTxFIFO  
(assuming the TxFA bit is set to '1'). When you select 4-word transfer mode, four successive words can be  
transferred to the FIFO if the TxFA bit is set to '1'.  
The nCTS (clear-to-send) input, nRTS (request-to-send), and nDCD (data-carrier-detect) are provided for a  
modem or other hardware peripheral interface.  
In auto enable mode, nDCD becomes the receiver enable. However, the receiver enable bit must be set before  
the nDCD pin is used in this manner.  
The TxFC status bit(in HSTAT) can cause an interrupt to be generated upon frame completion (This bit is set  
when there is no data in HTxFIFO and when the closing flag or an abort is transmitted).  
8-14  
S3C4510B  
HDLC CONTROLLERS  
Transmitter Interrupt Mode  
The first byte of a frame (the address field) should be written into the Tx FIFO at the 'frame continue' address.  
Then, the transmission of the frame data starts automatically. The bytes of the frame continue to be written into  
the Tx FIFO as long as data is written to the 'frame continue' address. The HDLC logic keeps track of the field  
sequence within the frame.  
The frame is terminated when the last frame data is written to the Tx FIFO's 'frame terminate' address. The FCS  
field is automatically appended by hardware, along with a closing flag. Data for a new frame can be loaded into  
the Tx FIFO immediately after the previous frame data, if TxFA is '1'. The closing flag can serve as the opening  
flag of the next frame or separate opening and closing flags can be transmitted. If a new frame is not ready to be  
transmitted, a flag time fill or mark idle pattern is transmitted automatically.  
If the Tx FIFO becomes empty at any time during the frame transmission, an underrun occurs and the transmitter  
automatically terminates the frame by transmitting an abort. The underrun state is indicated when the transmitter  
underrun status bit (TxU) is '1'.  
Whenever you set the transmission abort control bit (TxABT in HCON), the transmitter immediately aborts the  
frame (transmits at least eight consecutive 1s), clearing the Tx FIFO. If the transmission abort extension control  
bit (TxABTEXT) is set at the time, an idle pattern (at least 16 consecutive 1s) is transmitted. An abort or idle in an  
out- of-frame condition can be useful to gain 8 or 16 bits of delay time between read and write operations.  
Transmitter DMA Mode  
To use DMA operation without CPU intervention, you have to make Tx buffer descriptor chain in advance. And  
set the DMA Tx buffer descriptor pointer (DMATxPTR) register to the address of the first buffer descriptor of the  
chain, and then DMA Tx channel should be enabled.  
When Tx underrun or CTS lost condition occurs during DMA operation, DMA Tx enable bit(HCON[6]) is cleared  
and DMA Tx operation is stopped. This situation is reported to system with DTxABT bit set (HSTAT[22]).  
In case of Tx underrun, abort signal sent and then idle pattern is sent if TxEN bit is set. In case of CTS lost, TxD  
output goes high state as long as CTS remains high level.  
8-15  
HDLC CONTROLLERS  
S3C4510B  
HDLC RECEIVER OPERATION  
The HDLC receiver is provided with data and a pre-synchronized clock by means of the RxD and the internal  
DPLL clock, the TxC pin, or the RxC pin. The data is a continuous stream of binary bits. One of the  
characteristics of this bit stream is that a maximum of five consecutive 1s can occur unless an abort, flag, or idle  
condition occurs. The receiver continuously searches (bit-by-bit) for flags and aborts.  
When a flag is detected, the receiver synchronizes the frame to the flag timing. If a series of flags is received,  
the receiver re-synchronizes the frame to each successive flag.  
If the frame is terminated because of a short frame condition (frame data is less than 32 bits after an opening  
flag), the frame is simply ignored. Noise on the data input line (RxD) during time fill can cause this kind of invalid  
frame.  
The received data which is clocked by the external TxC or RxC, or by an internal DPLL or BRG source enters a  
56-bit or 32-bit shift register before it is transferred into the HRXFIFO. Synchronization is established when a flag  
is detected in the first eight locations of the shift register. When synchronization has been achieved, data is  
clocked through to the last byte location of the shift register where it is transferred into the HRxFIFO.  
In 1-word transfer mode, when the HRxFIFO available bit (RxFA) is '1', data is available at least in one-word. In  
4-word transfer mode, the RxFA is '1' when data is available in the last four FIFO register locations (registers 4,  
5, 6, and 7). The nDCD input is provided for a modem or other hardware interface. If AutoEN bit in HCON[28] is  
set to '1', the receiver operation is dependent on the nDCD input level.  
Otherwise, receiver operation is free of the nDCD input level.  
Receiver Interrupt Mode  
Whenever data is available in the HRXFIFO, an interrupt is generated by RxFA (if the interrupt is enabled). The  
CPU reads the HDLC status register either in response to the interrupt request or in turn during a polling  
sequence.  
When the received data available bit(RxFA) is '1', the CPU can read the data from the HRXFIFO. If the CPU  
reads normal data or address data from the HRXFIFO, the RxFA bit is automatically cleared.  
In CRC mode, the 16 bits preceding the closing flag are regarded as the FCS and checked by hardware, and they  
are transferred to the HRXFIFO. Also, in no CRC mode, without the hardware checking, all data bits preceding  
the closing flag are transferred to the HRXFIFO. When the closing flag is sent to the receiver, the frame is  
terminated. Whatever data is present in the most significant byte of the receiver, the shift register is right justified  
and transferred to the HRXFIFO. The frame boundary pointer, which is explained in the HRXFIFO register  
section, is set simultaneously in the HRXFIFO. When the last byte of the frame appears at the 1-word or 4-word  
boundary location of the HRXFIFO, depending on the settings of the Rx4WD control bit, the frame boundary  
pointer sets the frame valid status bit (if the frame is completed with no error) or the RxCRCE status bit(if the  
frame was completed, but with a CRC error).  
If the frame reception is completed, an RxCRCE interrupt (for a frame error) or an RxFV interrupt (for normal  
state) is generated. At this point, the CPU can read the Rx remaining bytes (RxRB) status bits to know how many  
bytes of this frame still remain in the HRXFIFO.  
When you set the frame discontinue control bit (the incoming frame discard control bit) to '1', the receiver  
discards the current frame data without dropping the flag synchronization. You can use this feature to ignore a  
frame with a non-matched address.  
8-16  
S3C4510B  
HDLC CONTROLLERS  
Receiver DMA Mode  
To use DMA operation without CPU intervention, you have to make Rx buffer descriptor chain in advance. And  
set the DMA Rx buffer descriptor pointer (DMARxPTR) register to the address of the first buffer descriptor of the  
chain, and then DMA Rx channel should be enabled.  
HARDWARE FLOW CONTROL  
TxClock  
TxD  
last  
RTS  
CTS  
Figure 8-7. nCTS Already Asserted  
When nCTS is active and there exists data to be transmitted in Tx FIFO, nRTS enters Low, allowing data  
transmission. At the beginning of the data is an open flag while at the end a closing flag. If the frame being  
transferred discontinues, nRTS goes back to the High after the data transmission is completed.  
TxClock  
TxD  
RTS  
CTS  
Data  
5-13 cycles  
14 - 22 cycles  
Figure 8-8. CTS Lost during Transmission  
When the condition of nCTS is shifted from Low to High, it is detected at the falling edge of Tx clock, where  
nRTS also goes High. For about 5 to 13 cycles after nRTS enters High, the data transmission continues. nRTS  
remains High for a maximum of 22 cycles and goes back to the Low condition if there remains any data to be  
transmitted in HTxFIFO. If nCTS is still High even when nRTS went back to Low, not the data in HTxFIFO but a  
mark idle pattern is transmitted when AutoEn bit set to one.  
8-17  
HDLC CONTROLLERS  
S3C4510B  
TxClock  
TxD  
Data  
5 - 12 cycles  
RTS  
CTS  
Figure 8-9. CTS Delayed on  
If nCTS remains still High for a while after nRTS enters Low to allow data transmission from HTxFIFO, the data  
transmission starts 5-12 cycles after nCTS is shifted to Low  
8-18  
S3C4510B  
HDLC CONTROLLERS  
MEMORY DATA STRUCTURE  
The flow control to the HDLC controller uses two data structures to exchange control information and data.  
— Transmit buffer descriptor  
— Receive buffer descriptor  
Each Tx DMA buffer descriptor has the following elements.  
— Buffer data pointer  
— Ownership bit  
— Control field for transmitter  
— Status field for Tx  
— Transmit buffer length  
— Next buffer descriptor pointer  
Each Rx DMA buffer descriptor has the following elements.  
— Buffer data pointer  
— Ownership bit  
— Status field for Rx  
— Accumulated received buffer length for a frame  
— Next buffer descriptor pointer  
8-19  
HDLC CONTROLLERS  
S3C4510B  
DATA BUFFER DESCRIPTOR  
The ownership bit in the MSB of the buffer data pointer controls the ownership of the descriptor. When the  
ownership bit is '1', the DMA controller owns the descriptor. When this bit is '0', the CPU has the descriptor. The  
owner of the descriptor always owns the associated data frame. (The descriptor's buffer data pointer field always  
points to this buffer for about a frame.)  
As it receives the data, the software sets the maximum frame length register. If the received data is longer than  
the value of the maximum frame length register, this frame is ignored and the FLV bit is set. The software also  
sets the DMA Rx buffer descriptor pointer to point to a chain of buffer descriptors, all of which have their  
ownership bit.  
The DMA controller can be started to set the DMA Rx enable bit in the control register. When a frame is  
received, it is moved into memory at the address specified by the DMA Rx data buffer pointer. If a frame is  
longer than the value of the RxBuf Size register, then the next buffer descriptors are fetched to receive the  
frame.  
That is, to handle a frame, one or more buffer descriptors could be used. Please note that no configurable offset  
or page boundary calculation is required. The received frame is moved to the buffer memory whose address is  
pointed to by the buffer data pointer until the end of frame, or until the length exceeds the maximum frame length  
configured.If the length exceeds the maximum frame length configured, the frame length violated bit is set.  
If the entire frame is received successfully, the status bits in the receive buffer descriptor are set to indicate the  
received frame status. The ownership bit in the buffer descriptor pointer is cleared by the CPU which has the  
ownership and an interrupt may now be generated. The DMA controller copies the next buffer descriptor pointer  
into the DMA Rx buffer descriptor pointer register.  
If the next buffer descriptor pointer is null(0), the DRxEN bit is cleared, and DMA Rx operation is stopped.  
Otherwise, the descriptor is read, and the DMA controller starts again with the next data, as described in the  
previous paragraph.  
When the DMA reads a descriptor, if the ownership bit is not set, it has two options:  
— Skip to the next buffer descriptor when DRxSTSK bit is '0'  
— Generate an interrupt and halt the DMA operation when DRxSTSK bit is '1'  
During transmission, the two-byte frame length at the Tx buffer descriptor is moved to the DMA internal Tx  
register. After transmission, the Tx status is saved in the Tx buffer descriptor. The DMA controller then updates  
the next buffer descriptor pointer for the linked list structure.  
When the DMA Tx buffer descriptor register points to the first buffer descriptor, the transmitter starts transmitting  
the frame data from the buffer memory to Tx FIFO.  
8-20  
S3C4510B  
HDLC CONTROLLERS  
BUFFER DESCRIPTOR  
TRANSMIT BUFFER DESCRIPTOR  
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  
O
Buffer Data Pointer  
Reserved  
WA D L E N P  
Reserved  
T
Buffer Length  
Next Buffer Descriptor Pointer  
[30:0] Buffer Data Pointer  
[31] Ownership (O)  
0 = CPU  
1 = DMA  
Tx Control Bits  
[0] Preamable (P)  
0 = No preamble  
1 = Preamble  
[1] TxNoCRC Mode (N)  
0 = CRC mode  
1 = No CRC mode  
1 = Little-endian  
[2] Little-Endian Mode (E)  
0 = Big-endian  
[3] Last (L)  
0 = This is not the last buffer in the frame.  
1 = This is the last buffer in the frame.  
[4] Buffer Data Pointer Decrement (D)  
0 = Increment  
1 = Decrement  
[6:5] Widget Aligment Control (WA)  
00 = No invalid bytes  
10 = 2 invalid bytes  
01 = 1 invalid bytes  
11 = 3 invalid bytes  
[23:0] Buffer Length  
Tx Status Bit  
These bit may be regarded as valid when the L bit (in Tx control bit) is set.  
[26] Transmission Completion (T)  
0 = Normal  
1 = One frame completed  
[31:0] Next Buffer Descriptor Pointer  
The address of the next buffer descriptor  
Figure 8-10. Transmit Buffer Descriptor  
8-21  
HDLC CONTROLLERS  
S3C4510B  
RECEIVE BUFFER DESCRIPTOR  
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
O
Buffer Data Pointer  
Reserved  
F
L
V
A D  
L F B T  
T M  
Reserved  
O N C  
V O D  
Buffer Length  
Next Buffer Descriptor Pointer  
[30:0] Buffer Data Pointer  
[31] Ownership (O)  
0 = CPU  
1 = DMA  
[15:0] Buffer Length  
Received buffer lengths are wrote to this buffer descriptor  
Rx Status Bits  
This bits may be regarded as valid when L bit (in Rx status bit) is set.  
[16] CD Lost (CD)  
0 = Normal  
1 = CD lost occurs  
[17] CRC Error (CE)  
0 = Normal  
1 = CRC error occurs to the frame received.  
[18] Non-octet Aligned Frame (NO)  
0 = Normal  
1 = Non-octet aligned frame is reveived.  
[19] Over-run (OV)  
0 = Normal  
1 = The reveived frame overruns.  
[20] DPLL Two Miss (DTM)  
0 = Normal  
1 = DPLL two miss clock occurs.  
[21] Rx Abort (ABT)  
0 = Normal  
1 = The received frame aborted.  
[22] First In Frame (F)  
0 = This buffer descriptor status is not the first to the frame.  
1 = This buffer descriptor status is the first to the frame.  
[23] Last In Frame (L)  
0 = This buffer descriptor status is not the last to the frame.  
1 = This buffer descriptor status is the first to the frame.  
[24] Frame Length Violation (FLV)  
0 = Normal  
1 = This received frame length exceeds the value of the maximum frame length register.  
[31:0] Next Buffer Descriptor Pointer  
The address of the next buffer descriptor  
Figure 8-11. Receive Buffer Descriptor  
8-22  
S3C4510B  
HDLC CONTROLLERS  
Rx Buffer  
Descriptor  
Start Address  
Pointer  
Buffer Data Pointer #1  
Reserved  
Rx Bufsize  
Register  
Value  
Buffer Data #1  
Unused  
Status  
Buffer Length  
Next Buffer Descriptor  
Rx Bufsize  
Register  
Value  
Buffer Data Pointer #2  
Reserved  
Buffer Data #2  
Unused  
Status  
Buffer Length  
Next Buffer Descriptor  
Buffer Data #N  
Unused  
Buffer Data Pointer #N  
Reserved  
Status  
Buffer Length  
In single linked lists, the next buffer  
descriptor is filled with a null  
address.  
Next Buffer Descriptor  
NOTE:  
Buffer length is accumulated until the last bit is set in STATUS.  
Buffer data pointer indicates the buffer memory start address.  
Figure 8-12. Data Structure of the Receive Data Buffer  
8-23  
HDLC CONTROLLERS  
S3C4510B  
HDLC SPECIAL REGISTERS  
The HDLC special registers are defined as read-only or write-only registers according to the direction of  
information flow. The addresses of these registers are shown in Table 8-4 and 8-5.  
The transmitter FIFO register can be accessed using two different addresses, the frame terminate address and  
the frame continue address. The functions of these addresses are discussed in detail in the FIFO section below.  
Table 8-4. HDLC Channel A Special Registers  
Registers  
HMODE  
Offset  
0´ 7000  
R/W  
R/W  
R/W  
R/W  
R/W  
W
Description  
HDLC mode register  
Reset Value  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
HCON  
HDLC control register  
0´ 7004  
0´ 7008  
0´ 700c  
0´ 7010  
HSTAT  
HINTEN  
HDLC status register  
HDLC interrupt enable register  
HTxFIFO frame continue register  
HTxFIFOC  
(Frame Continue)  
HTxFIFOT  
(Frame  
W
HTxFIFO frame terminate register  
0´ 7014  
Terminate)  
HRxFIFO  
HBRGTC  
HPRMB  
R
HRxFIFO entry register  
0´ 7018  
0´ 701c  
0´ 7020  
0´ 7024  
0´ 7028  
0´ 702c  
0´ 7030  
0´ 7034  
0´ 7038  
0´ 703c  
0´ 7040  
0´ 7044  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ FFFFFFFF  
0´ FFFFFFFF  
0´ XXXX0000  
0´ XXXX0000  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
HDLC BRG time constant register  
HDLC preamble register  
HSAR0  
HDLC station address 0  
HSAR1  
HDLC station address 1  
HSAR2  
HDLC station address 2  
HSAR3  
HDLC station address 3  
HMASK  
HDLC mask register  
HDMATxPTR  
HDMARxPTR  
HMFLR  
DMA Tx buffer descriptor pointer  
DMA Rx buffer descriptor pointer  
Maximum frame length register  
Receive buffer size register  
HRBSR  
8-24  
S3C4510B  
HDLC CONTROLLERS  
Table 8-5. HDLC Channel B Special Registers  
Registers  
Offset  
0´ 8000  
R/W  
R/W  
R/W  
R/W  
R/W  
W
Description  
HDLC mode register  
Reset Value  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
HMODE  
HCON  
HDLC control register  
0´ 8004  
0´ 8008  
0´ 800c  
0´ 8010  
HSTAT  
HINTEN  
HDLC status register  
HDLC interrupt enable register  
HTxFIFO frame continue register  
HTxFIFOC  
(Frame Continue)  
HTxFIFOT  
(Frame  
W
HTxFIFO frame terminate register  
0´ 8014  
Terminate)  
HRxFIFO  
HBRGTC  
HPRMB  
R
HRxFIFO entry register  
0´ 8018  
0´ 801c  
0´ 8020  
0´ 8024  
0´ 8028  
0´ 802c  
0´ 8030  
0´ 8034  
0´ 8038  
0´ 803c  
0´ 8040  
0´ 8044  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ 00000000  
0´ FFFFFFFF  
0´ FFFFFFFF  
0´ XXXX0000  
0´ XXXX0000  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
HDLC BRG time constant register  
HDLC preamble register  
HSAR0  
HDLC station address 0  
HSAR1  
HDLC station address 1  
HSAR2  
HDLC station address 2  
HSAR3  
HDLC station address 3  
HMASK  
HDLC mask register  
HDMATxPTR  
HDMARxPTR  
HMFLR  
DMA Tx buffer descriptor pointer  
DMA Rx buffer descriptor pointer  
Maximum frame length register  
Receive buffer size register  
HRBSR  
8-25  
HDLC CONTROLLERS  
S3C4510B  
HDLC GLOBAL MODE REGISTER  
Table 8-6. HMODEA and HMODEB Register  
Registers  
HMODEA  
HMODEB  
Offset  
0´ 7000  
0´ 8000  
R/W  
R/W  
R/W  
Description  
HDLC Mode register  
HDLC Mode register  
Reset Value  
0´ 00000000  
0´ 00000000  
Table 8-7. HMODE Register Description  
Description  
Bit  
Bit Name  
Number  
[0]  
Multi-Frame in HTxFIFO If this bit is set, more than one frame can be loaded into HTxFIFO. In this  
in DMA operation (MFF) case, the frame size may be less than the FIFO size.  
[1]  
[2]  
Reserved  
Not applicable.  
Rx clock  
inversion(RXCINV)  
If this bit set to '0', the receive clock samples the data at the rising edge.  
If this bit set to '1', the receive clock samples the data at the falling edge.  
[3]  
[4]  
Tx clock  
inversion(TXCINV)  
If this bit set to '0', the transmit clock shifts the data at the falling edge.  
If this bit set to '1', the transmit clock shifts the data at the rising edge.  
Rx Little-Endian mode  
(RxLittle)  
This bit determines whether the data is in Little- or Big-endian format.  
HRXFIFO is in Little-endian. If this bit is set to '0', then the data on the  
system bus should be in Big-endian. Therefore the bytes will be swapped  
in Big- endian.  
[5]  
Tx Little-Endian mode  
(TxLittle)  
This bit determines whether Tx data is in Little or Big endian (TxLittle)  
format. HTxFIFO is in Little-endian. If this bit is set to '1', the data on the  
system bus is Little endian. If this bit is set to '0', the data on the system  
bus is in Big-endian. (that is, the data bytes are swapped to be Little  
endian format.)  
[7:6]  
Reserved  
Not applicable  
[10:8] Tx preamble  
length(TxPL)  
These bits determine the length of preamble to be sent before the opening  
flag when the TxPRMB bit is set in the control register.  
000 1byte, 001 2bytes,and 111 8bytes will be sent.  
Not applicable  
[11]  
Reserved  
[14:12] Data formats (DF)  
When the DF bits are '000', data is transmitted and received in the NRZ  
data format. When DF is '001', the NRZI (zero complement) data format is  
selected. DF = '010' selects the FM0 data format, DF = '011' the FM1 data  
format, and DF = '100' the Manchester data format.  
[15]  
Reserved  
Not applicable  
[18:16] DPLL clock select  
(DPLLCLK)  
Using this setting, you can configure the clock source for DPLL to one of  
the following pins: TxC, RxC, MCLK, BRGOUT1, or BRGOUT2. To select  
one of these pins, set the DPLLCLK bits to '000', '001', '010', '011', or '100',  
respectively.  
8-26  
S3C4510B  
HDLC CONTROLLERS  
Table 8-7. HMODE Register Description (Continued)  
Description  
Bit  
Bit Name  
Number  
[19]  
BRG clock select  
(BRGCLK)  
If this bit is '1', MCLK2 is selected as the source clock for the baud rate  
generator (BRG). If this bit is '0', the external clock at the RXC pin is  
selected as the BRG source clock.  
[22:20] Tx clock select (TxCLK) Using this setting, you can configure the transmit clock source to one of the  
following pins: TxC, RxC, DPLLOUTT, BRGOUT1, or BRGOUT2.  
To select one of these pins, set the TxCLK bits to '000', '001', '010', '011',  
or '100', respectively.  
[26:24] Rx clock select (RxCLK) Using this setting, you can configure the receive clock source to one of the  
following pins: TXC, RXC, DPLLOUTR, BRGOUT1, or BRGOUT2.  
To select one of these pins, set the RxCLK bits to '000', '001', '010', '011',  
or '100', respectively.  
[30:28] TxC output pin select  
(TxCOPS)  
If you do not use the clock at the TxC pin as the input clock, you can use  
the TxC pin to monitor TxCLK, RxCLK, BRGOUT1, BRGOUT2,  
DPLLOUTT, and DPLLOUTR. To select the clock you want to monitory,  
set the TXCOPS to '000', '001', '010', '011', or '100', respectively.  
[31]  
Reserved  
Not applicable.  
8-27  
HDLC CONTROLLERS  
S3C4510B  
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
T
x
L
i
R
x
L
i
R
x
C
I
B
R
G
C
L
T
x
C
I
M
F
F
TXC  
OPS  
DPLL  
CLK  
RxCLK  
TxCLK  
DF  
TxPL  
t
t
t
t
N
N
l
K
l
V V  
e
e
[0] Muilt-Frame in TxFIFO in DMA Operation (MFF)  
0 = Single frame in TxFIFO  
1 = Multi frame in TxFIFO  
[1] Reserved  
[2] Rx Clock Inversion (RxCINV)  
0 = Rx clock rising  
1 = Rx clock falling  
[3] Tx Clock Inversion (TxCINV)  
0 = Tx clock falling  
1 = Tx clock rising  
[4] Rx Little-Endian Mode (RxLittle)  
0 = The Rx data on the system bus is in Big-Endian format.  
1 = The Rx data on the system bus is in Little-Endian format.  
[5] Tx Little-Endian Mode (TxLittle)  
0 = The Tx data on the system bus is in Big-Endian format.  
1 = The Tx data on the system bus is in Little-Endian format.  
[7:6] Reserved  
[10:8] Tx Preamble Length (TxPL)  
000 = 1 byte  
001 = 2 byte  
010 = 3 byte  
011 = 4 byte  
100 = 5 byte  
101 = 6 byte  
110 = 7 byte  
111 = 8 byte  
[11] Reserved  
[14:12] Data Format (DF)  
000 = NRZ data format  
010 = FM0  
001 = NRZI  
001 = FMI  
100 = Machester  
[15] Reserved  
[18:16] DPLL Clock Select (DPLLCLK)  
000 = TXC pin  
001 = RXC pin  
010 = MCLK  
011 = BRGOUT1  
100 = BRGOUT2  
[19] BRG Clock Select (BRGCLK)  
0 = RXC pin is selected.  
1 = MCLK2 is selected.  
[22:20] Tx Clock Select (TxCLK)  
000 = TXC pin  
001 = RXC pin  
010 = DPLLOUTT  
100 = BRGOUT2  
[27] Reserved  
011 = BRGOUT1  
[30:28] TXC Output Pin Select (TXCOPS)  
This pin is used for output only when it is not used as an input clock for th  
DPLL, TxCLK, or RxCLK.  
000 = Tx clock  
001 = Rx clock  
010 = BRGOUT1  
100 = DPLLOUTT  
[31] Reserved  
011 = BRGOUT2  
101 = DPLLOUTR  
Figure 8-13. HMODE Register  
8-28  
S3C4510B  
HDLC CONTROLLERS  
HDLC CONTROL REGISTER  
Table 8-8. HCONA and HCONB Register  
Registers  
HCONA  
HCONB  
Offset  
R/W  
R/W  
R/W  
Description  
Reset Value  
0x00000000  
0x00000000  
HDLC channel A control register  
HDLC channel B control register  
0´ 7004  
0x8004  
Table 8-9. HCON Register Description  
Description  
Bit  
Bit Name  
Number  
[0]  
Tx reset (TxRS)  
Rx reset (RxRS)  
Set this bit to '1' to reset the Tx block. Tx block comprises HTxFIFO and a  
transmitter block.  
[1]  
Set this bit to '1' to reset the Rx block. Rx block comprises HRXFIFO and a  
receiver block.  
[2]  
[3]  
[4]  
DMA Tx reset (DTxRS) Set this bit to '1' to reset the DMA Tx block.  
DMA Rx reset (DRxRS) Set this bit to '1' to reset the DMA Rx block.  
Tx enable (TxEN)  
When the TxEN bit is '0', the transmitter enters a disabled state and the  
line becomes high state. In this case, the transmitter block is cleared  
except for the HTxFIFO and the status bits associated with transmit  
operation are cleared. Data cannot be loaded into the HTxFIFO.  
If this bit is set to '1', the idle pattern is sent continuously. In this case, the  
data can be loaded into HTxFIFO, and then sent.  
[5]  
[6]  
Rx enable (RxEN)  
When the RxEN bit is '0', the receiver enters a disabled state and can not  
detect the flag pattern, if any. In this case, receiver block is cleared except  
for the HRXFIFO and the status bits associated with receiver operation are  
cleared. Data cannot be received.  
If this bit is set to '1', the flag pattern is detected. In this case, the data  
received can be loaded into the HRXFIFO, and moved to system memory.  
DMA Tx enable  
(DTxEN)  
The DTxEN bit lets the HDLC Tx operate on a bus system in DMA mode.  
When DMA Tx is enabled, an interrupt request caused by TxFA status is  
inhibited and the HDLC does not use the interrupt request to request a data  
transfer. DMA Tx monitors the HTxFIFO and fills the HTxFIFO. This bit is  
auto disabled when Tx underrun occurs, or CTS lost, or next buffer  
descriptor pointer reach null, or the owner bit is not DMA mode when  
DTxSTSK bit is set. If Tx underrun occurs, DTxABT(in HSTAT) bit set, and  
abort signal sended. If CTS lost occurs, DTxABT bit set and TxD output  
goes high state as long as CTS remains high level.  
8-29  
HDLC CONTROLLERS  
S3C4510B  
Table 8-9. HCON Register Description (Continued)  
Bit Name Description  
Bit  
Number  
[7]  
DMA Rx enable  
(DRxEN)  
The DRxEN bit lets the HDLC Rx operate on a bus system in DMA mode.  
When DMA Rx is enabled, an interrupt request caused by the RxFA status  
is inhibited, and the HDLC does not use the interrupt request to request a  
data transfer. DMA Rx monitors the HRXFIFO and moves the data from  
the HRXFIFO to memory. This bit is automatically disabled when the next  
buffer descriptor pointer becomes null, or the owner bit is not in DMA mode  
when the DTxSTSK bit is set.  
[8]  
DPLL enable (DPLLEN) Setting this bit enables the DPLL, causing the DPLL to enter search mode.  
In Search mode, the DPLL searches for a locking edge in the incoming  
data stream.  
After DPLL is enabled (in NRZI mode for example), the DPLL starts  
sampling immediately after the first edge is detected. (In FM mode, the  
DPLL examines the clock edge of every other bit to decide what correction  
must be made to remain in sync.) If the DPLL does not detect an edge  
during the expected window, it sets the one clock missing bit.  
If the DPLL does not detect an edge after two successive attempts, it sets  
the two clock missing bit and the DPLL automatically enters the Search  
mode. To reset both clocks missing latches, you can disable and re-enable  
the DPLL using the reset Rx status.  
[9]  
BRG enable (BRGEN)  
This bit controls the operation of the baud rate generator (BRG). To enable  
the BRG counter, set the BRGEN bit to '1'. To inhibit counting, clear the bit  
to '0'.  
[10]  
Tx 4 word mode  
(Tx4WD)  
When this bit is '0', and TxFA bit in status register is '1', it is indicated that  
Tx FIFO is empty for 1 word. It means that 1-word data can be loaded to  
Tx FIFO.  
Similarly, when this bit is '1', the same status register bit indicate that 4  
words of data can be loaded to Tx FIFO without reading the status bit for a  
second time.  
Specifically, the status register bit affected by the 1-word or 4-word transfer  
setting are the transmit data available (TxFA) bit.  
[11]  
Rx 4 word mode  
(Rx4WD)  
When this bit is '0', and the RxFA bit in the status register is '1', it is  
indicated that Rx FIFO has 1-word data. It means that 1 word data can be  
moved to memory.  
Similarly, when this bit is '1', the same status register bit indicates that 4  
words of data can be moved in the memory without reading the status bit  
for a second time.  
Specifically, the status register bit affected by the 1-word or 4-word transfer  
setting are the receive data available (RxFA) bit, and the residue bytes  
status bits, RxRB[3:0].  
8-30  
S3C4510B  
HDLC CONTROLLERS  
Table 8-9. HCON Register Description (Continued)  
Bit Name Description  
Bit  
Number  
[13:12] Rx widget alignment  
(RxWA)  
These bits determine how many bytes are invalid in the first memory word  
of the frame to be received. The invalid bytes are inserted when the word  
is assembled in the HRXFIFO. '00' =No Invalid bytes;  
'01' = 1 invalid byte, '10' = 2 invalid bytes, '11' = 3 invalid bytes.  
[14]  
[15]  
[16]  
[17]  
DMA Tx stop or skip  
(DTxSTSK)  
This bit determines a DMA Tx stop or skip when DMA has not the  
ownership associated with the Tx buffer descriptor. DMA Tx is disabled in  
this condition when this bit is set.  
DMA Rx stop or skip  
(DRxSTSK)  
This bit determines a DMA Rx stop or skip when DMA has not the  
ownership associated with the Rx buffer descriptor. If this bit is set, DMA  
Rx is disabled.  
DMA Rx memory  
address decrement  
(DRxMADEC)  
This bit determines whether the address is incremented or decremented. If  
this bit is set to '1', then the address will be decremented.  
Tx flag idle (TxFLAG)  
This bit selects the flag 'time fill' mode (active idle) or the mark idle mode  
(inactive idle) for the transmitter. The selected active or inactive idle state  
continues until data is sent (after nRESET has return to High level). The  
flag idle pattern is 7EH; the mark idle pattern is FFH.  
[18]  
[19]  
Tx single flag  
(TxSFLAG)  
This bit controls whether separate closing and opening flags are  
transmitted in succession to delimit frames. When this bit is '0',  
independent opening and closing flags are transmitted in order to separate  
frame.  
When this bit is set to '1', the closing flag of the current frame serves as  
the opening flag of the next frame.  
Tx loop-back mode  
(TxLOOP)  
This bit is used for self-testing. If this bit is set to '1', the transmit data  
output (TxD) is internally connected to the receiver data input (RxD). In  
Loop-back mode, nCTS and nDCD inputs are ignored. For normal  
operation, this bit should always be '0'.  
[20]  
[21]  
[22]  
Rx echo mode  
(RxECHO)  
Setting this bit to '1' selects the auto-echo mode of operation. In this mode,  
the TxD pin is connected to RxD as in local loop-back mode, but the  
receiver still monitors the RxD input.  
Tx abort extension  
(TxABTEXT)  
When this bit is set to '1', the abort pattern that is initiated when TxABT =  
'1' is extended to at least 16 bits of 1s in succession, and the mark idle  
state is entered.  
Tx abort (TxABT)  
When this bit is set to '1', an abort sequence of at least eight bits of 1s is  
transmitted. The abort is initiated and the HTxFIFO is cleared. TxABT is  
then cleared automatically by hardware.  
8-31  
HDLC CONTROLLERS  
S3C4510B  
Table 8-9. HCON Register Description (Continued)  
Bit Name Description  
Bit  
Number  
[23]  
Tx preamble (TxPRMB) When this bit is set to '1', the content of the HPRMB register is transmitted  
as many TxPL bit values in interrupt mode instead of mark idle or time fill  
mode. This is useful for sending the data needed by the DPLL to lock the  
phase. In DMA mode, this bit is meaningless.  
[24]  
[25]  
Tx data terminal ready  
(TxDTR)  
The TxDTR bit directly controls the nDTR output state. Setting this bit  
forces the nDTR pin to Low level. When you clear the TxDTR bit, nDTR  
goes High.  
Rx frame discontinue  
(RxDISCON)  
When this bit is set, the frame currently received is ignored and the data in  
this frame is discarded. Only the last frame received is affected. There is  
no effect on subsequent frames, even if the next frame enters the receiver  
when the discontinue bit is set. This bit is automatically cleared after a  
cycle.  
[26]  
[27]  
[28]  
Tx no CRC (TxNOCRC) When this bit is set to '1', the CRC is not appended to the end of a frame  
by hardware.  
Rx no CRC (RxNOCRC) When this bit is set to '1', the receiver does not check for CRC by  
hardware. (CRC data is always moved to the HRxFIFO.)  
Auto enable (AutoEN)  
This bit programs the function of both nDCD and nCTS. However, TxEN  
and RxEN must be set before the nCTS and nDCD pins can be used.  
When this bit is '0', if the nCTS becomes high, the transmitter sends mark  
idle pattern. However, though the nDCD becomes high, the receiver can  
receive the data.  
When this bit is '1', if the nCTS becomes high, the transmitter send mark  
idle but clears the HTxFIFO and the Tx block. If nDCD becomes high, the  
receiver can't operate, and the HRxFIFO and Rx blocks are cleared.  
[31:29] Reserved  
Not applicable.  
8-32  
S3C4510B  
HDLC CONTROLLERS  
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  
A R T R T T T  
R T T T D D D  
R
x
W
A
R T B  
R
x
D D D  
P R T  
T D D R T  
x R T  
T
x
u
t
x
x
x
x
x
x
x
x
x
x R R T  
x
4
x R  
4 G  
x x  
N N D D P A  
E L S F  
x
x
x
E
L
x
x
E x x R R  
A
B
T
E
X
T
o O O  
I
T R B  
C O F L M S S  
H O L A A T T  
O P A G D S S  
W W E  
D D N  
N N R R S S  
S S  
L E E  
E N N  
N
E C C S R M T  
N R R C  
C C O  
N
B
G
E K K  
C
[0] Tx reset (TxRS)  
0 = Normal  
[1] Rx reset (RxRS)  
0 = Normal operation  
[2] DMA Tx reset (DTxRS)  
0 = Normal operation  
[3] DMA Rx reset (DRxRS)  
0 = Normal operation  
1 = TxFIFOmand Tx block are reset.  
1 = RxFIFO and Rx block are reset.  
1 = DMA Tx block is reset.  
1 = DMA Rx block is reset.  
1 = Tx enabled  
[4] Tx enable (TxEN)  
0 = Tx disabled  
[5] Rx enable (RxEN)  
0 = Rx disabled  
1 = Rx enabled  
[6] DMA Tx enable (DTxEN)  
0 = DMA Tx disabled  
1 = DMA Tx enabled  
[7] DMA Rx enable (DRxEN)  
0 = DMA Rx disabled  
1 = DMA Rx enabled  
[8] DPLL enable (DPLLEN)  
0 = Disable  
1 = Enable; DPLL enters search mode for a locking edge in the incoming data stream.  
[9] BRG enable (BRGEN)  
0 = BRG counter is inbibited.  
1 = BRG counter is enabled.  
[10] Tx 4 word burst mode (Tx4WD)  
0 = 1-word mode selected.  
1 = 4-word mode selected.  
[11] Rx 4 word burst mode (Rx4WD)  
0 = 1-word mode selected.  
1 = 4-word mode selected.  
[13:12] Rx widget algnment (RxWA)  
00 = No invalid byte  
01 = 1 invalid byte  
10 = 2 invalid byte  
11 = 3 invalid byte  
[14] DMA Tx stop or skip (DTxSTSK)  
0 = DMA Tx skips when DMA not owner bit is set.  
1 = DMA Tx stops when DMA not owner bit is set.  
[15] DMA Rx stop or skip (DRxSTSK)  
0 = DMA Rx skips when DMA not owner bit is set.  
1 = DMA Rx stops when DMA not owner bit is set.  
[16] DMA Rx memory address decrement (DRxMADEC)  
0 = Address is incremented.  
1 = Address is decremented.  
[17] Tx flag idle (TxFLAG)  
0 = Enter mark idle mode (a bit pattern of consecutive ones)  
1 = Enter time fill mode (a bit pattern of consecutive opening (closing) flag, as in string  
01111110 01111110......  
Figure 8-14. HDLC Control Register (HCON)  
8-33  
HDLC CONTROLLERS  
S3C4510B  
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
A R T R T T T  
R T T T D D D  
R
x
W
A
R T B  
R
x
D D D  
P R T  
T D D R T  
x R T  
T
x
u
t
x
x
x
x
x
x
x
x
x
x R R T  
x
4
x R  
4 G  
x x  
N N D D P A  
E L S F  
x
x
x
E
L
x
x
E x x R R  
A
B
T
E
X
T
o O O  
I
T R B  
C O F L M S S  
H O L A A T T  
O P A G D S S  
W W E  
D D N  
N N R R S S  
S S  
L E E  
E N N  
N
E C C S R M T  
N R R C  
C C O  
N
B
G
E K K  
C
[18] Tx single flag (TxSFLAG)  
0 = Double flag mode (a closing & opening flags are used to separate frames)  
1 = Single flag mode (only one flags are used to separate frames)  
[19] Tx loop-back mode (TxLOOP)  
0 = Normal operation.  
1= The tramsmit data output is internally connected to the receiver data input for self  
testing.  
[20] Rx echo mode (RxECHO)  
0 = Disable Tx auto-echo mode.  
1 = Enable Rx DMA Tx block is reset.  
[21] Tx abort extension (TxABTEXT)  
0 = At least consecutive eigth 1s are transferred.  
1 = At least 16 consecutive 1s are transferred.  
[22] Tx abort (TxABT)  
0 = Normal  
1 = Enable (at least eight consecutive 1s are transmitted.)  
[23] Tx preamble (TxPRMB)  
0 = Transmit a mark idle is time fill bit pattern.  
1 = Transmit the content of HPRMB  
[24] Tx data terminal ready (TxDTR)  
0 = nDTR goes high level.  
1 = nDTR goes low level.  
[25] Rx frame discontinue (TxDISCON)  
0 = Normal  
1 = Ignore the currently received frame  
[26] Tx No CRC (TxNOCRC)  
0 = Disable  
1 = CRC is not appended by hardware.  
[27] Rx No CRC (RxNOCR)  
0 = Disable  
1 = Receiver does not check CRC by hardware.  
(CRC is treated as data in any case)  
[28] Auto enable (AutoEN)  
0 = Normal operation. The nCTS and nDCD become high, the transmitter sends mark  
idle and receiver receives data.  
1 = The nDCD and nCTS become high, RxFIFO, Rx block, TxFIFO, and Tx block are  
cleared. The transmitter sends mark idle, and the receiver does not operate.  
[31:29] Reserved  
Figure 8-15. HDLC Control Register (HCON) (Continued)  
8-34  
S3C4510B  
HDLC CONTROLLERS  
HDLC STATUS REGISTER (HSTAT)  
NOTE  
Reading the HDLC status register is a non-destructive process. The method used to clear a High-level  
status condition depends on the bit's function and operation mode (DMA or interrupt). For details, please  
see the description of each status register.  
Table 8-10. HSTATA and HSTATB Register  
Registers  
HSTATA  
HSTATB  
Offset  
0x7008  
0x8008  
R/W  
R/W  
R/W  
Description  
Reset Value  
0X00000000  
0X00000000  
HDLC Channel A Status Register  
HDLC Channel B Status Register  
SUMMARY  
There are two kinds of bits in a status register.  
1. TxFA, TxCTS, RxFA, RxDCD, RxFV, RxCRCE, RxNO, RxIERR, and RxOV bits are show each bit's  
status. These bits are set or cleared automatically according to the each bit status.  
2. All other bits are cleared by the CPU writing '1' to each bit.  
8-35  
HDLC CONTROLLERS  
S3C4510B  
Table 8-11. HSTAT Register Description  
Description  
Bit  
Bit Name  
Number  
[3:0]  
Rx remaining bytes  
(RxRB)  
(RxRB + 1) indicates how many data bytes are valid in a 1-word or 4-word  
boundary when the receiver has received a complete frame. In 1-word  
transfer mode, the RxRB value is either 0, 1, 2, or 3. In 4-word mode, it is  
0, 1, ..., 14, or 15.  
[4]  
[5]  
Tx frame complete  
(TxFC)  
This status bit is automatically set to '1' when the two conditions are met:  
1) there is no data in the Tx FIFO, and 2) either an abort or a closing flag is  
transmitted. You can clear this bit by writing '1' to this bit.  
Tx FIFO available  
(TxFA)  
If this bit is '1', the data to be sent can be loaded into the HTxFIFO  
register. In 1-word transfer mode, the TxFA status bit is set to '1' when the  
first register of the HTxFIFO is empty.  
In 4-word transfer mode, TxFA = '1' when the first four 32-bit registers of  
the HTxFIFO are empty. The TxFA status condition is automatically  
cleared when HTxFIFO is no longer available. During DMA Tx operation,  
this bit is always ’0', so not generating interrupt.  
[6]  
Tx clear-to-send  
(TxCTS)  
The nCTS input is projected to this status bit. If the level at the nCTS input  
pin is Low, this status bit is'1'. If nCTS input pin is High level, TxCTS is '0'.  
This bit does not generate an interrupt.  
[7]  
[8]  
Tx stored clear-to-send This bit is set to '1' each time a transition in nCTS input occurs. You can  
(TxSCTS)  
clear this bit by writing '1' to this bit.  
Tx under-run (TxU)  
When the transmitter runs out of data during a frame transmission, an  
underrun occurs and the frame is automatically terminated by transmitting  
an abort sequence. The underrun condition is indicated when TxU is '1'.  
You can clear this bit by writing a '1' to this bit.  
[9]  
Rx FIFO available  
(RxFA)  
This status bit indicates when the data received can be read from the Rx  
FIFO. When RxFA is '1', it indicates that data (other than an address or a  
final data word) is available in the HRXFIFO. In 1-word transfer mode,  
RxFA bit set to '1' when received data is available in the last FIFO register.  
In 4-word transfer mode, it is set to '1' when the data received is available  
in the last four 32-bit FIFO registers. Even if the data reside in FIFO for  
only two words, when the Last bit is set, Rx FIFO is regarded as valid. (The  
received data available condition is cleared automatically when the data  
received is no longer available.) During DMA Rx operation, this bit is  
always '0', so does not generate an interrupt.  
[10]  
Reserved  
No applicable.  
8-36  
S3C4510B  
HDLC CONTROLLERS  
Table 8-11. HSTAT Register Description (Continued)  
Bit Name Description  
Bit  
Number  
[11]  
Rx flag detected (RxFD) This bit is set to '1' when the last bit of the flag sequence is received. This  
bit generates an interrupt if enabled. You can clear this bit by writing a  
'1' to this bit.  
[12]  
[13]  
[14]  
[15]  
Rx data carrier detected The DCD status bit mirrors the state of the nDCD input pin. If nDCD input  
(RxDCD)  
pin is low, this status bit is '1'. If nDCD input pin is High, it is '0'. This bit  
does not generate an interrupt.  
Rx stored data carrier  
detected (RxSDCD)  
This bit is set to '1' when a transition in nDCD input occurs, and can  
generate interrupt, if enabled. You can clear this bit by writing a '1' to this  
bit.  
Rx frame valid (RxFV)  
Rx idle (RxIDLE)  
This bit signals frame's ending boundary to the CPU and also indicates that  
no frame error occurred. It is set when the last data byte of a frame is  
transferred into the last location of the Rx FIFO and is available to be read.  
The RxIDLE status bit indicates that a minimum of 15 consecutive 1s have  
been received. The event is stored in the status register and can be used  
to trigger a receiver interrupt. The RxIDLE bit continues to reflect the  
inactive idle condition until a '0' is received. You can clear this bit by  
writing a '1' to this bit.  
[16]  
Rx abort (RxABT)  
The RxABT status bit is set to '1' when seven or more consecutive 1s  
(abort sequence) have been received. When an abort is received in an 'in-  
frame' condition, the event is stored in the status register triggering an  
interrupt request. You can clear this bit by writing a '1' to this bit.  
[17]  
[18]  
[19]  
Rx CRC error  
(RxCRCE)  
The RxCRCE status bit is set a frame is completed with a CRC error.  
Rx non-octet align  
(RxNO)  
The RxNO bit is set to '1', if received data is non-octet aligned frame.  
Rx overrun (RxOV)  
The RxOV status bit is set to '1', if the data received is transferred into the  
HRXFIFO when it is full, resulting in a loss of data. Continued overruns  
destroy data in the first FIFO register.  
[20]  
DMA Rx memory  
overflow (RxMOV)  
This bit is set when there is no more buffer during receiving data. If this bit  
is set, DRxEN bit is cleared. You can clear this bit by writing '1' to this bit.  
[21]  
[22]  
Reserved.  
Not applicable.  
DMA Tx abort  
(DTxABT)  
This bit is set to '1' when abort signal is sent due to the Tx underrun or CTS  
lost occurred. If this bit is set, DTxEN(in HCON) bit cleared. You can clear  
this bit by writing '1' to this bit.  
8-37  
HDLC CONTROLLERS  
S3C4510B  
Table 8-11. HSTAT Register Description (Continued)  
Bit Name Description  
Bit  
Number  
[23]  
Rx internal error  
(RxIERR)  
This bit is set to '1' when received frame will be detected error possibility  
due to the receive clock is unstable.  
[24]  
DMA Rx frame done  
every received frame  
(DRxFD)  
This bit is set when a DMA Rx operation has successfully operated a frame  
to memory from HRXFIFO, and when the last byte of a frame has been  
written to memory. This bit generate interrupt when set to '1' to know a  
frame is received. You can clear this bit by writing '1' to this bit.  
[25]  
[26]  
[27]  
[28]  
[29]  
DMA Rx null list  
(DRxNL)  
If this bit is set, the DMA Rx buffer descriptor pointer has a null address. In  
this case, DMA Rx is disabled and the data transfer from the Rx FIFO to  
buffer memory is discontinued. So the HRXFIFO is cleared. You can clear  
this bit by writing '1' to this bit.  
DMA Rx not owner  
(DRxNO)  
This bit is set, when DMA is not owner of the current buffer descriptor, and  
DRxSTSK bit was set. In this case, DMA Rx is disabled and can generate  
interrupt, if enabled. If DRxSTSK bit is zero, this bit is always zero. You  
can clear this bit by writing '1' to this bit.  
DMA Tx frame done  
(DTxFD)  
In case of MFF bit is '0' (default), when DNA Tx operation has successfully  
transferred rest byte of frame from Tx FIFO to destination, this bit will be  
set to ’1’. But if MFF is set to ’1’, transceiver will keep sending the data  
until there is no data transfer from memory to TxFIFO.  
DMA Tx null list  
(DTxNL)  
If this bit is set '1', the DMA Tx buffer descriptor pointer has a null address.  
In this case, DMA Tx is disabled and the data to be transferred  
discontinued from the buffer memory to Tx FIFO. You can clear this bit by  
writing '1' to this bit.  
DMA Tx not owner  
(DTxNO)  
This bit is set, when DMA is not owner of the current buffer descriptor, and  
DTxSTSK bit was set. In this case, DMA Tx disabled and can generate  
interrupt, if enabled. If DTxSTSK bit is zero, this bit is always zero. You  
can clear this bit by writing '1' to this bit.  
[30]  
[31]  
DPLL one clock missing When operating in FM/Manchester mode, the DPLL sets this bit to '1' if it  
(DPLLOM)  
does not detect an edge in its first attempt. You can clear this bit by writing  
a '1' to this bit.  
DPLL two clock missing When it is operating in the FM/Manchester mode, the DPLL sets this bit to  
(DPLLTM)  
'1' if it does not detect an edge in two successive attempts. At the same  
time the DPLL enters Search mode. In NRZ/NRZI mode, and while the  
DPLL is disabled, this bit is always '0'. You can clear this bit by writing a '1'  
to this bit.  
8-38  
S3C4510B  
HDLC CONTROLLERS  
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  
D D D D D D D D R D  
R R R R R R R R R R  
R
x
F
A
T
x
F
A
T T T  
T
x
F
C
R
x
R
B
P P T T T R R R x  
T
x
x
x
x
x
x
x
I
x x x x  
x
x x  
L L  
x
x
x
x
x
x
I
M O N C A  
F S D F  
U S C  
C T  
T S  
S
L L N N F N N F E A  
T O O L D O L D R B  
O V O R B D V D C D  
V
C T L  
C D  
D
M M  
R T  
E
E
[3:0] Rx remaining bytes (RxRB)  
At 1-word boundary:  
At 4-word boundary:  
0000 = Valid data byte is 1  
0001 = Valid data byte is 2  
0010 = Valid data byte is 3  
0011 = Valid data byte is 4  
0000 = Valid data byte is 1  
.
.
1111 = Valid data byte is 16  
[4] Tx frame complete (TxFC)  
0 = Normal operation  
1 = Automatically set; if two conditions are met:  
1) Tx FIFO is empty.  
2) An abort or a closing flag is transmitted.  
[5] Tx FIFO available (TxFA)  
0 = Tx FIFO is not available.  
1 = Tx FIFO is available. (that is, the data to be transmitted can now be  
loaded into the Tx FIFO.)  
[6] Tx clear-to send (TxCTS)  
0 = Level at the nCTS input pin is High.  
1 = Level at the nCTS input pin is Low.  
[7] Tx stored clear-to-send (TxSCTS)  
0 = Normal operation  
1 = A transition occured at the nCTS input. (This transition can be used to  
trigger an interrupt.)  
[8] Tx underrun (TxU)  
0 = Normal operation  
1 = The transmitter ran out of data during transmission.  
[9] Rx FIFO available (RxFA)  
0 = Normal operation  
1 = Data is available in the RxFIFO.  
[10] Reserved  
[11] Rx flag detected (RxFD)  
0 = Normal operation  
1 = This bit is set, when the last bit of the flag sequence is received.  
[12] Rx data-carrier-detected (RxDCD)  
0 = nDCD input pin is High  
1 = nDCD input pin is Low  
[13] Rx stored data-carrier-detected (RxSDCD)  
0 = Normal operation  
1 = When a transition of the nDCD input occurs, this bit is set.  
[14] Rx frame valid (RxFV)  
0 = Normal operation  
1 = The last data byte if a frame is transgerred into the last location of RxFIFO.  
[15] Rx idle (RxIDLE)  
0 = Normal operation  
1 = A minimum 15 consecutive 1s have been reveived.  
Figure 8-16. HDLC Status Register  
8-39  
HDLC CONTROLLERS  
S3C4510B  
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
D D D D D D D D R D  
R R R R R R R R R R  
R
x
F
A
T
x
F
T T T  
T
x
F
R
x
R
B
P P T T T R R R x  
L L  
T
x
x
x
x
x
x
x
I
x x x x  
x
x x  
x
x
x
x
x
x
I
M O N C A  
F S D F  
U S C  
C T  
T S  
S
L L N N F N N F E A  
T O O L D O L D R B  
O V O R B D V D C D  
A C  
V
C T L  
C D  
D
M M  
R T  
E
E
[16] Rx abort (RxABT)  
0= Normal operation  
1 = Seven or more consecutive 1s have been received, in-frame condition.  
[17] Rx CRC error (RxCRCE)  
0 = Normal operation  
1 = A frame Rx operation is completed with a CRC error.  
[18] Rx non-octet align (RxNO)  
0 = Received frame is octet.  
1 = Received frame is not octet.  
[19] Rx overrun (RxOV)  
0 = Normal operation  
1 = Received data is transferred into the RxFIFO when it is full.  
[20] Rx memory overflow (RxMOV)  
0 = Normal operation  
1 = Indicates memory overflow when Rx buffer descriptor next pointer has null address.  
[21] Reserved  
[22] DMA Tx abort (DTxABT)  
0 = Normal operation  
1 = Abort signal is sended and DMA Tx enable bit is cleared.  
[23] Rx internal error (RxIERR)  
0 = Normal operation  
1 = Received frame is not stable due to receive clock is unstable.  
[24] DMA Rx frame done every received frame (DRxFD)  
0 = Normal operation  
1 = DMA Rx operation has successfully transferred a frame from RxFIFO to buffer memory.  
[25] DMA Rx null list (DRxNL)  
0 = Normal operation  
1 = DMA Rx buffer descriptor pointer has a null address.  
[26] DMA Rx not owner (DRxNO)  
0 = DMA has the ownership.  
1 = CPU has the ownership.  
[27] DMA Tx frame done (DTxFD)  
0 = Normal operation  
1 = DMA Tx operation has successfully transferred a frame from memory to TxFIFO.  
[28] DMA Tx null list (DTxNL)  
0 = Normal operation  
1 = DMA Tx buffer descriptor pointer has a null address.  
[29] DMA Tx not owner (DTxNO)  
0 = DMA has the ownership.  
1 = CPU has the ownership.  
[30] DPLL one clock missing (DPLLOM)  
0 = Normal operation  
1 = Set in FM/Machester mode when DPLL does not detect an edge on the first entry.  
[31] DPLL two clock missing (DPLLTM)  
0 = Normal operation  
1 = DPLL was not detected on two consecutive edges and search mode was entered.  
Figure 8-17. HDLC Status Register (Continued)  
8-40  
S3C4510B  
HDLC CONTROLLERS  
HDLC INTERRUPT ENABLE REGISTER (HINTEN)  
Table 8-12. HINTENA and HINTENB Register  
Registers  
HINTENA  
HINTENB  
Offset  
0x700c  
0x800c  
R/W  
R/W  
R/W  
Description  
Reset Value  
0X00000000  
0X00000000  
HDLC Interrupt Enable Register  
HDLC Interrupt Enable Register  
Table 8-13. HINTEN Register Description  
Description  
Bit  
Bit Name  
Number  
[3:0]  
[4]  
Reserved  
TxFCIE  
Tx frame complete interrupt enable  
Tx FIFO available to write interrupt enable  
[5]  
TxFAIE  
[6]  
Reserved  
TxSCTSIE  
TxUIE  
[7]  
CTS transition has occurred interrupt enable  
Tx under-run has occurred interrupt enable  
Rx FIFO available to read interrupt enable  
[8]  
[9]  
RxFAIE  
[10]  
[11]  
[12]  
[13]  
[14]  
[15]  
[16]  
[17]  
[18]  
[19]  
[20]  
[21]  
[22]  
[23]  
[24]  
[25]  
[26]  
[27]  
[28]  
[29]  
[30]  
[31]  
Reserved  
RxFDIE  
Rx flag detected interrupt enable  
Reserved  
RxSDCDIE  
RxFVIE  
DCD transition interrupt enable  
Rx frame valid interrupt enable  
Idle detected interrupt enable  
Abort detected interrupt enable  
CRC error frame interrupt enable  
Non-octet aligned frame interrupt enable  
Rx overrun interrupt enable  
Rx memory overflow interrupt enable  
RxIDLEIE  
RxABTIE  
RxCRCEIE  
RxNOIE  
RxOVIE  
RxMOVIE  
Reserved  
DTxABTIE  
RxIERRIE  
DRxFDIE  
DRxNLIE  
DRxNOIE  
DTxFDIE  
DTxNLIE  
DTxNOIE  
DPLLOMIE  
DPLLTMIE  
DMA Tx abort interrupt enable  
Rx internal error interrupt enable  
DMA Rx frame done interrupt enable  
DMA Rx null list interrupt enable  
DMA Rx not owner interrupt enable  
DMA Tx frame done every transmitted frame interrupt enable  
DMA Tx null list interrupt enable  
DMA Tx not owner interrupt enable  
DPLL one clock missing interrupt enable  
DPLL two clocks missing interrupt enable  
8-41  
HDLC CONTROLLERS  
S3C4510B  
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  
D D D D D D D D R D  
R R R R R R R R  
R
x
F
D
I
R
x
F
A
I
T
x
F
T T  
T
x
F
P P T T T R R R x  
L L  
T
x
x
x
x
x
x
x
I
x x  
x
x
x
x
x
x
x
x
I
M O N C A  
F S  
U S  
L L N N F N N F E A  
T O O L D O L D R B  
O V O R B D V D  
A C  
I
C
V
I
I
I
C T L  
I
C
I
E T  
I
M M  
I
I
I
I
I
I
R T  
E E E  
I
E E D  
E
E
E E  
S
I
E
I
I
E E E E E E  
I
I
E
I
E
I
I
E E  
E E  
E
E
E
[3:0] Reserved  
[18] Non-dctet aligned frame interrupt enable  
(RxNOIE)  
[4] Tx frame complete interrupt enable  
(TxFCIE)  
[19] Rx overrun interrupt enable (RxOVIE)  
[5] Tx FIFO available to write interrupt  
enable (TxFAIE)  
[20] Rx memory overflow interrupt enable  
(RxMOVIE)  
[6] Reserved  
[21] Reserved  
[7] CTS transition has occurred interrupt  
enable (TxSCTIE)  
[22] DMA Tx abort interrupt enable  
(DTxABTIE)  
[8] Transmit underrun has occured  
interrupt enable (TxUIE)  
[23] Rx internal error interrupt enable  
(RxIERRIEN)  
[9] RxFIFO available to read interrupt  
enable (RxFAIE)  
[24] DMA Rx frame done every received frame  
interrupt enable (DRxFDIE)  
[10] Reserved  
[25] DMA Rx null list interrupt enable  
(DRxNLIE)  
[11] Flag detected interrupt enable  
(RxFDIE)  
[26] DMA Rx not owner interrupt enable  
(DRxNOIE)  
[12] Reserved  
[27] DMA Tx frame done every received frame  
interrupt enable (DTxFDIE)  
[13] DCD transition interrupt enable  
(RxSDCDIE)  
[28] DMA Tx null list interrupt enable  
(DTxNLIE)  
[14] Valid frame interruopt enable (RxFVIE)  
[15] Idle detected interruot enable  
(RxIDLEIE)  
[29] DMA Tx not owner interrupt enable  
(DTxNOIE)  
[16] Abort detected interrupt enable  
(RxABTIE)  
[30] DPLL one missing interrupt enable  
(DPLLOMIE)  
[17] CRC error frame interrupt enable  
(RxCRCEIE)  
[31] DPLL two missing interrupt enable  
(DPLLTMIE)  
Figure 8-18. HDLC Interrupt Enable Register  
8-42  
S3C4510B  
HDLC CONTROLLERS  
HDLC TX FIFO (HTXFIFO)  
The Tx FIFO consists of eight 32-bit registers that are used for buffer storage of data to be transmitted. Data is  
always transferred from a full register to an empty adjacent register. The Tx FIFO can be addressed at two  
different register addresses: the 'frame continue' address and the 'frame terminate' address.  
Each register has four pointers, data valid pointer bit (4 bits), last pointer bit, NoCRC pointer bit, Preamble  
pointer bit. The data valid pointer bit indicates whether each byte is valid or not. The last byte pointer bit indicates  
whether the frame to be sent has the frame last byte or not. The NoCRC pointer bit determines whether the CRC  
data is to be appended or not by hardware.  
When a valid data byte is written to the 'frame continue' address, the data valid pointer is set, but the last byte  
pointer is not set. When a valid data byte is written to the 'frame terminate' address, the data valid pointer and  
last byte pointer are set together. To reset these pointers, you write a '1' to either the TxABT bit or the TxRS bit in  
the HCON register.  
In DMA mode, when the DMA controller writes data to the HTxFIFO, Tx buffer descriptor Buffer Length field  
value must be pre-set. However, if the Last bit is set in buffer descriptor, the last byte pointer in HTxFIFO is also  
set. This means the last byte of the frame is in HTxFIFO. If the transmitted frame is longer than the Buffer  
Length field value, the last byte pointer will not be set, and the next buffer descriptor having the last byte pointer  
bit will be used.  
The pointers continue shifting through the FIFO. When the transmitter detects a positive transition in the data  
valid pointer at the last location of the FIFO, it initiates a frame with an opening flag. When it detects a negative  
transition in the last byte pointer at the last location of the FIFO, it closes the frame, appending the CRC and a  
closing flag follows.  
The status of the Tx FIFO is indicated by the transmitter FIFO register available (TxFA) status bit. When TxFA =  
'1', the Tx FIFO is available for loading data and data can be loaded into it. (This function is controlled by the  
Tx4WD bit.) The HTxFIFO is reset by writing a '1' to the Tx reset, or the TxABT bit or by the nRESET. During a  
reset operation, the TxFA status bit is suppressed and data loading is inhibited.  
TxFIFO  
8-bit 8-bit  
Data Valid (4-bit)  
Last (1-bit)  
NoCRC  
Preamble  
8-bit  
8-bit  
8
Tx Data  
Figure 8-19. HDLC Tx FIFO Function Diagram  
8-43  
HDLC CONTROLLERS  
S3C4510B  
HDLC RX FIFO (HRXFIFO)  
The Rx FIFO consists of eight 32-bit registers that are used for the buffer storage of the data received. Data  
bytes are always transferred from a full register to an adjacent empty register. Each register has pointer bits that  
indicate the frame status. When these pointers appear at the last 1-word or 4-word FIFO location, they update the  
LAST bit(indicating the last of a frame), the OVERRUN bit, the CRC error bit, or Non-octet aligned bit.  
The HRXFIFO data available (RxFA) status bits indicate the current state of the HRXFIFO. When the HRXFIFO  
data status bit is '1', the HRXFIFO is ready to be read. The HRXFIFO data status is controlled by the 4-word or 1-  
word transfer selection bit (Rx4WD). When an overrun occurs, the overrun frame of the HRXFIFO is no longer  
valid.  
An 'in frame' abort or a High level on nDCD input with the AutoEN bit in HCON is set to '1', the frame is cleared in  
the HRXFIFO. (The last byte of the previous frame, which is separated by the frame boundary pointer, is  
retained). Data in HRXFIFO should be read by word size.  
The HRXFIFO is cleared by the Rx reset bit set to '1', an abort signal received, or nRESET.  
RxFIFO  
8-bit 8-bit  
Data Valid  
Last  
OV  
CRCE  
NO  
8-bit  
8-bit  
Rx Data  
Figure 8-20. HDLC Rx FIFO Function Diagram  
8-44  
S3C4510B  
HDLC CONTROLLERS  
HDLC BRG TIME CONSTANT REGISTERS (HBRGTC)  
Table 8-14. HBRGTCA and HBRGTCB Register  
Registers  
HBRGTCA  
HBRGTCB  
Offset  
0x701c  
0x801c  
R/W  
R/W  
R/W  
Description  
Reset Value  
0x00000000  
0x00000000  
HDLC BRG Time Constant Register  
HDLC BRG Time Constant Register  
The HDLC BRG time constant register value can be changed at any time, but the new value does not take effect  
until the next time the constant is loaded into the down counter. No attempt is made to synchronize the loading of  
the time constant into HBRGTC while the clock is driving the down counter. For this reason, you should first  
disable the baud rate generator before loading the new time constant into the HBRGTC register.  
The formula for determining the appropriate time constant for a given baud rate is shown below. The desired rate  
is shown in bits per second. This formula shows how the counter decrements from N down to zero-plus-one  
cycles for reloading the time constant. This value is then fed to a toggle flip-flop to generate the square wave  
output.  
BRGOUT1 = (MCLK2 or RXC)/(CNT0 + 1)/(16CNT1  
BRGOUT2 = BRGOUT1/(1 or 16 or 32 according to CNT2 value of the HBRGTC)  
)
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  
CNT1 CNT2  
CNT0  
[1:0] Time constant value for CNT2  
00 = divide by 1  
01 = adivide by 16  
10 = divide by 32  
[3:2] Time constant value for CNT1  
00 = divide by 1  
01 = divide by 16  
[15:4] Time constant value for CNT0  
Figure 8-21. HDLC BRG Time Constant Register  
8-45  
HDLC CONTROLLERS  
S3C4510B  
HDLC PREAMBLE CONSTANT REGISTER (HPRMB)  
The HPRMB register is used to meet the DPLL requirements for phase-locking. The preamble pattern is  
transmitted as many Tx preamble length bit values in HMODE[10:8] when the Tx preamble bit (TxPRMB) is '1',  
and then the Tx preamble bit is cleared automatically. The opening flag follows this preamble pattern, and the  
data will be transmitted.  
Table 8-15. HPRMBA and HPRMBB Register  
Registers  
HPRMBA  
HPRMBB  
Offset  
0x7020  
0x8020  
R/W  
R/W  
R/W  
Description  
Reset Value  
0x00000000  
0x00000000  
HDLC Preamble Constant Register  
HDLC Preamble Constant Register  
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  
Preamble Pattern  
[7:0] Preamble Pattern  
Figure 8-22. HDLC Preamble Constant Register  
The reference for the preamble pattern of each data mode is as follows:  
Table 8-16. Preamble Reference Pattern  
Data Mode  
NRZ  
Preamble Pattern  
AA  
00  
NRZI  
FM0  
FF  
00  
FM1  
MANCHESTER  
AA  
8-46  
S3C4510B  
HDLC CONTROLLERS  
HDLC STATION ADDRESS REGISTERS (HSADR0–3) AND HMASK REGISTER  
Each HDLC controller has five 32-bit registers for address recognition: four station address registers and one  
mask register. Generally, the HDLC controller reads the address of the frame from the receiver, to check it  
against the four station address values, and then masks the result with the user-defined HMASK register. A "1" in  
the HMASK register represents a bit position for which an address comparison should occur. A "0" represents a  
masked bit position. If you check the address up to four bytes, the HMASK register value should be 0xffffffff.  
Dependent on the HMASK register value, the frame's address is compared. If the address is not matched, this  
frame is discarded.  
Table 8-17. HSADR and HMASK Register  
Registers  
HSADR0A  
HSADR1A  
HSADR2A  
HSADR3A  
HMASKA  
HSADR0B  
HSADR1B  
HSADR2B  
HSADR3B  
HMASKB  
Offset  
0x7024  
0x7028  
0x702c  
0x7030  
0x7034  
0x8024  
0x8028  
0x802c  
0x8030  
0x8034  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
Description  
HDLC station address 0  
HDLC station address 1  
HDLC station address 2  
HDLC station address 3  
HDLC address mask register  
HDLC station address 0  
HDLC station address 1  
HDLC station address 2  
HDLC station address 3  
HDLC address mask register  
Reset Value  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
0x00000000  
HMASK  
0xFFFFFFFF  
HMASK  
HSADR0  
HSADR1  
HSADR2  
HSADR3  
0xFF0000 00  
HSADR0  
HSADR1  
HSADR2  
HSADR3  
0xABCDEFGH  
0xFFFFFFFF  
0xABCDEFGH  
0xABCDEFGH  
0x55XXXX XX  
0x55XXXX XX  
0x55XXXX XX  
0x55XXXX XX  
NOTE:  
Recognize one 32-bit address  
NOTE:  
Recognize a single 8-bit address  
and the 32-bit broadcast address  
Figure 8-23. Address Recognition  
8-47  
HDLC CONTROLLERS  
S3C4510B  
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9  
First byte Second byte Third byte  
8
7
6
5
4
3
2
1
0
Fourth byte  
Station address byte register and MASK register  
[31:24] First address byte  
[23:16] Second address byte  
[15:8] Third address byte  
[7:0] Fourth address byte  
Figure 8-24. HDLC Station Address and HMASK Register  
DMA TX BUFFER DESCRIPTOR POINTER REGISTER  
The DMA transmit buffer descriptor pointer register contains the address of the Tx buffer data pointer on the data  
to be sent. During a DMA operation, the buffer descriptor pointer is updated by the next buffer data pointer.  
Table 8-18. DMA Tx Buffer Descriptor Pointer Registers  
Registers  
Offset  
0x7038  
0x8038  
R/W  
R/W  
R/W  
Description  
Reset Value  
0xFFFFFFFF  
0xFFFFFFFF  
HDMATXPTRA  
HDMATXPTRB  
DMA Tx Buffer Descriptor Pointer  
DMA Tx Buffer Descriptor Pointer  
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  
DMA Tx Buffer Descriptor Pointer  
[25:0] DMA Tx Buffer Descriptor Pointer  
Figure 8-25. DMA Tx Buffer Descriptor Pointer  
8-48  
S3C4510B  
HDLC CONTROLLERS  
DMA RX BUFFER DESCRIPTOR POINTER REGISTER  
The DMA receive buffer descriptor pointer register contains the address of the Rx buffer data pointer on the data  
to be received. During a DMA operation, the buffer descriptor pointer is updated by the next buffer data pointer.  
Table 8-19. DMA Rx Buffer Descriptor Pointer Registers  
Registers  
Offset  
0x703c  
0x803c  
R/W  
R/W  
R/W  
Description  
Reset Value  
0xFFFFFFFF  
0xFFFFFFFF  
HDMARXPTRA  
HDMARXPTRB  
DMA Rx Buffer Descriptor Pointer  
DMA Rx Buffer Descriptor Pointer  
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  
DMA Rx Buffer Descriptor Pointer  
[25:0] DMA Rx Buffer Descriptor Pointer  
Figure 8-26. DMA Rx Buffer Descriptor Pointer  
MAXIMUM FRAME LENGTH REGISTER  
The HDLC controller checks the length of an incoming frame against the user-defined value in DMA mode. If the  
frame received exceeds this register value, the frame is discarded, and FLV(Frame Length Violated) bit is set in  
the buffer descriptor belonging to that frame.  
Table 8-20. HDMATXCNT and HDMARXCNT Registers  
Registers  
HMFLRA  
HMFLRB  
Offset  
0x7040  
0x8040  
R/W  
R/W  
R/W  
Description  
Maximum Frame Length  
Maximum Frame Length  
Reset Value  
0xXXXX0000  
0xXXXX0000  
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  
Maximum Frame Length  
[15:0] Maximum Frame Length  
Figure 8-27. Maximum Frame Length Register  
8-49  
HDLC CONTROLLERS  
S3C4510B  
RECEIVE BUFFER SIZE REGISTER  
The Rx buffer size register contains the 16-bit user-defined value. This user-defined count value determines the  
buffer size for one Buffer Descriptor. If incoming HDLC frame is longer than the Rx buffer size register value, the  
next buffer descriptor having the Rx buffer size value will be used.  
Table 8-21. DMA Rx Buffer Size Register  
Registers  
HRBSRA  
HRBSRB  
Offset  
0x7044  
0x8044  
R/W  
R/W  
R/W  
Description  
Receive Buffer Size Register  
Receive Buffer Size Register  
Reset Value  
0xXXXX0000  
0xXXXX0000  
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  
Receive Buffer Size  
[15:0] Receive Buffer Size Register  
Figure 8-28. DMA Receive Buffer Size Register  
8-50  
S3C4510B  
DMA CONTROLLER  
9
DMA CONTROLLER  
OVERVIEW  
The S3C4510B has a two-channel general DMA controller, called the GDMA. The two-channel GDMA performs  
the following data transfers without CPU intervention:  
— Memory-to-memory (memory to/from memory)  
— UART-to-memory (serial port to/from memory)  
The on-chip GDMA can be started by software and/or by an external DMA request (nXDREQ). Software can also  
be used to restart a GDMA operation after it has been stopped.  
The CPU can recognize when a GDMA operation has been completed by software polling and/or when it receives  
an appropriate internally generated GDMA interrupt. The S3C4510B GDMA controller can increment or  
decrement source or destination addresses and conduct 8-bit (byte), 16-bit (half-word), or 32-bit (word) data  
transfers.  
System BUS  
Mode Selection  
GDMA Channel 0  
nXDREQ 0  
UART0  
nDREQ  
UART1  
nDACK  
nXDACK 0  
GDMA  
Port 14 Data  
IOPCON [27:26]  
GDMA Channel 1  
nDREQ  
nDACK  
nXDREQ 1  
nXDACK 1  
GDMA  
Mode Selection  
Port 15 Data IOPCON [29:28]  
Figure 9-1. GDMA Controller Block Diagram  
9-1  
DMA CONTROLLER  
S3C4510B  
GDMA SPECIAL REGISTERS  
Table 9-1. GDMA Special Registers Overview  
Registers  
GDMACON0  
GDMACON1  
GDMASRC0  
GDMADST0  
GDMASRC1  
GDMADST1  
GDMACNT0  
GDMACNT1  
Offset  
0xB000  
0xC000  
0xB004  
0xB008  
0xC004  
0xC008  
0xB00C  
0xC00C  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
Description  
Reset Value  
0´ 00000000  
0´ 00000000  
Undefined  
Undefined  
Undefined  
Undefined  
Undefined  
Undefined  
GDMA controller channel 0 control register  
GDMA controller channel 1 control register  
GDMA channel 0 source address register  
GDMA channel 0 destination address register  
GDMA channel 1 source address register  
GDMA channel 1 destination address register  
GDMA channel 0 transfer count register  
GDMA channel 1 transfer count register  
GDMA CONTROL REGISTERS  
Table 9-2. GDMACON0 and GDMACON1 Registers  
Registers  
GDMACON0  
GDMACON1  
Offset  
0xB000  
0xC000  
R/W  
R/W  
R/W  
Description  
Reset Value  
0´ 00000000  
0´ 00000000  
GDMA controller channel 0 control register  
GDMA controller channel 1 control register  
Table 9-3. GDMA Control Register Description  
Bit Name Reset Value  
Bit Number  
[0]  
Run enable/disable  
Setting this bit to "1", starts a DMA operation. To stop DMA, you  
must clear this bit to "0". You can use the GMA run bit control  
address (GDMACON offset address + 0x20) to manipulate this bit.  
By using the run bit control address, other GDMA control register  
values are not affected.  
[1]  
Busy status  
When DMA starts, this read-only status bit is automatically set to  
"1". When it is "0", DMA is idle.  
[3:2]  
GDMA mode selection  
Four sources can initiate a DMA operation: 1) software (memory-  
to-memory), 2) an external DMA request (nXDREQ), 3) the UART0  
block, and 4) the UART1 block. The mode selection setting  
determines which source can initiate a DMA operation at any given  
time.  
[4]  
[5]  
Destination address  
direction  
This bit controls whether the destination address will be  
decremented ("1") or incremented ("0") during a DMA operation.  
Source address direction This bit controls whether the source address will be decremented  
("1") or incremented ("0") during a DMA operation.  
9-2  
S3C4510B  
DMA CONTROLLER  
Table 9-3. GDMA Control Register Description (Continued)  
Bit Number  
Bit Name  
Reset Value  
Destination address fix  
This bit determines whether or not the destination address will be  
changed during a DMA operation. You use this feature when  
transferring data from multiple sources to a single destination.  
[6]  
[7]  
[8]  
Source address fix  
This bit determines whether or not the source address will be  
changed during a DMA operation. You use this feature when  
transferring data from a single source to multiple destinations.  
Stop interrupt enable  
To start/stop a DMA operation, you set/clear the run enable bit. If  
the stop interrupt enable bit is "1" when DMA starts, a stop interrupt  
is generated when DMA operation stops. If this bit is "0", the stop  
interrupt is not generated.  
Four-data burst enable  
If this bit is set to one, GDMA operates under 4-data burst mode.  
under the 4-data burst mode, 4 consecutive source addresses are  
read and then are written to the consecutive destination addresses.  
If 4-data burst mode is set to one, "transfer count register" should  
be set carefully because the 4-data burst move is executed during  
decreasing of the transfer count. The 4-data burst mode can be  
used only when GMDA mode is software or external DMA request  
mode.  
[9]  
Peripheral direction  
Single/Block mode  
This bit is used to specify the direction of a DMA operation when  
the mode bits [3:2] are set to '10' (UART0 from/to memory) or '11'  
(UART1 from/to memory). If this bit is "1", DMA operates in the  
memory-to-peripheral direction (e.g., to the parallel port or UART).  
When it is "0", DMA operates in the peripheral-to-memory  
direction.  
[10]  
[11]  
This bit determines the number of external DMA requests  
(nXDREQs) that are required for a DMA operation. In Single mode,  
when [11] = "0", the S3C4510B requires an external DMA request  
for every DMA operation.  
In Block mode, when [11] = "1", the S3C4510B requires only one  
external DMA request during the entire DMA operation. An entire  
DMA operation is defined as the operation of DMA until the counter  
value is zero.  
NOTE: You should not use block mode together with demand  
mode, or single mode in conjunction with continuous  
mode.  
Transfer width  
These bits determine the transfer data width to be one byte, one  
half-word, or one word. If you select a byte transfer operation, the  
source/destination address will be incremented or decremented by  
one with each transfer. Each half-word transfer increments or  
decrements the address by two, and each word transfer by four.  
[13:12]  
[14]  
Continuous mode  
This bit lets the DMA controller hold the system bus until the DMA  
transfer count value is zero. You must therefore manipulate this bit  
carefully so that DMA transfer operations do not exceed a  
acceptable time interval (as, for example, in a DRAM refresh  
operation).  
NOTE: You can use continuous mode together with a software  
request mode.  
9-3  
DMA CONTROLLER  
Bit Number  
S3C4510B  
Table 9-3. GDMA Control Register Description (Continued)  
Bit Name Reset Value  
Demand mode  
[15]  
Setting this bit speeds up external DMA operations. When [15]="1",  
the DMA transfers data when the external DMA request signal  
(nXDREQ) is active. The amount of data transferred depends on  
how long nXDREQ is active. When nXDREQ is active and DMA  
gets the bus in Demand mode, DMA holds the system bus until the  
nXDREQ signal becomes non-active. Therefore, the period of the  
active nXDREQ signal should be carefully timed so that the entire  
operation does not exceed an acceptable interval (as, for example,  
in a DRAM refresh operation).  
NOTE: In demand mode, you must clear the single/block and  
continuous mode control bits to "0".  
NOTE: To ensure the reliability of DMA operations, the GDMA control register bits must be configured independently and  
carefully.  
9-4  
S3C4510B  
DMA CONTROLLER  
31  
16 15 14 13 12 11 10 9  
8
7
6
5
4 3  
2
1
0
M
O
D
E
D C  
M N  
T
W
S
T
F
S S D S D  
A A  
B R  
S E  
B D B  
I
F F  
[0] Run enable (RE)  
0 = Disable DMA operation  
1 = Enable DMA operation  
1 = DMA is active  
[1] Busy status (BS)  
0 = DMA is idle  
[3:2] Mode selection (MODE)  
00 = Software mode (memory to memory)  
01 = External EXTDREQ mode (for external devices)  
10 = UART0 block  
11 = UART1 block  
[4:] Destination address direction (DA)  
0 = Increase source address 1 = Decrease source address  
[5] Source address direction (SA)  
0 = Increase source address 1 = Decrease source address  
[6] Destination address fix (DF)  
0 = Increase/decrease destination address  
1 = Do not change destination address (fix)  
[7] Source address fix (SF)  
0 = Increase/decrease source address  
1 = Do not change source address (fix)  
[8] Stop interrupt enable (SI)  
0 = Do not generate a stop interrupt when DMA stops  
1 = Generate a stop interrupt when DMA stops  
[9] Four-data burst enable (FB)  
0 = Disable 4-data burst mode  
1 = Enable 4-data burst mode  
[10] Transfer direction (for UART0/UART1 only) (TD)  
0 = UART0/UART1 to memory 1 = Memory to UART0/UART1  
[11] Single/block mode (SB)  
0 = One nXDREQ initiates a single DMA operation  
1 = One nXDREQ initiates a whole DMA operation  
[13:12] Transfer width (TW)  
00 = Byte (8 bits)  
10 = Word (32 bits)  
01 = Half-word (16 bits)  
11 = No use  
[14] Continuous mode (CN)  
0 = Normal operation  
1 = Hold system bus until the whole DMA operation stops  
[15] Demand mode (DM)  
0 = Normal external DMA mode  
1 = Demand mode  
Figure 9-2. GDMA Control Register  
9-5  
DMA CONTROLLER  
S3C4510B  
GDMA SOURCE/DESTINATION ADDRESS REGISTERS  
The GDMA source/destination address registers contain the 26-bit source/destination addresses for GDMA  
channels 0 and 1. Depending on the settings you make to the GDMA control register (GDMACON), the source or  
destination addresses will either remain the same, or they will be incremented or decremented.  
Table 9-4. GDAMSRC0/1 and GDMADST0/1 Registers  
Registers  
GDMASRC0  
GDMADST0  
GDMASRC1  
GDMADST1  
Offset  
0xB004  
0xB008  
0xC004  
0xC008  
R/W  
R/W  
R/W  
R/W  
R/W  
Description  
Reset Value  
Undefined  
Undefined  
Undefined  
Undefined  
GDMA channel 0 source address register  
GDMA channel 0 destination address register  
GDMA channel 1 source address register  
GDMA channel 1 destination address register  
31  
26 25  
0
Source/Destination Address  
[25:0] Source/destination address  
Figure 9-3. GDMA Source/Destination Address Register  
9-6  
S3C4510B  
DMA CONTROLLER  
DMA TRANSFER COUNT REGISTERS  
The DMA transfer count registers contain the 24-bit current count value of the number of DMA transfers  
completed for GDMA channels 0 and 1.  
The count value is always decremented by one for each completed DMA operation, regardless of the GDMA data  
transfer width or four-data burst mode.  
NOTE  
At the 4-data burst mode, actual transfer data size will be "Transfer Count x4."  
Table 9-5. GDMACNT0/1 Registers  
Registers  
GDMACNT0  
GDMACNT1  
Offset  
0xB00C  
0xC00C  
R/W  
R/W  
R/W  
Description  
Reset Value  
Undefined  
Undefined  
GDMA channel 0 transfer count register  
GDMA channel 1 transfer count register  
31  
24 23  
0
Transfer Count  
[23:0] Transfer count  
Figure 9-4. DMA Transfer Count Register  
9-7  
DMA CONTROLLER  
S3C4510B  
GDMA FUNCTION DESCRIPTION  
The following sections provide a functional description of the GDMA controller operations.  
GDMA TRANSFERS  
The GDMA transfers data directly between a requester and a target. The requester and target are memory,UART  
or external devices. An external device requests GDMA service by activating nXDREQ signal. A channel is  
programmed by writing to registers which contain requester address, target address, the amount of data, and  
other control contents. UART, external I/O, or Software(memory) can request GDMA service. UART is internally  
connected to the GDMA.  
STARTING/ENDING GDMA TRANSFERS  
GDMA starts to transfer data after the GDMA receives service request from nXDREQ signal, UART, or Software.  
When the entire buffer of data has been transferred, the GDMA becomes idle. If you want to preform another  
buffer transfer, the GDMA must be reprogrammed. Although the same buffer transfer wii be preformed again, the  
GDMA must be reprogrammed.  
DATA TRANSFER MODES  
Single Mode  
A GDMA request (nXDREQ or an internal request) causes one byte, one half-word, or one word to be transmitted  
if 4-data burst mode is disable state, or four times of transfer width if 4-data burst mode is enable state. Single  
mode requires a GDMA request for each data transfer. The nXDREQ signal can be de-asserted after checking  
that nXDACK has been asserted.  
nXDREQ  
nXDACK  
RD/WR Cycle  
Figure 9-5. External DMA Requests (Single Mode)  
9-8  
S3C4510B  
DMA CONTROLLER  
Block Mode  
The assertion of only one GDMA request (nXDREQ or an internal request) causes all of the data, as specified by  
the control register settings, to be transmitted in a single operation. The GDMA transfer is completed when the  
transfer counter value reaches zero. The nXDREQ signal can be de-asserted after checking that nXDACK has  
been asserted.  
nXDREQ  
nXDACK  
RD/WR Cycle  
Figure 9-6. External DMA Requests (Block Mode)  
Demand Mode  
In demand mode, the GDMA continues transferring data as long as the GDMA request input (nXDREQ) is held  
active.  
nXDREQ  
nXDACK  
RD/WR Cycle  
Figure 9-7. External DMA Requests (Demand Mode)  
9-9  
DMA CONTROLLER  
S3C4510B  
DMA TRANSFER TIMING DATA  
Figure 9-8 provides detailed timing data for GDMA data transfers that are triggered by external DMA requests.  
Please note that read/write timing depends on which memory banks are selected.  
To access ROM banks, which is in multiplexing bus mode, by 4-data burst mode, refer to Figure A-1 and Figure  
A-2 of appendix A for read/write timing of ROM bank 5.  
SCLK  
(In_MCLK)  
tEMRs  
tEMRh  
nXDREQ  
nXDACK  
tEMAf  
tEMAr  
Min.3 cycles  
worst  
best  
tEMRS  
tEMRh  
setup time  
3.90 ns  
0 ns  
hold time  
delay  
(falling)  
tEMAf  
tEMAr  
9.55 ns  
9.30 ns  
23.30 ns  
22.70 ns  
delay  
(rising)  
Figure 9-8. External DMA Requests Detailed Timing (S3C4510X)  
9-10  
S3C4510B  
DMA CONTROLLER  
SCLK  
(In_MCLK)  
tEMRs  
tEMRh  
nXDREQ  
nXDACK  
tEMAf  
tEMAr  
Min.3 cycles  
worst  
best  
tEMRS  
tEMRh  
setup time  
6.31 ns  
0 ns  
hold time  
delay  
(falling)  
tEMAf  
tEMAr  
12.19 ns  
9.33 ns  
28.54 ns  
21.87 ns  
delay  
(rising)  
Figure 9-9. External DMA Requests Detailed Timing (S3C4510B)  
9-11  
DMA CONTROLLER  
S3C4510B  
CLOCK DESCRIPTION  
The internal clock(In_MCLK; This is the operating clock on the S3C4510B) differs from mclko(pad out clock). For  
more clear description, internal clock(In_MCLK) is used at this timing diagram. Following Figure 9-9 is the  
relationship of internal clock(In_MCLK) and mclko(pad out clock). You must think one more step that is the  
concern with mclko.  
In_MCLK  
MCLKO  
MIN 4.03 ns  
MAX 10.57 ns  
NOTE: Each clock periol is 20 ns.  
Figure 9-10. MCLKO and SCLK (In_MCLK)  
9-12  
S3C4510B  
DMA CONTROLLER  
SINGLE AND ONE DATA BURST MODE (GDMACON[11] = 0, [9] = 0 )  
DREQ and DACK signals are active low.  
Recommand  
Deasserted Time  
In_MCLK  
DREQ  
DACK  
a
b
c
Source  
Address  
Destination  
Address  
Address  
Data  
Source  
Data  
Destination  
data  
NOTES:  
1. In this region, DMA operation is independent of the number of DREQ signal pulse. For example, although  
DREQ signal pulses 3 times in the '¨Í' region, GDMAC transfers data only one time from source address to  
destination address. Current DREQ signal is idle state(deasserted) when DACK siganl is idle state  
(high). Otherwise, GDMAC recognizes current DREQ signal as next one and transfers next data.  
I recommand that DREQ signal is deasserted when DACK signal is active.  
2. '¨Î' is three more cycles(3+a cycles). The 'a' is internal system bus acquistion time.  
3. '¨Ï' signal falls at negative edge In_MCLK clock after source data is valid.  
Figure 9-11. Single and One Data Burst Mode Timing  
9-13  
DMA CONTROLLER  
S3C4510B  
SINGLE AND FOUR DATA BURST MODE (GDMACON[11] = 0, [9] = 1 )  
DREQ & DACK signals are active low.  
In the four data burst mode, GDMA COUNT Register(GDMA CNT) value decreases by 1 after 4 data transfer.  
Recommand  
Deasserted Time  
In_MCLK  
DREQ  
DACK  
Address  
Data  
S0  
S1  
S2  
S3  
D0  
D1  
D2  
D3  
S4  
GDMA  
CNT  
N
N-1  
NOTE:  
Address order is source address0 -> source address1 -> source address 2 -> source address3  
-> destination address0 -> destination address1 ->destination address2 -> destination  
address3, and Data order is source data0 -> source data1 -> source data2 -> source data3  
-> destination data0 -> destination data1 -> destination data2 -> destination data3.  
Figure 9-12. Single and Four Data Burst Mode Timing  
9-14  
S3C4510B  
DMA CONTROLLER  
BLOCK AND ONE DATA BURST MODE (GDMACON[11] = 1, [9] = 0 )  
DREQ and DACK signals are active low.  
GDMAC transfers data from DREQ signal is active till GDMA COUNT Register consumes.  
Recommand  
Deasserted Time  
In_MCLK  
DREQ  
DACK  
a
Source  
Address  
Destination  
Address  
Source  
Address  
Destination  
Address  
Address  
Data  
Source  
Data  
Destination  
Data  
Source  
Data  
Destination  
Data  
NOTE:  
'¨Í' is in the block mode, GDMAC starts to operate with first DREQ signal. So in the ideal case,  
GDMAC don't care the number of DREQ signal pulse. But I recommand that DREQ siganl is  
deasserted when DACK signal is active state.  
Figure 9-13. Block and One Data Burst Mode Timing  
BLOCK AND FOUR DATA BURST (GDMACON[11] = 1, [9] = 1 )  
This timing diagram is the same with Single and one data burst exception four data burst.  
one data burst; source address0 and source data0 ® destination address0 and destination data0 ® ....  
four data burst; source address0 and source data0 ® source address1 and source data1 ® source address2 and  
source data2 ® source address3 and source data3 ® destination address0 and destination data0  
® destination address1 and destination data1 ® destination address2 and destination data2 ®  
destination address3 and destination data3 ® source address4 and source data4 ® ....  
NOTE  
In the four data burst mode, GDMA COUNT Register value decreases by 1 after 4 data transfer.  
9-15  
DMA CONTROLLER  
S3C4510B  
CONTINUOUS AND ONE BURST MODE (GDMACON[14] = 1, [9] = 0 )  
DREQ and DACK signals are active low.  
Recommand Time  
In_MCLK  
DREQ  
DACK  
Address  
Data  
S0  
D0  
S1  
D1  
S2  
D2  
S3  
D3  
GDMA  
CNT  
8
7
6
5
4
3
2
1
0
NOTE:  
S# is source address#, and D# is destination address#.  
Figure 9-14. Continuous and One Burst Mode Timing  
CONTINUOUS AND FOUR DATA BURST MODE (GDMACON[14] = 1, [9] = 1 )  
This timing diagram is the same with Continuous and one data burst exception four data burst.  
one data burst; source address0 and source data0 ® destination address0 and destination data0 ® source  
address1 and source data1 ® destination address1 and destination data1 ® ...  
four data burst; source address0 and source data0 ® source address1 and source data1 ® source address2 and  
source data2 ® source address3 and source data3 ® destination address0 and destination data0  
® destination address1 and destination data1 ® destination address2 and destination data2 ®  
destination address2 and destination data2 ® destination address3 and destination data3 ® ...  
NOTE  
In the four data burst mode, GDMA COUNT Register value decreases by 1 after 4 data transfer.  
9-16  
S3C4510B  
DMA CONTROLLER  
DEMAND AND ONE DATA BURST MODE (GDMACON[15] = 1, [9] = 0 )  
DREQ and DACK signals are active low.  
In_MCLK  
DREQ  
DACK  
Address  
Data  
S0  
D0  
S1  
D1  
S2  
D2  
S3  
D3  
GDMA  
CNT  
8
7
6
5
4
3
2
1
0
NOTE:  
S# is source address#, and D# is destination address#.  
If GDMA CNT is zero, GDMAC do not transfer data although DREQ signal asserted.  
Figure 9-15. Demand and One Data Burst Mode Timing  
DEMAND & FOUR DATA BURST MODE ( GDMACON[15] = 1, [9] = 1 )  
This timing diagram is the same with Demand & one data burst exception four data burst.  
one data burst; source address0 and source data0 ® destination address0 and destination data0 ® ...  
four data burst; source address0 and source data0 ® source address1 and source data1 ® source address2 and  
source data2 ® source address3 and source data3 ® destination address0 and destination data0  
® destination address1 and destination data1 ® destination address2 and destination data2 ®  
destination address2 and destination data2 ® destination address3 and destination data3 ® ...  
NOTE  
If you want to use continuous mode, you must set block mode not single mode.  
If you want to use demand mode, you must set single mode not block mode.  
9-17  
DMA CONTROLLER  
S3C4510B  
NOTES  
9-18  
S3C4510B  
UART  
10 SERIAL I/O (UART)  
OVERVIEW  
The S3C4510B UART (Universal Asynchronous Receiver/Transmitter) unit provides two independent  
asynchronous serial I/O (SIO) ports. Each port can operate in interrupt-based or DMA-based mode. That is, the  
UART can generate internal interrupts or DMA requests to transfer data between the CPU and the serial I/O  
ports.  
The most important features of the S3C4510B UART include:  
— Programmable baud rates  
— Infra-red (IR) transmit/receive  
— Insertion of one or two Stop bits per frame  
— Selectable 5-bit, 6-bit, 7-bit, or 8-bit data transfers  
— Parity checking  
Each SIO unit has a baud rate generator, transmitter, receiver, and a control unit, as shown in Figure 10-1. The  
baud-rate generator can be driven by the internal system clock, MCLK, or by the external clock, UCLK. The  
transmitter and receiver blocks have independent data buffer registers and data shifters.  
Transmit data is written first to the transmit buffer register. From there, it is copied to the transmit shifter and then  
shifted out by the transmit data pin, UATXDn. Receive data is shifted in by the receive data pin, UARXDn. It is  
then copied from the shifter to the receive buffer register when one data byte has been received.  
The SIO control units provide software controls for mode selection, and for status and interrupt generation.  
NOTE  
For the UART Tx interrupt method, you should write dummy byte to UART Tx buffer register  
before initialize UART. With this, you can generate UART Tx interrupt when Tx Buffer empty.  
10-1  
UART  
S3C4510B  
Transmit Buffer Register  
(UTXBUFn)  
Baud Rate Divisor  
(UTBUFn)  
UATxDn  
Transmit Shift Register  
0
1
IR Tx  
Decoder  
Baud Rate Generator  
Line Control Register  
(ULCONn)  
UART Control Register  
(UCONn)  
UART Status Register  
(USTATn)  
nUADTRn  
nUADSRn  
Receive Buffer Register  
(URXBUFn)  
UARxDn  
0
1
Receive Shift Register  
IR Rx  
Decoder  
Figure 10-1. Serial I/O Block Diagram  
10-2  
S3C4510B  
UART  
UART SPECIAL REGISTERS  
Table 10-1. UART Special Registers Overview  
Register  
ULCON0  
Offset Address  
0xD000  
0xE000  
0xD004  
0xE004  
0xD008  
0xE008  
0xD00C  
0xE00C  
0xD010  
0xE010  
0xD014  
0xE014  
0xD018  
0xE018  
0xD01C  
0xE01C  
R/W  
R/W  
R/W  
R/W  
R/W  
R
Description  
UART0 line control register  
Reset Value  
0x00  
0x00  
0x00  
0x00  
0xC0  
0xC0  
0xXX  
0xXX  
0xXX  
0xXX  
0x00  
0x00  
0x00  
0x00  
0x0  
ULCON1  
UCON0  
UART1 line control register  
UART0 control register  
UCON1  
UART1 control register  
USTAT0  
UART0 status register  
USTAT1  
R
UART1 status register  
UTXBUF0  
UTXBUF1  
URXBUF0  
URXBUF1  
UBRDIV0  
UBRDIV1  
BRDCNT0  
BRDCNT1  
BRDCLK0  
BRDCLK1  
W
UART0 transmit buffer register  
UART1 transmit buffer register  
UART0 receive buffer register  
UART1 receive buffer register  
UART0 baud rate divisor register  
UART1 baud rate divisor register  
UART0 baud rate count register  
UART1 baud rate count register  
UART0 baud rate clock monitor  
UART1 baud rate clock monitor  
W
R
R
R/W  
R/W  
W
W
W
W
0x0  
10-3  
UART  
S3C4510B  
UART LINE CONTROL REGISTERS  
Table 10-2. ULCON0 and ULCON1 Registers  
Registers  
ULCON0  
Offset Address  
0xD000  
R/W  
R/W  
R/W  
Description  
UART0 line control register  
UART1 line control register  
Reset Value  
0x00  
ULCON1  
0xE000  
0x00  
Table 10-3. UART Line Control Register Description  
Bit Number  
Bit Name  
Reset Value  
[1:0]  
World length (WL)  
This two-bit word length value indicates the number of data bits to  
be transmitted or received per frame: ’00’ = 5 bits, ’01’ = 6 bits, '10'  
= 7 bits, and ’11’ = 8 bits.  
[2]  
Number of Stop bits  
Parity mode (PMD)  
This bit specifies how many Stop bits are used to signal end-of-  
frame (EOF): "0" = one Stop bit per frame and "1" = two Stop bits  
per frame.  
[5:3]  
The 3-bit parity mode value specifies how parity generation and  
checking are to be performed during UART transmit and receive  
operations: '0xx' = no parity, ’100’ = odd parity, ’101’ = even parity,  
'110' = parity is forced/checked as a "1", and '111' = parity  
forced/checked as a "0".  
[6]  
[7]  
Serial Clock Selection  
Infra-red mode  
This selection bit specifies the clock source.  
0 = Internal (MCLK)  
1 = External (UCLK)  
The S3C4510B UART block supports infra-red (IR) transmit and  
receive operations. In IR mode, the transmit period is pulsed at a  
rate of 3/16 that of the normal serial transmit rate (when the  
transmit data value in the UTXBUF register is zero).  
To enable IR mode operation, you set ULCON[7] to "1". Otherwise,  
the UART operates in normal mode. In IR receive mode, the  
receiver must detect the  
3/16 pulsed period to recognize a zero value in the receiver buffer  
register, URXBUF, as the IR receive data.  
When bit [7] is "0", normal UART mode is selected. When it is "1",  
infra-red Tx/Rx mode is selected.  
10-4  
S3C4510B  
UART  
31  
8
7
6
5
4
3
2
1 0  
S
T
B
I
R
X
PMD  
WL  
[1:0] Word length per frame (WL)  
00 = 5 bits  
01 = 6 bits  
10 = 7 bits  
11 = 8 bits  
[2] Number of Stop bits at the end of frame (STB)  
0 = One stop bit per frame  
1 = Two stop bits per frame  
[5:3] Parity mode (PMD)  
0xx = No parity  
100 = Odd parity  
101 = Even parity  
110 = Parity forced/ checked as 1.  
111 = Parity forced/checked as 0.  
[6] Serial clock selection (SC)  
0 = Internal (MCLK)  
1 = External (UCLK)  
[7] Infra-red mode selection (IR)  
0 = Normal mode operation  
1 = Infra-red Tx/Rx mode  
Figure 10-2. UART Line Control Registers  
10-5  
UART  
S3C4510B  
UART CONTROL REGISTERS  
Table 10-4. UCON0 and UCON1 Registers  
Registers  
UCON0  
UCON1  
Offset Address  
0xD004  
R/W  
R/W  
R/W  
Description  
UART0 control register  
UART1 control register  
Reset Value  
0x00  
0xE004  
0x00  
Table 10-5. UART Control Register Description  
Bit Name Reset Value  
Bit Number  
[1:0]  
Receive mode (RxM)  
This two-bit value determines which function is currently able to  
read data from the UART receive buffer register, RBR: '00' =  
disable Rx mode, '01' = interrupt request, '10' = GDMA channel 0  
request, and '11' = GDMA channel 1 request.  
[2]  
Rx status interrupt  
enable  
This bit lets the UART generate an interrupt if an exception (a  
break, frame error, parity error, or overrun error) occurs during a  
receive operation.  
If this bit is set to "1", the UART generates a receive status  
interrupt. If this bit is "0", the receive status interrupt is not  
generated.  
[4:3]  
Transmit mode (TxM)  
This two-bit value determines which function is currently able to  
write Tx data to the UART transmit buffer register, UTXBUF. '00' =  
disable Tx mode, '01' = interrupt request, '10' = GDMA channel 0  
request, and '11' = GDMA channel 1 request.  
[5]  
[6]  
Data set ready (DSR)  
Send break  
Setting UCON[5] causes the S3C4510B to assert its data set ready  
(DSR) signal output, nUADSR. Clearing this bit to "0" causes the  
DSR output to be de-asserted.  
Setting UCON0/1[6] to "1" causes the UART to send a break. If it is  
"0", a break is not sent.  
A break is defined as a continuous Low level signal on the transmit  
data output with a duration of more than one frame transmission  
time.  
By setting this bit when the transmitter is empty (transmitter empty  
bit, USTAT[7] = "1"), you can use the transmitter to time the frame.  
When USTAT[7] is "1", write the transmit buffer register, UTXBUF,  
with the data to be transmitted. Then, poll the USTAT[7] value.  
When USTAT[7] returns to "1", clear (reset) the send break bit,  
UCON0/1[6].  
[7]  
Look-back mode  
Setting this bit causes the UART to enter Loop-back mode. In  
Loop-back mode, the transmit data output is sent High level and  
the transmit buffer register, UTXBUF, is internally connected to the  
receive buffer register, URXBUF.  
NOTE: This mode is provided for test purposes only. For  
normal operation, this bit should always be "0".  
10-6  
S3C4510B  
UART  
31  
8
7
6
5
4
3
2
1 0  
R
x
S
I
L S D  
P B S  
B K R  
TxM  
RxM  
[1:0] SIO receive mode selection (RxM)  
00 = Disable  
01 = Interrupt request  
10 = GDMA channel 0 request  
11 = GDMA channel 1 request  
[2] Receive status interrupt enable (RxSI)  
0 = Do not generate receive status interrupt  
1 = Generate receive status interrupt  
[4:3] SIO transmit mode selection (TxM)  
00 = Disable  
01 = Interrupt request  
10 = GDMA channel 0 request  
11 = GDMA channel 1 request  
[5] Data set ready (DSR)  
0 = Deassert S3C4510B DSR output (nUADSR)  
1 = Assert S3C4510B DSR output (nUADSR)  
[6] Send break (SBK)  
0 = Do not send break  
1 = Send break  
[7] Loop-back enable (LPB)  
0 = Normal operation mode  
1 = Enable look-up mode (for testing only)  
Figure 10-3. UART Control Registers  
10-7  
UART  
S3C4510B  
UART STATUS REGISTER  
Table 10-6. UCON0 and UCON1 Registers  
Registers  
USTAT0  
Offset Address  
R/W  
R
Description  
UART0 status register  
UART1 status register  
Reset Value  
0xC0  
0xD008  
0xE008  
USTAT1  
R
0xC0  
Table 10-7. UART Status Register Description  
Bit Name Reset Value  
Bit Number  
[0]  
Overrun error  
USTAT[0] is automatically set to "1" whenever an overrun error  
occurs during a serial data receive operation. The overrun error  
indicates that the new received data has overwritten old received  
data before the old data could be read.  
If the receive status interrupt enable bit, UCON[2] is "1", a receive  
status interrupt is generated if an overrun error occurs.  
This bit is automatically cleared to "0" whenever the UART status  
register (USTAT) is read.  
[1]  
[2]  
Parity error  
Frame error  
USTAT[1] is automatically set to "1" whenever a parity error occurs  
during a serial data receive operation. If the receive status interrupt  
enable bit, UCON[2], is "1", a receive status interrupt is generated  
if a parity error occurs.  
This bit is automatically cleared to "0" whenever the UART status  
register (USTAT) is read.  
USTAT[2] is automatically set to "1" whenever a frame error occurs  
during a serial data receive operation. A frame error occurs when a  
zero is detected instead of the Stop bit(s).  
If the receive status interrupt enable bit, UCON[2] is "1", a receive  
status interrupt is generated if a frame error occurs.  
The frame error bit is automatically cleared to "0" whenever the  
UART status register (USTAT) is read.  
[3]  
[4]  
Break interrupt  
USTAT[3] is automatically set to "1" to indicate that a break signal  
has been received.  
If the receive status interrupt enable bit, UCON[2], is "1", a receive  
status interrupt is generated if a break occurs.  
The break interrupt bit is automatically cleared to "0" when you  
read the UART status register.  
Data terminal ready  
(DTR)  
The USTAT[4] bit indicates the current signal level at the data  
terminal ready (DTR) pins (nUADTR). When this bit is "1", the level  
at the DTR pin (nUADTR) is Low. When it is "0", the DTR pin is  
High level.  
10-8  
S3C4510B  
UART  
Table 10-7. UART Status Register Description (Continued)  
Bit Number  
Bit Name  
Reset Value  
[5]  
Receive data ready  
USTAT[5] is automatically set to "1" whenever the receive data  
buffer register (URXBUF) contains valid data received over the  
serial port. The receive data can then be read from the URXBUF.  
When this bit is "0", the URXBUF does not contain valid data.  
Depending on the current setting of the UART receive mode bits,  
UCON[1:0], an interrupt or a DMA request is generated when  
USTAT[5] is "1".  
[6]  
Tx Buffer register empty USTAT[6] is automatically set to "1" when the transmit buffer  
register (UTXBUF) does not contain valid data. In this case, the  
UTXBUF can be written with the data to be transmitted.  
When this bit is "0", the UTXBUF contains valid Tx data that has  
not yet been copied to the transmit shift register. In this case, the  
UTXBUF cannot be written with new Tx data.  
Depending on the current setting of the SIO transmit mode bits,  
UCON[4:3], an interrupt or a DMA request will be generated  
whenever USTAT[6] is "1".  
[7]  
Transmit complete (TC) USTAT[7] is automatically set to "1" when the transmit buffer  
register has no valid data to transmit and when the Tx shift register  
is empty. When the transmitter empty bit is "1", it indicates to  
software that it can now disable the transmitter function block.  
10-9  
UART  
S3C4510B  
31  
8
7
6
5
4
3
2
1
0
T R D B  
B D T K  
E R R D  
T
C
F P O  
E E V  
[0] Overrun error (OV)  
0 = No overrun error during receive  
1 = Overrun error (generate receive status interrupt if UCON[2] is 1)  
[1] Parity error (PE)  
0 = No parity error during receive  
1 = Parity error (generate receive status interrupt if UCON[2] is 1)  
[2] Frame error (FE)  
0 = No frame error during receive  
1 = Frame error (generate receive status interrupt if UCON[2] is 1)  
[3] Break detect (BKD)  
0 = No break received  
1 = Break received (generate receive stauts interrupt if UCON[2] is 1)  
[4] Data terminal ready (DTR)  
0 = DTR pin (nUADTR) is High  
1 = DTR pin (nUADTR) is Low  
[5] Receive data ready (RDR)  
0 = No vaild data in the receive buffer register  
1 = Vaild data present in the receive buffer register  
(issue interrupt or DMa request if UCON[1:0] is set)  
[6] Transmit buffer register empty (TBE)  
0 = Vaild data in transmit holding register  
1 = No data in transmit holdign register  
(as the setting of UCON[4:3], interrupt or GDMA request is generated)  
[7] Transmit complete (TC)  
0 = Transmit in progress  
1 = Transmit complete; no data for Tx  
Figure 10-4. UART Status Registers  
10-10  
S3C4510B  
UART  
UART TRANSMIT BUFFER REGISTER  
The UART transmit buffer registers, UTXBUF0 and UTXBUF1, contain an 8-bit data value to be transmitted over  
the UART channel.  
Table 10-8. UXTBUF0 and UXTBUF1 Registers  
Registers  
UTXBUF0  
Offset Address  
0xD00C  
R/W  
W
Description  
UART0 transmit buffer register  
UART1 transmit buffer register  
Reset Value  
0xXX  
UTXBUF1  
0xE00C  
W
0xXX  
Table 10-9. UART Status Register Description  
Bit Name Reset Value  
Transmit data  
Bit Number  
This field contains the data to be transmitted over the single  
channel UART.  
[7:0]  
When this register is written, the transmit buffer register empty bit  
in the status register, USTAT[6], should be "1". This is to prevent  
overwriting of transmit data that may already be present in the  
UTXBUF.  
Whenever the UTXBUF is written with a new value, the transmit  
register empty bit, USTAT[6], is automatically cleared to "0".  
31  
8 7 6 5 4 3 2 1 0  
Transmit Data  
[7:0] Transmit data for UART  
Figure 10-5. UART Transmit Buffer Registers  
10-11  
UART  
S3C4510B  
UART RECEIVE BUFFER REGISTER  
The UART receive buffer registers, URXBUF0 and URXBUF1, contain an 8-bit data value for received serial  
data.  
Table 10-10. UXRBUF0 and UXRBUF1 Registers  
Registers  
URXBUF0  
Offset Address  
0xD010  
R/W  
R
Description  
UART0 receive buffer register  
UART1 receive buffer register  
Reset Value  
0xXX  
URXBUF1  
0xE010  
R
0xXX  
Table 10-11. UART Transmit Register Description  
Bit Name Reset Value  
Receive data  
Bit Number  
[7:0]  
This field contains the data received over the single channel  
UART.  
When the UART finishes receiving a data frame, the receive data  
ready bit in the UART status register, USTAT[5], should be "1".  
This prevents reading invalid receive data that may already be  
present in the URXBUF.  
Whenever the URXBUF is read, the receive data ready  
bit(USTAT[5]) is automatically cleared to "0".  
31  
8 7 6 5 4 3 2 1 0  
Receive Data  
[7:0] Receive data for UART  
Figure 10-6. UART Receive Buffer Registers  
10-12  
S3C4510B  
UART  
UART BAUD RATE DIVISOR REGISTER  
The values stored in the baud rate divisor registers, UBRDIV0 and UBRDIV1, let you determine the serial Tx/Rx  
clock rate (baud rate) as follows:  
BRGOUT = (MCLK2 or UCLK)/(CNT0 + 1)/(16^CNT1)/16  
Table 10-12. UBRDIV0 and UBRDIV0 Registers  
Registers  
UBRDIV0  
UBRDIV1  
Offset Address  
0xD014  
R/W  
R/W  
R/W  
Description  
UART0 baud rate divisor register  
UART1 baud rate divisor register  
Reset Value  
0x00  
0xE014  
0x00  
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  
CNT0  
CNT1  
[3:0] Baud reate divisor value CNT1  
xxx0 = divide by 1  
xxx1 = divide by 16  
[15:4] Time constant value for CNT0  
Figure 10-7. UART Baud Rate Divisor Registers  
10-13  
UART  
S3C4510B  
UART BAUD RATE COUNT AND CLOCK REGISTERS  
For test purpose only, the internal baud rate up counters, BRDCNT0 and BRDCNT1, can be directly accessed  
using register addressing. In addition, the baud rate clock can be monitored through the UART data set ready  
ports, nUADSR.  
If the BRDCLKn monitor value is "1", the baud rate clock can be monitored at the nUADSR pin. If it is "0" (its  
default value), or if you write a "0" to the BRDCLKn address, the UARD DSR signal output to the nUADSR port  
depends on the current setting of UART control register bit 5.  
Table 10-13. BRDCNTn and BRDCLKn Registers  
Register  
BRDCNT0  
BRDCNT1  
BRDCLK0  
BRDCLK1  
Offset Address  
0xD018  
R/W  
W
Description  
Reset Value  
UART0 baud rate count register  
UART1 baud rate count register  
UART0 baud rate clock monitor  
UART1 baud rate clock monitor  
0x0  
0x0  
0x0  
0x0  
0xE018  
W
0xD01C  
W
0xE01C  
W
Baud Rate Divisor  
(UBRDIVn)  
Baud Rate Clock  
Compare Logic  
Match Generator  
Baud Rate up Counter  
(URDCNTn)  
nUADSR  
BRDCLKn  
MCLK  
Chip Internal  
Chip External  
Figure 10-8. UART Baud Rate Clock Test Scheme  
10-14  
S3C4510B  
UART  
UART BAUD RATE EXAMPLES  
UART BRG input clock, MCLK2 is the system clock frequency divided by 2.  
If the system clock frequency is 50 MHz and MCLK2 is selected, the maximum BRGOUT output clock rate is  
MCLK2/16 (= 1.5625 MHz).  
UCLK is the external clock input pin for UART0, UART1. UART BRG input clock, MCLK2, UCLK can be selected  
by UCCON[6] register.  
CNT0  
CNT1  
MCLK2  
UCLK  
BRGOUT  
12-bit Counter  
Divide by 1 or 16  
Divide by 16  
Sample Clock  
SC  
NOTE:  
CNT0 = UBTDIVn [15:4], CNT1 = UBRDIVn [3:0], SC = ULCON [6]  
Figure 10-9. UART Baud Rate Generator (BRG)  
Table 10-14. Typical Baud Rates Examples of UART  
Baud Rates  
(BRGOUT)  
1200  
MCLK2 = 25 MHz  
UCLK = 33 MHz  
CNT0  
1301  
650  
324  
162  
80  
CNT1  
Freq.  
1200.1  
Dev.(%)  
0.0  
CNT0  
1735  
867  
433  
216  
108  
53  
CNT1  
Freq.  
Dev.(%)  
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
1200.08  
0.0064  
0.0064  
0.0064  
0.0064  
0.45  
2400  
2400.2  
0.0  
2400.15  
4800  
4807.7  
0.2  
4800.31  
9600  
9585.9  
- 0.1  
0.5  
9600.61  
19200  
19290.1  
38109.8  
57870.4  
111607.1  
223214.28  
520833.34  
19113.15  
38580.15  
57870.37  
115740.74  
231481.48  
416666.66  
38400  
40  
- 0.8  
0.5  
0.47  
57600  
26  
35  
0.47  
115200  
230400  
460860  
13  
- 3.1  
3.12  
13.01  
17  
0.47  
6
8
0.47  
2
4
9.59  
10-15  
UART  
S3C4510B  
< Receiver >  
Stop  
(1-2)  
UTXDn  
THRE  
Start  
Data Bits (5-8)  
Parity  
Start  
WR_THR  
INT_TXD  
< Receiver >  
Stop  
(1-2)  
URXDn  
INT_RXD  
URXBUF  
Start  
Data Bits (5-8)  
Parity  
Start  
Data Bits  
Previous Receive Data  
Valid Receive Data  
Figure 10-10. Interrupt-Based Serial I/O Timing Diagram (Tx and Rx Only)  
10-16  
S3C4510B  
UART  
<Transmitter >  
TxE  
TxD  
Select DMA Mode  
Stop  
(1-2)  
Start  
Data Bits (5-8)  
Parity  
THRE  
WR_THR  
nXDREQ  
nXDACK  
Figure 10-11. DMA-Based Serial I/O Timing Diagram (Tx Only)  
< Receiver >  
RxE  
Select DMA Mode  
Stop  
(1-2)  
URXDn  
URXBUFn  
nXDREQ  
nXDACK  
Start  
Data Bits (5-8)  
Parity  
Start  
Data Bits  
Previous Receive Data  
Valid Receive Data  
Figure 10-12. DMA-Based Serial I/O Timing Diagram (Rx Only)  
10-17  
UART  
S3C4510B  
SIO Frame  
Data Bits  
Start  
Bit  
Stop  
Bit  
0
1
0
1
0
0
1
1
0
1
Figure 10-13. Serial I/O Frame Timing Diagram (Normal UART)  
IR Transmit Frame  
Start  
Bit  
Stop  
Bit  
Data Bits  
3/16T  
0
1
0
1
0
0
1
1
0
1
7/16T 6/16T  
Bit frame = T  
Figure 10-14. Infra-Red Transmit Mode Frame Timing Diagram  
10-18  
S3C4510B  
UART  
IR Receive Frame  
Data Bits  
Start  
Bit  
Stop  
Bit  
3/16T  
0
1
0
1
0
0
1
1
0
1
Bit frame = T  
13/16T  
Figure 10-15. Infra-Red Receive Mode Frame Timing Diagram  
10-19  
UART  
S3C4510B  
NOTES  
10-20  
S3C4510B  
32-BIT TIMERS  
11 32-BIT TIMERS  
OVERVIEW  
The S3C4510B has two 32-bit timers. These timers can operate in interval mode or in toggle mode. The output  
signals are TOUT0 and TOUT1, respectively.  
You enable or disable the timers by setting control bits in the timer control register, TCON. An interrupt request is  
generated whenever a timer count-out (down count) occurs.  
INTERVAL MODE OPERATION  
In interval mode, a timer generates a one-shot pulse of a preset timer clock duration whenever a time-out occurs.  
This pulse generates a time-out interrupt that is directly output at the timer's configured output pin (TOUTn). In  
this case, the timer frequency monitored at the TOUTn pin is calculated as:  
fTOUT = fMCLK / Timer data value  
TOGGLE MODE OPERATION  
In toggle mode, the timer pulse continues to toggle whenever a time-out occurs. An interrupt request is generated  
whenever the level of the timer output signal is inverted (that is, when the level toggles). The toggle pulse is  
output directly at the configured output pin.  
Using toggle mode, you can achieve a flexible timer clock range with 50% duty. In toggle mode, the timer  
frequency monitored at the TOUTn pin is calculated as follows:  
fTOUT = fMCLK / (2 * Timer data value)  
fTOUT  
Interval Mode  
Time-out  
Time-out  
Time-out  
fTOUT  
Toggle Mode  
(Initial TOUTn is 0)  
Figure 11-1. Timer Output Signal Timing  
11-1  
32-BIT TIMERS  
S3C4510B  
TIMER OPERATION GUIDELINES  
The block diagram in Figure 11-2 shows how the 32-bit timers are configured in the S3C4510B. The following  
guidelines apply to timer functions.  
— When a timer is enabled, it loads a data value to its count register and begins decrement the count register  
value.  
— When the timer interval expires, the associated interrupt is generated. The base value is then reloaded and  
the timer continues decrement its count register value.  
— If a timer is disabled, you can write a new base value into its registers.  
— If the timer is halted while it is running, the base value is not automatically re-loaded.  
32-Bit Timer Data  
Register (TDATAn)  
Auto  
Re-load  
INTPND and  
INTMSK  
fMCLK  
32-Bit Timer Count  
Register (TCNTn)  
[Down Counter]  
Interrupt  
Request  
PND  
TMOD.TEn  
Pulse  
Generator  
TMOD.TMDn  
TMOD.TCLRn  
TOUTn  
Port 16, Port 17  
Data Out  
IOPCON.TOENn  
Figure 11-2. 32-Bit Timer Block Diagram  
11-2  
S3C4510B  
32-BIT TIMERS  
TIMER MODE REGISTER  
The timer mode register, TMOD, is used to control the operation of the two 32-bit timers. TMOD register settings  
are described in Figure 11-3.  
Table 11-1. TMOD Register  
Register  
TMOD  
Offset Address  
R/W  
Description  
Timer mode register  
Reset Value  
0x6000  
R/W  
32’h00000000  
31  
6
5
4
3
2
1
0
T
C
L
R
1
T
C
L
R
0
T
D
M
1
T
D
M
0
T
E
1
T
E
0
[0] Timer 0 enable (TE0)  
0 = Disable timer 0  
1 = Enable timer 0  
[1] Timer 0 mode selection (TMD0)  
0 = Interval mode  
1 = Toggle mode  
[2] Timer 0 initial TOUT0 value (TCLR0)  
0 = Initial TOUT0 is 0 in toggle mode  
1 = Initial TOUT0 is 1 in toggle mode  
[3] Timer 1 enable (TE1)  
0 = Disable timer 1  
1 = Enable timer 1  
[4] Timer 1 mode selection (TMD1)  
0 = Interval mode  
1 = Toggle mode  
[5] Timer 1 initial TOUT1 value (TCLR1)  
0 = Initial TOUT1 is 0 in toggle mode  
1 = Initial TOUT1 is 1 in toggle mode  
Figure 11-3. Timer Mode Register (TMOD)  
11-3  
32-BIT TIMERS  
S3C4510B  
TIMER DATA REGISTERS  
The timer data registers, TDATA0 and TDATA1, contain a value that specifies the time-out duration for each  
timer. The formula for calculating the time-out duration is: (Timer data + 1) cycles.  
Table 11-2. TDATA0 and TDATA1 Registers  
Register  
TDATA0  
TDATA1  
Offset Address  
0x6004  
R/W  
R/W  
R/W  
Description  
Timer 0 data register  
Reset Value  
0x00000000  
0x00000000  
0x6008  
Timer 1 data register  
31  
0
Receive Data  
[31:0] Timer 0/1 data value  
Figure 11-4. Timer Data Registers (TDATA0, TDATA1)  
TIMER COUNT REGISTERS  
The timer count registers, TCNT0 and TCNT1, contain the current timer 0 and 1 count value, respectively, during  
normal operation.  
Table 11-3. TCNT0 and TCNT1 Registers  
Register  
TCNT0  
Offset Address  
0x600C  
R/W  
R/W  
R/W  
Description  
Timer 0 counter register  
Reset Value  
0xFFFFFFFF  
0xFFFFFFFF  
TNCT1  
0x6010  
Timer 1 counter register  
31  
0
Timer Count  
[31:0] Timer 0/1 count value  
Figure 11-5. Timer Counter Registers (TCNT0, TCNT1)  
11-4  
S3C4510B  
I/O PORTS  
12 I/O PORTS  
OVERVIEW  
The S3C4510B has 18 programmable I/O ports. You can configure each I/O port to input mode, output mode, or  
special function mode. To do this, you write the appropriate settings to the IOPMOD and IOPCON registers. User  
can set filtering for the input ports using IOPCON register.  
The modes of the ports from port0 to port7 are determined only by the IOPMOD register. But port[11:8] can be  
used as xINTREQ[3:0], port[13:12] as nXDREQ[1:0], port[15:14] as nXDACK[1:0], port[16] as TOUT0, or port[17]  
as TOUT1 depending on the settings in IOPCON register.  
VDD  
IOPMOD  
IOPCON  
Alternate Functions  
Port0 - Port7  
Port8/xINTREQ0  
Output  
Latch  
IOPDATA  
(Write)  
Port11/xINTREQ3  
Port12/nXDREQ0  
Port13/nXDREQ1  
Port14/nXDACK0  
Port15/nXDACK1  
Port16/TOUT0  
IOPDATA  
(Read)  
Port17/TOUT1  
Active  
On/Off & Edge  
Detection  
Input  
Latch  
Filter  
On/Off  
Interrupt or DMA  
Request  
IOPCON  
IOPCON  
Figure 12-1. I/O Port Function Diagram  
12-1  
I/O PORTS  
S3C4510B  
I/O PORT SPECIAL REGISTERS  
Three registers control the I/O port configuration: IOPMOD, IOPCON, and IOPDATA. These registers are  
described in detail below.  
I/O PORT MODE REGISTER (IOPMOD)  
The I/O port mode register, IOPMOD, is used to configure the port pins, P17–P0.  
NOTE  
If the port is used for a special function such as an external interrupt request, an external DMA request,  
or acknowledge signal and timer outputs, its mode is determined by the IOPCON register, not by  
IOPMOD.  
Table 12-1. IOPMOD Register  
Register  
IOPMOD  
Offset Address  
R/W  
Description  
I/O port mode register  
Reset Value  
0x5000  
R/W  
0x00000000  
31  
18 17 16 15 14 13 12 11 10 9  
8
7
6
5
4
3
2
1
0
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
[0] I/O port mode bit for port 0  
0 = Input  
1 = Output  
[1] I/O port mode bit for port 1  
0 = Input  
1 = Output  
[2] I/O port mode bit for port 2  
0 = Input  
1 = Output  
[17] I/O port mode bit for port 17  
0 = Input  
1 = Output  
Figure 12-2. I/O Port Mode Register (IOPMOD)  
12-2  
S3C4510B  
I/O PORTS  
I/O PORT CONTROL REGISTER (IOPCON)  
The I/O port control register, IOPCON, is used to configure the port pins, P17–P8.  
NOTE  
If the port is used for a special function such as an external interrupt request, an external DMA request,  
or acknowledge signal and timer outputs, its mode is determined by the IOPCON register, not by  
IOPMOD.  
For the special input ports, S3C4510A provides 3-tap filtering. If the input signal levels are same for the three  
system clock periods, that level is taken as input for dedicated signals such as external interrupt requests and  
external DMA requests.  
Table 12-2. IOPCON Register  
Register  
IOPCON  
Offset Address  
R/W  
Description  
I/O port control register  
Reset Value  
0x5004  
R/W  
0x00000000  
12-3  
I/O PORTS  
S3C4510B  
31 30 29 28 27 26 25  
23 22  
20 19  
15 14  
10 9  
5
4
3
2
1
0
T T  
O O  
E E  
N N  
X
I
R
Q
3
X
I
R
Q
2
X
I
R
Q
1
X
I
R
Q
1
D
A
K
1
D
A
K
0
D
R
Q
1
D
R
Q
0
1
0
[4:0] Control external interrupt request 0 input for port 8 (xIRQ0)  
[4] Port 8 for xINTREQ0  
0 = Disable  
1 = Enable  
[3] 0 = Active Low  
1 = Active High  
[2] 0 = Filtering off  
1 = Filtering on  
[1:0] 00 = Level detection  
01 = Rising edge detection  
10 = Falling edge detection  
11 = Both edge detection  
[9:5] Control external interrupt request 1 input for port 9 (xIRQ1)  
(See control external interrupt request 1.)  
[14:10] Control external interrupt request 2 input for port 10 (xIRQ2)  
(See control external interrupt request 2.)  
[19:15] Control external interrupt request 3 input for port 11 (xIRQ3)  
(See control external interrupt request 3.)  
[22:20] Control external DMA request 0 input for port 12 (DRQ0)  
[22] Port 12 for nXDREQ0  
0 = Disable  
1 = Enable  
[21] 0 = Filtering off  
1 = Filtering on  
[20] 0 = Active Low  
1 = Active High  
[25:23] Control external DMA request 1 input for port 13 (DRQ1)  
[25] Port 13 for nXDREQ1  
0 = Disable  
1 = Enable  
[24] 0 = Filtering off  
[23] 0 = Active Low  
1 = Filtering on  
1 = Active High  
[27:26] Control external DMA acknowledge 0 output for port 14 (DAK0)  
[27] Port 14 for nXDACK0  
0 = Disable  
1 = Enable  
[26] 0 = Active Low  
1 = Active High  
[29:28] Control external DMA acknowledge 1 output for port 15 (DAK1)  
[29] Port 15 for nXDACK1  
0 = Disable  
1 = Enable  
[28] 0 = Active Low  
1 = Active High  
[30] Control timeout 0 for port 16 (TOEN0)  
0 = Disable  
1 = Enable  
[31] Control timeout 1 for port 17 (TOEN1)  
0 = Disable  
1 = Enable  
Figure 12-3. I/O Port Control Register (IOPCON)  
12-4  
S3C4510B  
I/O PORTS  
I/O PORT DATA REGISTER (IOPDATA)  
The I/O port data register, IOPDATA, contains one-bit read values for I/O ports that are configured to input mode  
and one-bit write values for ports that are configured to output mode. Bits[17:0] of the 18-bit I/O port register  
value correspond directly to the 18 port pins, P17–P0.  
Table 12-3. IOPDATA Register  
Register  
IOPDATA  
Offset Address  
R/W  
Description  
I/O port data register  
Reset Value  
0x5008  
R/W  
Undefined  
31  
18 17 16 15 14 13 12 11 10 9  
P P P P P P P P P P P P P P P P P P  
17 16 15 14 13 12 11 10 9  
8 7 6 5 4 3 2 1 0  
8
7 6 5 4 3 2 1 0  
[17:0] I/O port read/write values for ports 17-0 (P0-P17)  
NOTE: The values in the I/O port data register reflect the signal level on the  
respective I/O port pins. When the ports are configured to output mode,  
the bit reflects the ports write value. When the port is configured to input  
mode, the bit reflects the ports read value.  
Figure 12-4. I/O Port Data Register (IOPDATA)  
12-5  
I/O PORTS  
S3C4510B  
MCLKO  
xINTREQn  
Internal INTREQn  
IOPCON.xIRQn [1:0] (= 00)  
IOPCON.xIRQn [1:0] (= 01)  
IOPCON.xIRQn [1:0] (= 11)  
Figure 12-5. External Interrupt Request Timing (Active High)  
MCLKO  
xINTREQn  
Internal INTREQn  
IOPCON.xIRQn [1:0] (= 00)  
IOPCON.xIRQn [1:0] (= 01)  
IOPCON.xIRQn [1:0] (= 10)  
IOPCON.xIRQn [1:0] (= 11)  
Figure 12-6. External Interrupt Request Timing (Active Low)  
12-6  
S3C4510B  
INTERRUPT CONTROLLER  
13 INTERRUPT CONTROLLER  
OVERVIEW  
The S3C4510B interrupt controller has a total of 21 interrupt sources. Interrupt requests can be generated by  
internal function blocks and at external pins.  
The ARM7TDMI core recognizes two kinds of interrupts: a normal interrupt request (IRQ), and a fast interrupt  
request (FIQ). Therefore all S3C4510B interrupts can be categorized as either IRQ or FIQ. The S3C4510B  
interrupt controller has an interrupt pending bit for each interrupt source.  
Four special registers are used to control interrupt generation and handling:  
— Interrupt priority registers. The index number of each interrupt source is written to the pre-defined interrupt  
priority register field to obtain that priority. The interrupt priorities are pre-defined from 0 to 20.  
— Interrupt mode register. Defines the interrupt mode, IRQ or FIQ, for each interrupt source.  
— Interrupt pending register. Indicates that an interrupt request is pending. If the pending bit is set, the interrupt  
pending status is maintained until the CPU clears it by writing a "1" to the appropriate pending register. When  
the pending bit is set, the interrupt service routine starts whenever the interrupt mask register is "0". The  
service routine must clear the pending condition by writing a "1" to the appropriate pending bit. This avoids  
the possibility of continuous interrupt requests from the same interrupt pending bit.  
— Interrupt mask register. Indicates that the current interrupt has been disabled if the corresponding mask  
bit is "1". If an interrupt mask bit is "0" the interrupt will be serviced normally. If the global mask bit (bit 21) is  
set to "1", no interrupts are serviced. However, the source's pending bit is set if the interrupt is generated.  
When the global mask bit has been set to "0", the interrupt is serviced.  
13-1  
INTERRUPT CONTROLLER  
S3C4510B  
INTERRUPT SOURCES  
The 21 interrupt sources in the S3C4510B interrupt structure are listed, in brief, as follows:  
Table 13-1. S3C4510B Interrupt Sources  
Index Values  
[20]  
[19]  
[18]  
[17]  
[16]  
[15]  
[14]  
[13]  
[12]  
[11]  
[10]  
[9]  
Interrupt Sources  
I2C-bus interrupt  
Ethernet controller MAC Rx interrupt  
Ethernet controller MAC Tx interrupt  
Ethernet controller BDMA Rx interrupt  
Ethernet controller BDMA Tx interrupt  
HDLC channel B Rx interrupt  
HDLC channel B Tx interrupt  
HDLC channel A Rx interrupt  
HDLC channel A Tx interrupt  
Timer 1 interrupt  
Timer 0 interrupt  
GDMA channel 1 interrupt  
GDMA channel 0 interrupt  
UART 1 receive and error interrupt  
UART 1 transmit interrupt  
UART 0 receive and error interrupt  
UART 0 transmit interrupt  
External interrupt 3  
[8]  
[7]  
[6]  
[5]  
[4]  
[3]  
[2]  
External interrupt 2  
[1]  
External interrupt 1  
[0]  
External interrupt 0  
13-2  
S3C4510B  
INTERRUPT CONTROLLER  
INTERRUPT CONTROLLER SPECIAL REGISTERS  
INTERRUPT MODE REGISTER  
Bit settings in the interrupt mode register, INTMOD, specify if an interrupt is to be serviced as a fast interrupt  
(FIQ) or a normal interrupt (IRQ).  
Table 13-2. INTMOD Register  
Register  
INTMOD  
Offset  
Address  
R/W  
Description  
Reset Value  
0x4000  
R/W  
Interrupt mode register  
0x00000000  
31  
21 20 19 18 17 16 15 14 13 12 11 10 9  
8
7
6
5
4
3
2
1
0
INTMOD  
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
[20:0] Interrupt mode bits  
NOTE: Each of the 21 bits in the interrupt mode enable register, INTMOD,  
corresponds to an interrupt source. When the source interrupt mode bit  
is set to 1, the interrupt is processed by the ARM7TDMI core in FIQ  
(fast interrupt) mode. Otherwise, it is processed in IRQ mode (normal  
interrupt). The 21 interrupt sources are mapped as follows:  
[20] I2C interrupt  
[19] Ethernet controller MAC Rx interrupt  
[18] Ethernet controller MAC Tx interrupt  
[17] Ethernet controller BDMA Rx interrupt  
[16] Ethernet controller BDMA Tx interrupt  
[15] HDLC channel B Rx interrupt  
[14] HDLC channel B Tx interrupt  
[13] HDLC channel A Rx interrupt  
[12] HDLC channel A Tx interrupt  
[11] Timer 1 interrupt  
[10] Timer 0 interrupt  
[9] GDMA channel 1 interrupt  
[8] GDMA channel 0 interrupt  
[7] UART1 receive and error interrupt  
[6] UART1 transmit interrupt  
[5] UART0 receive and error interrupt  
[4] UART0 transmit interrupt  
[3] External interrupt 3  
[2] External interrupt 2  
[1] External interrupt 1  
[0] External interrupt 0  
Figure 13-1. Interrupt Mode Register (INTMOD)  
13-3  
INTERRUPT CONTROLLER  
S3C4510B  
INTERRUPT PENDING REGISTER  
The interrupt pending register, INTPND, contains interrupt pending bits for each interrupt source. This register  
has to be cleared at the top of an interrupt service routine.  
Table 13-3. INTPND Register  
Register  
INTPND  
Offset Address  
R/W  
Description  
Interrupt pending register  
Reset Value  
0x4004  
R/W  
0x00000000  
31  
21 20 19 18 17 16 15 14 13 12 11 10 9  
8
7
6
5
4
3
2
1
0
INTPND  
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
x
[20:0] Interrupt pending bits  
NOTE:  
Each of the 21 bits in the interrupt mode pending register, INTPND,  
corresponds to an interrupt source. When an interrupt request is  
generated, its pending bit is set to 1. The service routine must then  
clear the pending condition by writing a 1 to the apropriate pending  
bit at start. The 21 interrupt sources are mapped as follows:  
[20] I2C interrupt  
[19] Ethernet controller MAC Rx interrupt  
[18] Ethernet controller MAC Tx interrupt  
[17] Ethernet controller BDMA Rx interrupt  
[16] Ethernet controller BDMA Tx interrupt  
[15] HDLC channel B Rx interrupt  
[14] HDLC channel B Tx interrupt  
[13] HDLC channel A Rx interrupt  
[12] HDLC channel A Tx interrupt  
[11] Timer 1 interrupt  
[10] Timer 0 interrupt  
[9] GDMA channel 1 interrupt  
[8] GDMA channel 0 interrupt  
[7] UART1 receive and error interrupt  
[6] UART1 transmit interrupt  
[5] UART0 receive and error interrupt  
[4] UART0 transmit interrupt  
[3] External interrupt 3  
[2] External interrupt 2  
[1] External interrupt 1  
[0] External interrupt 0  
Figure 13-2. Interrupt Pending Register (INTPND)  
13-4  
S3C4510B  
INTERRUPT CONTROLLER  
INTERRUPT MASK REGISTER  
The interrupt mask register, INTMSK, contains interrupt mask bits for each interrupt source.  
Table 13-4. INTMSK Register  
Register  
INTMSK  
Offset Address  
R/W  
Description  
Interrupt mask register  
Reset Value  
0x4008  
R/W  
0x003FFFFF  
31  
21 20 19 18 17 16 15 14 13 12 11 10 9  
8 7 6 5 4 3 2 1 0  
INTMSK  
G X X X X X X X X X X X X X X X X X X X X X  
[20:0] Individual interrupt mask bits  
NOTE:  
Each of the 21 bits in the interrupt mask register, INTMSK,  
(except for the global mask bit, G) corresponds to an interrupt source.  
When a source interrupt mask bit is 1, the interrupt is not serviced by the  
CPU when the corresponding interrupt request is generated. If the mask  
bit is 0, the interrupt is serviced upon request. And if global mask bit  
(bit 21) is 1, no interrupts are serviced. (However, the source pending  
bit is set whenever the interrupt is generated.) After the global mask bit  
is cleared, the interrupt is serviced. The 21 interrupt sources are mapped  
as follows:  
[20] I2C interrupt  
[19] Ethernet controller MAC Rx interrupt  
[18] Ethernet controller MAC Tx interrupt  
[17] Ethernet controller BDMA Rx interrupt  
[16] Ethernet controller BDMA Tx interrupt  
[15] HDLC channel B Rx interrupt  
[14] HDLC channel B Tx interrupt  
[13] HDLC channel A Rx interrupt  
[12] HDLC channel A Tx interrupt  
[11] Timer 1 interrupt  
[10] Timer 0 interrupt  
[9] GDMA channel 1 interrupt  
[8] GDMA channel 0 interrupt  
[7] UART1 receive and error interrupt  
[6] UART1 transmit interrupt  
[5] UART0 receive and error interrupt  
[4] UART0 transmit interrupt  
[3] External interrupt 3  
[2] External interrupt 2  
[1] External interrupt 1  
[0] External interrupt 0  
[21] Global interrupt mask bit  
0 = Enable interrupt requests  
1 = Disable all interrupt requests  
Figure 13-3. Interrupt Mask Register (INTMSK)  
13-5  
INTERRUPT CONTROLLER  
S3C4510B  
INTERRUPT PRIORITY REGISTERS  
The interrupt priority registers, INTPRI0–INTPRI5, contain information about which interrupt source is assigned to  
the pre-defined interrupt priority field. Each INTPRIn register value determines the priority of the corresponding  
interrupt source. The lowest priority value is priority 0, and the highest priority value is priority 20.  
The index value of each interrupt source is written to one of the above 21 positions (see Figure 13-4). The  
position value then becomes the written interrupt's priority value. The index value of each interrupt source is  
listed in Table 13-1.  
Table 13-5. Interrupt Priority Register Overview  
Register  
INTPRI0  
Offset Address  
0x400C  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
R/W  
Description  
Interrupt priority register 0  
Reset Value  
0x03020100  
0x07060504  
0x0B0A0908  
0x0F0E0D0C  
0x13121110  
0x00000014  
INTPRI1  
INTPRI2  
INTPRI3  
INTPRI4  
INTPRI5  
0x4010  
Interrupt priority register 1  
Interrupt priority register 2  
Interrupt priority register 3  
Interrupt priority register 4  
Interrupt priority register 5  
0x4014  
0x4018  
0x401C  
0x4020  
26 25  
23  
0
14 13 12 11 10 9  
8
7
0
6
0
5
0
4
3
2
1 0  
29 28 27  
24  
22  
21 20 19 18 17 16 15  
31 30  
INTPRI0  
INTPRI1  
INTPRI2  
INTPRI3  
INTPRI4  
INTPRI5  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
PRIORITY3  
PRIORITY7  
PRIORITY11  
PRIORITY15  
PRIORITY19  
0
0
0
0
0
0
0
0
0
0
0
0
PRIORITY2  
PRIORITY6  
PRIORITY10  
PRIORITY14  
PRIORITY18  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
PRIORITY1  
PRIORITY5  
PRIORITY9  
PRIORITY0  
PRIORITY4  
PRIORITY8  
Low  
Priority  
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
PRIORITY13  
PRIORITY17  
PRIORITY12  
PRIORITY16  
PRIORITY20  
High  
Priority  
0
0
0
0
0
0
0
0
0
0
0 0 0 0 0  
High Priority  
Low Priority  
Figure 13-4. Interrupt Priority Register (INTPRIn)  
13-6  
S3C4510B  
INTERRUPT CONTROLLER  
INTERRUPT OFFSET REGISTER  
The interrupt offset register, INTOFFSET, contains the interrupt offset address of the interrupt, which has the  
highest priority among the pending interrupts. The content of the interrupt offset address is "bit position value of  
the interrupt source << 2".  
If all interrupt pending bits are "0" when you read this register, the return value is "0x00000054".  
This register is valid only under the IRQ or FIQ mode in the ARM7TDMI. In the interrupt service routine, you  
should read this register before changing the CPU mode.  
INTOSET_FIQ/INTOSET_IRQ register can be used to get the highest priority interrupt without CPU mode  
change. Other usages are similar to INTOFFSET.  
NOTE  
If the lowest interrupt priority (priority 0) is pending, the INTOFFSET value will be "0x00000000". The  
reset value will, therefore, be changed to "0x00000054" (to be differentiated from interrupt pending  
priority 0).  
Table 13-6. INTOFFSET Register  
Register  
Offset  
R/W  
Description  
Reset Value  
Address  
INTOFFSET  
0x4024  
0x4030  
0x4034  
R
R
R
Interrupt offset register  
0x00000054  
0x00000054  
0x00000054  
INTOSET_FIQ  
INTOSET_IRQ  
FIQ interrupt offset register  
IRQ interrupt offset register  
13-7  
INTERRUPT CONTROLLER  
S3C4510B  
INTERRUPT PENDING BY PRIORITY REGISTER  
The interrupt pending by priority register, INTPNDPRI, contains interrupt pending bits, which are re-ordered by  
the INTPRIn register settings. INTPNDPRI[20] is mapped to the interrupt source of whichever bit index is written  
into the priority 20 field of the INTPRIn registers.  
This register is useful for testing. To validate the interrupt pending by priority value, you can obtain the highest  
priority pending interrupt from the interrupt offset register, INTOFFSET.  
Table 13-7. INTPNDPRI Register  
Register  
Offset Address  
R/W  
Description  
Reset Value  
INTPNDPRI  
0x4028  
R
Interrupt pending by priority  
0x00000000  
INTERRUPT PENDING TEST REGISTER  
The interrupt pending test register, INTPNDTST, is used to set or clear INTPND and INTPNDPRI. If user writes  
data to this register, it is written into both the INTPND register and INTPNDPRI register. The interrupt pending  
test register, INTPNDTST, is also useful for testing.  
For INTPND, the same bit position is updated with the new coming data. For INTPNDPRI, the mapping bit  
position by INTPRIn registers is updated with the new coming data to keep with the contents of the INTPND  
register.  
Table 13-8. INTPNDTST Register  
Register  
Offset  
R/W  
Description  
Reset Value  
Address  
INTPNDTST  
0x402C  
W
Interrupt pending test register  
0x00000000  
13-8  
S3C4510B  
ELECTRICAL DATA  
14 ELECTRICAL DATA  
OVERVIEW  
This chapter describes the S3C4510B and S3C4510X electrical data.  
ABSOLUTE MAXIMUM RATINGS  
Table 14-1. Absolute Maximum Ratings  
Parameter  
Supply Voltage  
Symbol  
Rating  
Units  
VDD/VDDA  
– 0.3 to 3.8  
V
VIN  
– 0.3 to VDD + 0.3  
– 0.3 to 5.5  
DC input Voltage  
3.3 V I/O  
V
5 V-tolerant  
IIN  
DC input current  
mA  
°C  
± 10  
TOPR  
TSTG  
Operating temperature  
Storage temperature  
0 to 70  
– 40 to 125  
°C  
ABSOLUTE MAXIMUM RATINGS  
Table 14-2. Recommended Operating Conditions  
Parameter  
Symbol  
Rating  
Units  
VDD/VDDA  
Supply Voltage  
3.0 to 3.6  
upto 50  
820  
V
fOSC  
LF  
Oscillator frequency  
MHz  
pF  
External loop filter capacitance  
Commercial temperature  
TA  
0 to 70  
°C  
NOTE: It is strongly recommended that all the supply pins (V /V  
) be powered from the same source to avoid power  
DD DDA  
latch-up.  
14-1  
ELECTRICAL DATA  
S3C4510B  
D.C. ELECTRICAL CHARACTERISTICS  
Table 14-3. D.C Electrical Characteristics  
°
VDD = 3.3 V 0.3 V, VEXT = 5 0.25 V, TA = 0 to 70 C (in case of 5 V-tolerant I/O)  
Parameter  
Symbol  
Conditions  
Min  
Typ  
Max  
Unit  
(1)  
High level input voltage LVCMOS  
interface  
2.0  
V
VIH  
(1)  
Low level input voltage  
LVCMOS  
interface  
0.8  
V
V
VIL  
Switching threshold  
VT  
LVCMOS  
LVCMOS  
LVCMOS  
1.4  
2.0  
Schmitt trigger positive-going threshold  
VT+  
VT–  
Schmitt trigger negative-going  
threshold  
0.8  
IIH  
VIN = VDD  
High level input current  
Low level input current  
Input buffer  
– 10  
10  
10  
60  
mA  
mA  
Input buffer  
with pull-up  
30  
IIL  
VIN = VSS  
Input buffer  
– 10  
– 60  
10  
Input buffer  
with pull-  
down  
– 30  
– 10  
VOH  
VDD  
High level output voltage Type B1 to  
B16(2)  
V
IOH = – 1 mA  
0.05  
IOH = – 1 mA  
IOH = – 2 mA  
IOH = – 4 mA  
IOH = – 6 mA  
IOL = 1 mA  
Type B1  
Type B2  
Type B4  
Type B6  
2.4  
VOL  
Low level output voltage Type B1 to  
B16(2)  
0.05  
0.4  
V
IOL = 1 mA  
IOL = 2 mA  
IOL = 4 mA  
IOL = 6 mA  
Type B1  
Type B2  
Type B4  
Type B6  
IOZ  
VOUT = VSS or  
VDD  
Tri-state output leakage current  
– 10  
10  
mA  
IDD  
VDD = 3.6 V,  
Maximum operating current  
230  
mA  
fMCLK = 50MHz  
NOTES:  
1. All 5 V-tolerant inputs have less than 0.2 V hysterics.  
2. Type B1 means 1 mA output driver cells, and Type B6/B24 means 6 mA/24 mA output driver cells.  
14-2  
S3C4510B  
ELECTRICAL DATA  
Table 14-4. A.C Electrical Characteristics for S3C4510X  
°
(TA = 0 to 70 C, VDD = 3.0 V to 3.6 V)  
Signal Name  
Description  
Min  
4.03  
4.99  
Max  
10.57  
12.02  
3.90  
Edge  
P
tMCLKOd  
tEMZ  
MCLKO delay for Internal Positive Edge Clock (MCLK)  
Memory Control Signal High-Z Time  
ExtMREQ Setup Time  
N
P
tEMRs  
tEMRh  
tEMAr  
ExtMREQ Hold Time  
0
P
ExtMACK Rising Edge Delay Time  
9.55  
9.30  
4.75  
6.76  
3.24  
3.81  
3.36  
23.30  
22.70  
11.50  
16.53  
7.90  
N
N
N
N
N
N
P
tEMAf  
ExtMACK Falling Edge Delay Time  
tADDRh  
tADDRd  
tNRCS  
tNROE  
tNWBE  
tRDs  
Address Hold Time  
Address Delay Time  
ROM/SRAM/Flash Bank Chip Select Delay Time  
ROM/SRAM or External I/O Bank Output Enable Delay  
ROM/SRAM or External I/O Bank Write Byte Enable Delay  
Read Data Setup Time  
9.24  
8.13  
10.82  
N
N
N
N
P
tRDh  
Read Data Hold Time  
0
tWDd  
Write Data Delay Time (SRAM or External I/O) (ref:nWBE)  
Write Data Hold Time (SRAM or External I/O) (ref:MCLK)  
DRAM Row Address Strobe Active Delay  
DRAM Row Address Strobe Release Delay  
DRAM Column Address Strobe Read Active Delay  
DRAM CAS Signal Release Read Delay Time  
DRAM Column Address Strobe Write Active Delay  
DRAM CAS Signal Release Write Delay Time  
DRAM Bank Write Enable Delay Time  
DRAM Bank Out Enable Delay Time  
External I/O Bank Chip Select Delay Time  
DRAM Write Data Delay Time (DRAM)  
DRAM Write Data Hold Time (DRAM)  
External Wait Setup Time  
1.86  
2.05  
3.53  
4.95  
3.58  
3.57  
3.60  
3.62  
3.93  
3.80  
3.58  
4.96  
2.70  
4.49  
4.86  
8.59  
11.99  
8.70  
8.62  
8.72  
8.73  
9.54  
9.26  
8.74  
11.97  
6.42  
4.82  
tWDh  
tNRASf  
tNRASr  
tNCASf  
tNCASr  
tNCASwf  
tNCASwr  
tNDWE  
tNDOE  
tNECS  
tWDDd  
tWDDh  
tWs  
N
P
P
N
N
N
N
N
N
N
N
N
tWh  
External Wait Hold Time  
0
NOTE: The edge (N) is calculated from SCLK(MCLK) falling and (P) is rising.  
14-3  
ELECTRICAL DATA  
S3C4510B  
Table 14-5. A.C Electrical Characteristics for S3C4510B  
°
(TA = 0 to 70 C, VDD = 3.0 V to 3.6 V)  
Signal Name  
Description  
Min  
4.07  
5.08  
Max  
9.37  
Edge  
P
tMCLKOd  
tEMZ  
MCLKO delay for Internal Positive Edge Clock(MCLK)  
Memory Control Signal High-Z Time  
ExtMREQ Setup Time  
11.76  
6.31  
N
P
tEMRs  
tEMRh  
tEMAr  
ExtMREQ Hold Time  
0
P
ExtMACK Rising Edge Delay Time  
12.19  
9.33  
5.16  
6.13  
3.96  
3.82  
4.70  
28.54  
21.87  
12.08  
14.35  
9.29  
N
N
N
N
N
N
P
tEMAf  
ExtMACK Falling Edge Delay Time  
tADDRh  
tADDRd  
tNRCS  
tNROE  
tNWBE  
tRDs  
Address Hold Time  
Address Delay Time  
ROM/SRAM/Flash Bank Chip Select Delay Time  
ROM/SRAM or External I/O Bank Output Enable Delay  
ROM/SRAM or External I/O Bank Write Byte Enable Delay  
Read Data Setup Time  
8.96  
11.13  
12.46  
N
N
N
N
P
tRDh  
Read Data Hold Time  
0
tWDd  
Write Data Delay Time (SRAM or External I/O) (ref:nWBE)  
Write Data Hold Time (SRAM or External I/O) (ref:MCLK)  
DRAM Row Address Strobe Active Delay  
DRAM Row Address Strobe Release Delay  
DRAM Column Address Strobe Read Active Delay  
DRAM CAS Signal Release Read Delay Time  
DRAM Column Address Strobe Write Active Delay  
DRAM CAS Signal Release Write Delay Time  
DRAM Bank Write Enable Delay Time  
DRAM Bank Out Enable Delay Time  
External I/O Bank Chip Select Delay Time  
DRAM Write Data Delay Time (DRAM)  
DRAM Write Data Hold Time (DRAM)  
External Wait Setup Time  
2.50  
1.94  
3.84  
5.70  
3.77  
4.23  
3.78  
4.27  
4.81  
4.15  
4.12  
7.00  
3.27  
5.65  
4.45  
9.00  
13.31  
8.84  
9.88  
8.86  
9.99  
11.25  
9.71  
9.63  
16.32  
7.58  
4.46  
tWDh  
tNRASf  
tNRASr  
tNCASf  
tNCASr  
tNCASwf  
tNCASwr  
tNDWE  
tNDOE  
tNECS  
tWDDd  
tWDDh  
tWs  
N
P
P
N
N
N
N
N
N
N
N
N
tWh  
External Wait Hold Time  
0
NOTE: The edge (N) is calculated from SCLK(MCLK) falling and (P) is rising.  
14-4  
S3C4510B  
MECHANICAL DATA  
15 MECHANICAL DATA  
OVERVIEW  
This section describes the mechanical data for the S3C4510B 208-pin QFP package.  
15-1  
MECHANICAL DATA  
S3C4510B  
30.60 BSC  
28.00 BSC  
0-7  
+ 0.05  
0.15 - 0.06  
0.08 MAX  
208-QFP-2828B  
#144  
+ 0.07  
0.20 - 0.03  
#1  
0.25 MIN  
3.40 ± 0.20  
4.10 MAX  
0.50 BSC  
0.08 MAX  
(1.25)  
NOTE  
: Dimensions are in millimeters.  
Figure 15-1. 208-QFP-2828B Package Dimensions  
15-2  
S3C4510B  
APPENDIX A  
APPENDIX A  
TEST ACCESS PORT  
This section describes relevant sections of the IEEE Standard 1149.1 Compatible Test Access Port (TAP). This  
standard applies to the Test Access Port and Boundary Scan (JTAG) specification, which is supported by the  
S3C4510B microcontoller.  
In test mode, package pads are monitored by the serial scan circuitry. This is done to support connectivity testing  
during manufacturing, as well as system diagnostics. JTAG control is not used to drive internal data out of the  
S3C4510B.  
To conform with IEEE 1194.1, the S3C4510B has a TAP controller, an instruction register, a bypass register, and  
an ID register. These components are described in detail below.  
A-1  
APPENDIX A  
S3C4510B  
TAP CONTROLLER  
The TAP controller is responsible for interpreting the sequence of logical values on the TMS signal. It is a  
synchronous state machine which controls the JTAG logic (see Figure B-1). In Figure B-1, the value shown next  
to each curved arrow represents the value of the TMS signal as it is sampled on the rising edge of the TCK  
signal.  
Test Login Reset  
1
0
1
Run-Test/Idle  
Select-DR_Scan  
Select-IR_Scan  
0
0
0
Capture-DR  
Capture-IR  
0
0
Shift-DR  
Shift-IR  
1
Exit1-DR  
0
1
Exit1-IR  
0
Pause-DR  
1
Pause-IR  
1
Exit2-DR  
1
Exit2-IR  
1
Update-DR  
Update-IR  
1
0
1
0
Figure A-1. TAP Controller State Machine  
A-2  
S3C4510B  
APPENDIX A  
BOUNDARY SCAN REGISTER  
The S3C4510B scan chain implementation uses a 233-bit boundary scan register. This register contains bits for  
all device signals and clock pins, and for associated control signals.  
All bi-directional pins have two register bits in the boundary scan register for pin data. Each pin is controlled by  
an associated control bit in the boundary scan register. The twenty-three bits in the boundary scan register define  
the output enable signals for associated groups of bi-directional and tri-stateable pins. The control bits and their  
bit positions are listed in Table B-1.  
Table A-1. Boundary Scan Control Bits  
Name  
Bit Number  
Name  
Bit Number  
Name  
penb [1]  
penb [0]  
d_enb  
Bit Number  
penb [17]  
penb [16]  
penb [15]  
penb [14]  
penb [13]  
penb [12]  
penb [11]  
penb [10]  
9
penb [9]  
penb [8]  
penb [7]  
penb [6]  
penb [5]  
penb [4]  
penb [3]  
penb [2]  
33  
36  
39  
42  
45  
48  
51  
54  
57  
12  
15  
18  
21  
24  
27  
30  
60  
127  
184  
192  
211  
222  
dis_bus  
mdio_oe  
txcben  
txcaen  
BOUNDARY SCAN DEFINITIONS  
The boundary scan bit definitions are listed in Tables B-2 through B-5:  
— The first column in the table defines the bit's ordinal position in the boundary scan register. The shift register  
cell nearest TDO (that is, the first bit to be shifted out) is defined as bit 0. The last bit to be shifted out is bit  
number 232.  
— The second column refers to one of the four S3C4510B cell types: jtin1, jtbi1, and jtout1.  
— The third column lists the pin name of pin-related cells or defines the name of bi-directional control register  
bits.  
— The fourth column lists the pin type. TS-Output indicates a tri-stateable output pin, and OD-I/O denotes an  
open-drain bi-directional pin.  
— The fifth column indicates the associated boundary scan register control bit for bi-directional, tri-state output.  
A-3  
APPENDIX A  
S3C4510B  
Table A-2. Boundary Scan Definitions (Page 1)  
Bit  
Number  
Cell  
Type  
Pin/Cell  
Name  
Pin  
Type  
Output  
CTL Cell Number  
Bit  
Cell  
Type  
Pin/Cell  
Name  
Pin  
Type  
Output  
CTL Cell  
0
1
2
3
4
5
jtin 1  
UARXD1  
Input  
Output  
Output  
Input  
32  
33  
34  
35  
36  
37  
jtbi1  
jtout1  
jtbi1  
P[10]  
penb[9]  
P[9]o  
Input  
jtout 1 nUADSR0  
jtout 1  
jtin 1  
jtin 1  
jtbi 1  
UATXD0  
UADTR0  
UARXD0  
SDA  
TS-Output penb[9]  
jtbi1  
P[9]i  
Input  
Input  
jtout1  
jtbi1  
penb[8]  
P[8]  
OD-  
TS-Output  
Output  
6
7
jtbi 1  
jtbi 1  
SDA  
SCL  
OD-Input  
38  
39  
jtbi1  
P[8]  
Input  
OD-  
jtout1  
penb[7]  
Output  
8
jtbi 1  
jtout 1  
jtbi 1  
jtbi 1  
jtout 1  
jtbi 1  
jtbi 1  
jtout 1  
jtbi 1  
jtbi 1  
jtout 1  
jtbi 1  
jtbi 1  
jtout 1  
jtbi 1  
jtbi 1  
jtout 1  
jtbi 1  
jtbi 1  
jtout 1  
jtbi 1  
jtbi 1  
jtout 1  
jtbi 1  
SCL  
pend[17]  
P[17]  
OD-Input  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
59  
60  
61  
62  
63  
jtbi1  
jtbi1  
jtout1  
jtbi1  
jtbi1  
jtout1  
jtbi1  
jtbi1  
jtout1  
jtbi1  
jtbi1  
jtout1  
jtbi1  
jtbi1  
jtout1  
jtbi1  
P[7]  
P[7]  
TS-Output penb[7]  
9
Input  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
TS-Output penb[17]  
penb[6]  
P[6]  
P[17]  
Input  
TS-Output penb[6]  
penb[16]  
P[16]  
P[6]  
Input  
TS-Output penb[16]  
penb[5]  
P[5]  
P[16]  
Input  
TS-Output penb[5]  
penb[15]  
P[15]  
P[5]  
Input  
TS-Output penb[15]  
penb[4]  
P[4]  
P[15]  
Input  
TS-Output penb[4]  
penb[14]  
P[14]  
P[4]  
Input  
TS-Output penb[14]  
penb[3]  
P[3]  
P[14]  
Input  
TS-Output penb[3]  
penb[13]  
P[13]  
P[3]  
Input  
TS-Output penb[13]  
penb[2]  
P[2]  
P[13]  
Input  
TS-Output  
Input  
penb[2]  
penb[12]  
P[12]  
jtbi1  
P[2]  
TS-Output penb[12]  
jtout1  
jtbi1  
penb[1]  
P[1]o  
P[1]i  
P[12]  
Input  
TS-Output  
Input  
penb[1]  
penb[11]  
P[11]  
jtbi1  
TS-Output penb[11]  
jtout1  
jtbi1  
penb[0]  
P[0]  
P[11]  
Input  
TS-Output  
Input  
penb[0]  
penb[10]  
P[10]  
jtbi1  
P[0]  
TS-Output penb[10]  
jtbi1  
XDATA[31] TS-Output  
denb  
A-4  
S3C4510B  
APPENDIX A  
Table A-3. Boundary Scan Definitions (Page 2)  
Bit  
Number  
Cell  
Type  
Pin/Cell  
Name  
Pin  
Type  
Output  
CTL Cell Number  
Bit  
Cell  
Type  
Pin/Cell  
Name  
Pin  
Type  
Output  
CTL Cell  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
XDATA[31]  
Input  
denb  
96  
jtbi1  
jbti1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtbi1  
jtout1  
XDATA[15]  
Input  
denb  
XDATA[30] TS-Output  
XDATA[30] Input  
XDATA[29] TS-Output  
XDATA[29] Input  
XDATA[28] TS-Output  
XDATA[28] Input  
XDATA[27] TS-Output  
XDATA[27] Input  
XDATA[26] TS-Output  
XDATA[26] Input  
XDATA[25] TS-Output  
XDATA[25] Input  
XDATA[24] TS-Output  
XDATA[24] Input  
XDATA[23] TS-Output  
XDATA[23] Input  
XDATA[22] TS-Output  
XDATA[22] Input  
XDATA[21] TS-Output  
XDATA[21] Input  
XDATA[20] TS-Output  
XDATA[20] Input  
XDATA[19] TS-Output  
XDATA[19] Input  
XDATA[18] TS-Output  
XDATA[18] Input  
XDATA[17] TS-Output  
XDATA[17] Input  
XDATA[16] TS-Output  
XDATA[16] Input  
XDATA[15] TS-Output  
97  
XDATA[14] TS-Output  
XDATA[14] Input  
XDATA[13] TS-Output  
XDATA[13] Input  
XDATA[12] TS-Output  
XDATA[12] Input  
XDATA[11] TS-Output  
XDATA[11] Input  
XDATA[10] TS-Output  
XDATA[10] Input  
XDATA[9] TS-Output  
XDATA[9] Input  
XDATA[8] TS-Output  
XDATA[8] Input  
XDATA[7] TS-Output  
XDATA[7] Input  
XDATA[6] TS-Output  
XDATA[6] Input  
XDATA[5] TS-Output  
XDATA[5] Input  
XDATA[4] TS-Output  
XDATA[4] Input  
XDATA[3] TS-Output  
XDATA[3] Input  
XDATA[2] TS-Output  
XDATA[2] Input  
XDATA[1] TS-Output  
XDATA[1] Input  
XDATA[0] TS-Output  
98  
denb  
99  
denb  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
denb  
XDATA[0]  
denb  
Input  
denb  
A-5  
APPENDIX A  
S3C4510B  
Table A-4. Boundary Scan Definitions (Page 3)  
Bit  
Cell  
Pin/Cell  
Name  
Pin  
Type  
Output  
CTL Cell Number  
Bit  
Cell  
Type  
Pin/Cell  
Name  
Pin  
Type  
Output  
CTL Cell  
Number Type  
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  
jtout1 PADDR[21]  
jtout1 PADDR[20]  
jtout1 PADDR[19]  
jtout1 PADDR[18]  
jtout1 PADDR[17]  
jtout1 PADDR[16]  
jtout1 PADDR[15]  
jtout1 PADDR[14]  
jtout1 PADDR[13]  
jtout1 PADDR[12]  
jtout1 PADDR[11]  
jtout1 PADDR[10]  
jtout1 PADDR[9]  
jtout1 PADDR[8]  
jtout1 PADDR[7]  
jtout1 PADDR[6]  
jtout1 PADDR[5]  
jtout1 PADDR[4]  
jtout1 PADDR[3]  
jtout1 PADDR[2]  
jtout1 PADDR[1]  
jtout1 PADDR[0]  
jtout1 EXTMACK  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
Output  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
160  
161  
162  
163  
164  
165  
166  
167  
168  
169  
170  
171  
172  
173  
174  
175  
176  
177  
178  
179  
180  
181  
182  
183  
184  
185  
186  
187  
188  
189  
190  
191  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
jtin1  
nCAQS[0]  
nRAS[3]  
nRAS[2]  
nRAS[1]  
nRAS[0]  
nRCS[5]  
nRCS[4]  
nRCS[3]  
nRCS[2]  
nRCS[1]  
CLKSEL  
nRESET  
MCLK  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
TS-O  
Input  
Input  
Input  
Output  
Input  
TS-O  
Input  
Input  
TS-O  
Input  
TS-O  
TS-O  
TS-O  
TS-O  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
jtin1  
jtck  
jtout1  
jtin1  
MCLKO  
CLKOEN  
nRCS[0]  
B0SIZE[1]  
B0SIZE[0]  
nOE  
jtout1  
jtin1  
dis_bus  
jtin1  
jtout1  
jtin1  
dis_bus  
nEWAIT  
nECS[3]  
nECS[2]  
nECS[1]  
nECS[0]  
dis_bus  
UCLK  
jtout  
dis_bus  
jtout1  
jtout1  
jtout1  
jtout1  
jtin1  
dis_bus  
dis_bus  
jtin1  
EXTMREQ  
nWBE[3]  
nWBE[2]  
nWBE[1]  
nWBE[0]  
nDWE  
dis_bus  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
jtout1  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
dis_bus  
Input  
Input  
Output  
jtin1  
TMODE  
MDC  
jtout1  
jtin1  
LITTLE  
mdio_oe  
MDIO  
nCAS[3]  
nCAS[2]  
nCAS[1]  
jtout1  
jtbi1  
mdio_oe  
TS-O  
Input  
jtbi1  
MDIO  
A-6  
S3C4510B  
APPENDIX A  
Table A-5. Boundary Scan Definitions (Page 4)  
Bit  
Cell  
Pin/Cell  
Name  
Pin  
Type  
Output  
CTL Cell Number  
Bit  
Cell  
Type  
Pin/Cell  
Name  
Pin  
Type  
Output  
CTL Cell  
Number Type  
192  
193  
jtout1  
jtin1  
TX_EN/  
TXEN_10M  
Output  
213  
214  
jtin1  
nDCDB  
Input  
TX_CLK/  
TXCLK_10  
M
Input  
jtin1  
nCTSB  
Input  
194  
jtout1  
TX_ERR/  
PCOMP_1  
0M  
Output  
215  
jtout1  
TXDB  
Output  
195  
196  
197  
jtout1  
jtout1  
jtout1  
TXD3  
TXD2  
Output  
Output  
Output  
216  
217  
218  
jtout1  
jtin1  
nRTSB  
RXDB  
Output  
Input  
TXD1/  
jtout1  
nDTRB  
Output  
LOOP10  
198  
199  
200  
jtout1  
jtin1  
TXD0/  
TXD_10M  
Output  
Input  
219  
220  
221  
jtout1  
jtbi1  
txcaen  
TXCA  
TXCA  
txcaen  
COL/  
COL_10M  
Output  
Input  
jtin1  
RX_CLK/  
RXCLK_10  
M
Input  
jtbi1  
201  
202  
203  
204  
205  
jtin1  
jtin1  
jtin1  
jtin1  
jtin1  
RX_ERR  
RXD3  
Input  
Input  
Input  
Input  
Input  
222  
223  
224  
225  
226  
jtout1  
jtin1  
nSYNCA  
RXCA  
Output  
Input  
RXD2  
jtin1  
nDCDA  
nCTSA  
TXDA  
Input  
RXD1  
jtin1  
Input  
RXD0/  
jtout1  
Output  
RXD_10M  
206  
207  
jtin1  
jtin1  
RX_DV/  
LINK10  
Input  
Input  
227  
228  
jtout1  
jtin1  
nRTSA  
RXDA  
Output  
Input  
CRS/  
CRS_10M  
208  
209  
210  
211  
212  
jtout1  
jtbi1  
txcben  
TXCB  
229  
230  
231  
232  
jtout1  
jtout1  
jtout1  
jtin1  
nDTRA  
nUADSR1  
UATXD1  
UADTR1  
Output  
Output  
Output  
Input  
TS-Out  
Input  
txcben  
jtbi1  
TXCB  
jtout1  
jtin1  
nSYNCB  
RXCB  
Output  
Input  
NOTE : TS-O is tri-state output.  
A-7  
APPENDIX A  
S3C4510B  
JTBI1  
JTIN1  
SHIFT  
DINP0N  
MODE 0  
SETN  
TDO0  
0
MUX  
D
0
1
TDI0  
DOUT0  
1
Q
D
MUX  
Q
JTOUT1  
MODE 1  
DINP1  
TDO1  
0
1
MUX  
D
0
TDI0  
DOUT1  
Q
D
MUX  
1
Q
TCK  
UPDATE  
JTCK  
SHIFT  
0
MUX  
1
D
TDI  
TDO  
Q
TCK  
Figure A-2. S3C4510B Scan Cells  
A-8  
S3C4510B  
APPENDIX A  
INSTRUCTION REGISTER  
The instruction register is four bits in length. There is no parity bit. The fixed value ’0001’ is loaded into the  
instruction register during the CAPTURE-IR controller state.  
The TAP machines supports the following public instructions. However, the S3C4510B boundary scan logic only  
supports EXTEST, IDCODE, BYPASS, and SAMPLE/PRELOAD instructions. The remaining instructions are  
used for ARM7TDMI core testing and debugging.  
Table A-6. Public Instructions  
Instruction  
Binary Code  
0000  
EXTEST  
SCAN_N  
INTEST  
IDCODE  
BYPASS  
CLAMP  
HIGHZ  
0010  
1100  
1110  
1111  
0101  
0111  
CLAMPZ  
1001  
SAMPLE/PRELOAD  
RESTART  
0011  
0100  
A-9  
APPENDIX A  
S3C4510B  
--  
Samsung Electronics Co.  
-- S3C4510B BSDL  
--  
-- Version 1.1 01-27-99  
-- Revision List:  
--  
--  
1) Pin name NC changed to LITTLE  
2) 1194 -> 1149  
-- Package Type: QFP2828B  
--  
entity S3C4510B is  
generic (PHYSICAL_PIN_MAP : string := "QFP2828B");  
port (  
nUADTR1  
UATXD1  
nUADSR1  
: in  
: outbit;  
: outbit;  
bit;  
nDTRA  
RXDA  
: outbit;  
: inbit;  
nRTSA  
TXDA  
nCTSA  
nDCDA  
RXCA  
: outbit;  
: outbit;  
: inbit;  
: inbit;  
: inbit;  
nSYNCA  
TXCA  
nDTRB  
RXDB  
: outbit;  
: inoutbit;  
: outbit;  
: inbit;  
nRTSB  
TXDB  
nCTSB  
nDCDB  
RXCB  
: outbit;  
: outbit;  
: inbit;  
: inbit;  
: inbit;  
nSYNCB  
TXCB  
: outbit;  
: inoutbit;  
A-10  
S3C4510B  
APPENDIX A  
CRS_CRS_10M  
: inbit;  
RX_DV_LINK10  
RXD  
RX_ERR  
: inbit;  
: inbit_vector(0 to 3);  
: inbit;  
RX_CLK_RXCLK_10M  
: inbit;  
COL_COL_10M  
TXD  
TX_ERR_PCOMP_10M  
TX_CLK_TXCLK_10M  
TX_EN_TXEN_10M  
: inbit;  
: outbit_vector(0 to 3);  
: outbit;  
: inbit;  
: outbit;  
MDIO  
LITTLE  
MDC  
: inoutbit;  
: inbit;  
: outbit;  
TCK  
TMS  
TDI  
TDO  
nTRST  
TMODE  
UCLK  
: inbit;  
: inbit;  
: inbit;  
: outbit;  
: inbit;  
: inbit;  
: inbit;  
nECS  
: outbit_vector(0 to 3);  
nEWAIT  
nOE  
: inbit;  
: outbit;  
B0SIZE  
: inbit_vector(0 to 1);  
CLKOEN  
MCLKO  
MCLK  
nRESET  
CLKSEL  
: inbit;  
: outbit;  
: inbit;  
: inbit;  
: inbit;  
nRCS  
nRAS  
nCAS  
nDWE  
nWBE  
: outbit_vector(0 to 5);  
: outbit_vector(0 to 3);  
: outbit_vector(0 to 3);  
: outbit;  
: outbit_vector(0 to 3);  
ExtMREQ  
ExtMACK  
ADDR  
: inbit;  
: outbit;  
: outbit_vector(0 to 21);  
XDATA  
: inoutbit_vector(0 to 31);  
A-11  
APPENDIX A  
S3C4510B  
P
SCL  
: inoutbit_vector(0 to 17);  
: inoutbit;  
SDA  
: inoutbit;  
UARXD0  
nUADTR0  
UATXD0  
nUADSR0  
UARXD1  
VDDP  
VDDI  
: inbit;  
: inbit;  
: outbit;  
: outbit;  
: inbit;  
: linkagebit_vector(0 to 10);  
: linkagebit_vector(0 to 10);  
: linkagebit_vector(0 to 11);  
: linkagebit_vector(0 to 10)  
VSSP  
VSSI  
);  
A-12  
S3C4510B  
APPENDIX A  
use STD_1149_1_1149.all;  
attribute PIN_MAP of S3C4510B : entity is PHYSICAL_PIN_MAP;  
-- QFP2828B Pin Map  
--  
-- No-connects: 49  
--  
constant QFP2828B : PIN_MAP_STRING :=  
"nUADTR1 : 3, " &  
"UATXD1 : 4, " &  
"nUADSR1 : 5, " &  
"nDTRA : 6, " &  
"RXDA : 7, " &  
"nRTSA : 8, " &  
"TXDA : 9, " &  
"nCTSA : 10, " &  
"nDCDA : 13, " &  
"RXCA : 14, " &  
"nSYNCA : 15, " &  
"TXCA : 16, " &  
"nDTRB : 17, " &  
"RXDB : 18, " &  
"nRTSB : 19, " &  
"TXDB : 20, " &  
"nCTSB : 23, " &  
"nDCDB : 24, " &  
"RXCB : 25, " &  
"nSYNCB : 26, " &  
"TXCB : 27, " &  
"CRS_CRS_10M : 28, " &  
"RX_DV_LINK10 : 29, " &  
"RXD : (30, 33, 34, 35), " &  
"RX_ERR : 36, " &  
"RX_CLK_RXCLK_10M : 37, " &  
A-13  
APPENDIX A  
S3C4510B  
"COL_COL_10M : 38, " &  
"TXD : (39, 40, 43, 44), " &  
"TX_ERR_PCOMP_10M : 45, " &  
"TX_CLK_TXCLK_10M : 46, " &  
"TX_EN_TXEN_10M : 47, " &  
"MDIO : 48, " &  
"LITTLE : 49, " &  
"MDC : 50, " &  
"TCK : 58, " &  
"TMS : 59, " &  
"TDI : 60, " &  
"TDO : 61, " &  
"nTRST : 62, " &  
"TMODE : 63, " &  
"UCLK : 64, " &  
"nECS : (67, 68, 69, 70), " &  
"nEWAIT : 71, " &  
"nOE : 72, " &  
"B0SIZE : (73, 74), " &  
"CLKOEN : 76, " &  
"MCLKO : 77, " &  
"MCLK : 80, " &  
"nRESET : 82, " &  
"PCLKSEL : 83, " &  
"nRCS : (75, 84, 85, 86, 87, 88), " &  
"nRAS : (89, 90, 91, 94), " &  
"nCAS : (95, 96, 97, 98), " &  
"nDWE : 99, " &  
"nWBE : (100, 101, 102, 107), " &  
"ExtMREQ : 108, " &  
"ExtMACK : 109, " &  
-- A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15 A16 A17 A18 A19 A20 A21  
"ADDR : (110, 111, 112, 113, 114, 115, 116, 117, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 132, 133,  
134, 135), " &  
-- D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 D10 D11 D12 D13 D14 D15 D16 D17 D18 D19 D20  
D21 D22 D23 D24 D25 D26 D27 D28 D29 D30 D31  
"XDATA : (136, 137, 138, 139, 140, 141, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 159, 160,  
161,162, 163, 164, 165, 166, 169, 170, 171, 172, 173, 174, 175), " &  
A-14  
S3C4510B  
APPENDIX A  
-- P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P10 P11 P12 P13 P14 P15 P16 P17  
"P : (176, 179, 180, 181, 182, 183, 184, 185, 186, 189, 190, 191, 192, 193, 194, 195, 196, 199), " &  
"SCL : 200, " &  
"SDA : 201, " &  
"UARXD0 : 202, " &  
"nUADTR0 : 203, " &  
"UATXD0 : 204, " &  
"nUADSR0 : 205, " &  
"UARXD1 : 206, " &  
"VDDP : 1, 21, 41, 53, 78, 103, 118, 142, 157, 177, 197, " &  
"VDDI : 11, 31, 51, 65, 92, 105, 130, 155, 167, 187, 207, " &  
"VSSP : 2, 22, 42, 54, 79, 93, 106, 131, 156, 168, 188, 208, " &  
"VSSI : 12, 32, 52, 66, 81, 104, 119, 143, 158, 178, 198 ";  
A-15  
APPENDIX A  
S3C4510B  
attribute TAP_SCAN_IN of TDI : signal is true;  
attribute TAP_SCAN_OUT of TDO : signal is true;  
attribute TAP_SCAN_MODE of TMS : signal is true;  
attribute TAP_SCAN_RESET of nTRST : signal is true;  
attribute TAP_SCAN_CLOCK of TCK : signal is true;  
attribute INSTRUCTION_LENGTH of S3C4510B : entity is 4;  
attribute INSTRUCTION_OPCODE of S3C4510B : entity is  
"EXTEST (0000)," &  
"SCAN_N (0010)," &  
"INTEST (1100)," &  
"IDCODE (1110)," &  
"BYPASS (1111)," &  
"CLAMP (0101)," &  
"HIGHZ (0111)," &  
"CLAMPZ (1001)," &  
"SAMPLE (0011)," &  
"RESTART (0100)";  
-- S3C4510B's IDCODE is the ARM7TDMI's IDCODE.  
attribute REGISTER_ACCESS of S3C4510B : entity is  
"0001" &  
-- version  
"111100" & -- design center  
"0011110000" &  
"11110000111" &  
"1";  
-- sequence number  
-- Samsung  
-- required by 1149.1  
attribute REGISTER_ACCESS of S3C4510B : entity is  
"IDCODE (IDCODE)," &  
"BOUNDARY (INTEST, SAMPLE, EXTEST)," &  
"BYPASS (CLAMP, HIGHZ, BYPASS)";  
attribute BOUNDARY_CELLS of S3C4510B : entity is "BC_4, BC_2, BC_1";  
attribute BOUNDARY_LENGTH of S3C4510B : entity is 233;  
attribute BOUNDARY_REGISTER of S3C4510B : entity is  
-- num cell port  
function safe [ccell disval rslt]  
"0 ( BC_2, UARXD1,  
"1 ( BC_1, nUADSR0,  
"2 ( BC_1, UATXD0,  
"3 ( BC_2, nUADTR0,  
input, X) ," &  
output2, X) ," &  
output2, X) ," &  
input, X) ," &  
A-16  
S3C4510B  
APPENDIX A  
"4 ( BC_2, UARXD0,  
"5 ( BC_1, SDA,  
input, X) ," &  
output3, 1, 5, 1, Z) ," & -- Open-drain Output  
"6 ( BC_2, SDA,  
"7 ( BC_1, SCL,  
"8 ( BC_2, SCL,  
input, X) ," &  
output3, 1, 7, 1, Z) ," & -- Open-drain Output  
input, X) ," &  
"9 ( BC_1, *,  
"10 ( BC_1, P(17),  
"11 ( BC_2, P(17),  
controlr, 1) ," & --P_ENB(17)  
output3, X, 9, 1, Z) ," &  
input, X) ," &  
"12 ( BC_1, *,  
"13 ( BC_1, P(16),  
"14 ( BC_2, P(16),  
controlr, 1) ," & --P_ENB(16)  
output3, X, 12, 1, Z) ," &  
input, X) ," &  
"15 ( BC_1, *,  
"16 ( BC_1, P(15),  
"17 ( BC_2, P(15),  
controlr, 1) ," & --P_ENB(15)  
output3, X, 15, 1, Z) ," &  
input, X) ," &  
"18 ( BC_1, *,  
"19 ( BC_1, P(14),  
"20 ( BC_2, P(14),  
controlr, 1) ," & --P_ENB(14)  
output3, X, 18, 1, Z) ," &  
input, X) ," &  
"21 ( BC_1, *,  
"22 ( BC_1, P(13),  
"23 ( BC_2, P(13),  
controlr, 1) ," & --P_ENB(13)  
output3, X, 21, 1, Z) ," &  
input, X) ," &  
"24 ( BC_1, *,  
"25 ( BC_1, P(12),  
"26 ( BC_2, P(12),  
controlr, 1) ," & --P_ENB(12)  
output3, X, 24, 1, Z) ," &  
input, X) ," &  
"27 ( BC_1, *,  
"28 ( BC_1, P(11),  
"29 ( BC_2, P(11),  
controlr, 1) ," & --P_ENB(11)  
output3, X, 27, 1, Z) ," &  
input, X) ," &  
"30 ( BC_1, *,  
controlr, 1) ," & --P_ENB(10)  
output3, X, 30, 1, Z) ," &  
input, X) ," &  
controlr, 1) ," & --P_ENB(9)  
output3, X, 33, 1, Z) ," &  
input, X) ," &  
"31 ( BC_1, P(10),  
"32 ( BC_2, P(10),  
"33 ( BC_1, *,  
"34 ( BC_1, P(9),  
"35 ( BC_2, P(9),  
"36 ( BC_1, *,  
"37 ( BC_1, P(8),  
"38 ( BC_2, P(8),  
controlr, 1) ," & --P_ENB(8)  
output3, X, 36, 1, Z) ," &  
input, X) ," &  
"39 ( BC_1, *,  
"40 ( BC_1, P(7),  
"41 ( BC_2, P(7),  
controlr, 1) ," & --P_ENB(7)  
output3, X, 39, 1, Z) ," &  
input, X) ," &  
A-17  
APPENDIX A  
S3C4510B  
"42 ( BC_1, *,  
"43 ( BC_1, P(6),  
"44 ( BC_2, P(6),  
controlr, 1) ," & --P_ENB(6)  
output3, X, 42, 1, Z) ," &  
input, X) ," &  
"45 ( BC_1, *,  
"46 ( BC_1, P(5),  
"47 ( BC_2, P(5),  
controlr, 1) ," & --P_ENB(5)  
output3, X, 45, 1, Z) ," &  
input, X) ," &  
"48 ( BC_1, *,  
"49 ( BC_1, P(4),  
"50 ( BC_2, P(4),  
controlr, 1) ," & --P_ENB(4)  
output3, X, 48, 1, Z) ," &  
input, X) ," &  
"51 ( BC_1, *,  
"52 ( BC_1, P(3),  
"53 ( BC_2, P(3),  
controlr, 1) ," & --P_ENB(3)  
output3, X, 51, 1, Z) ," &  
input, X) ," &  
"54 ( BC_1, *,  
"55 ( BC_1, P(2),  
"56 ( BC_2, P(2),  
controlr, 1) ," & --P_ENB(2)  
output3, X, 54, 1, Z) ," &  
input, X) ," &  
"57 ( BC_1, *,  
"58 ( BC_1, P(1),  
"59 ( BC_2, P(1),  
controlr, 1) ," & --P_ENB(1)  
output3, X, 57, 1, Z) ," &  
input, X) ," &  
"60 ( BC_1, *,  
"61 ( BC_1, P(0),  
"62 ( BC_2, P(0),  
controlr, 1) ," & --P_ENB(0)  
output3, X, 60, 1, Z) ," &  
input, X) ," &  
"63 ( BC_1, XDATA(31),  
"64 ( BC_2, XDATA(31),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"65 ( BC_1, XDATA(30),  
"66 ( BC_2, XDATA(30),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"67 ( BC_1, XDATA(29),  
"68 ( BC_2, XDATA(29),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"69 ( BC_1, XDATA(28),  
"70 ( BC_2, XDATA(28),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"71 ( BC_1, XDATA(27),  
"72 ( BC_2, XDATA(27),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"73 ( BC_1, XDATA(26),  
"74 ( BC_2, XDATA(26),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"75 ( BC_1, XDATA(25),  
"76 ( BC_2, XDATA(25),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
A-18  
S3C4510B  
APPENDIX A  
"77 ( BC_1, XDATA(24),  
"78 ( BC_2, XDATA(24),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"79 ( BC_1, XDATA(23),  
"80 ( BC_2, XDATA(23),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"81 ( BC_1, XDATA(22),  
"82 ( BC_2, XDATA(22),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"83 ( BC_1, XDATA(21),  
"84 ( BC_2, XDATA(21),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"85 ( BC_1, XDATA(20),  
"86 ( BC_2, XDATA(20),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"87 ( BC_1, XDATA(19),  
"88 ( BC_2, XDATA(19),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"89 ( BC_1, XDATA(18),  
"90 ( BC_2, XDATA(18),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"91 ( BC_1, XDATA(17),  
"92 ( BC_2, XDATA(17),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"93 ( BC_1, XDATA(16),  
"94 ( BC_2, XDATA(16),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"95 ( BC_1, XDATA(15),  
"96 ( BC_2, XDATA(15),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"97 ( BC_1, XDATA(14),  
"98 ( BC_2, XDATA(14),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"99 ( BC_1, XDATA(13),  
"100 ( BC_2, XDATA(13),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"101 ( BC_1, XDATA(12),  
"102 ( BC_2, XDATA(12),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"103 ( BC_1, XDATA(11),  
"104 ( BC_2, XDATA(11),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"105 ( BC_1, XDATA(10),  
"106 ( BC_2, XDATA(10),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"107 ( BC_1, XDATA(9),  
"108 ( BC_2, XDATA(9),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"109 ( BC_1, XDATA(8),  
output3, X, 127, 1, Z) ," &  
A-19  
APPENDIX A  
S3C4510B  
"110 ( BC_2, XDATA(8),  
input, X) ," &  
"111 ( BC_1, XDATA(7),  
"112 ( BC_2, XDATA(7),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"113 ( BC_1, XDATA(6),  
"114 ( BC_2, XDATA(6),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"115 ( BC_1, XDATA(5),  
"116 ( BC_2, XDATA(5),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"117 ( BC_1, XDATA(4),  
"118 ( BC_2, XDATA(4),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"119 ( BC_1, XDATA(3),  
"120 ( BC_2, XDATA(3),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"121 ( BC_1, XDATA(2),  
"122 ( BC_2, XDATA(2),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"123 ( BC_1, XDATA(1),  
"124 ( BC_2, XDATA(1),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"125 ( BC_1, XDATA(0),  
"126 ( BC_2, XDATA(0),  
output3, X, 127, 1, Z) ," &  
input, X) ," &  
"127 ( BC_1, *,  
controlr, 1) ," & --DATAOUT_ENB  
"128 ( BC_1, ADDR(21),  
"129 ( BC_1, ADDR(20),  
"130 ( BC_1, ADDR(19),  
"131 ( BC_1, ADDR(18),  
"132 ( BC_1, ADDR(17),  
"133 ( BC_1, ADDR(16),  
"134 ( BC_1, ADDR(15),  
"135 ( BC_1, ADDR(14),  
"136 ( BC_1, ADDR(13),  
"137 ( BC_1, ADDR(12),  
"138 ( BC_1, ADDR(11),  
"139 ( BC_1, ADDR(10),  
"140 ( BC_1, ADDR(9),  
"141 ( BC_1, ADDR(8),  
"142 ( BC_1, ADDR(7),  
"143 ( BC_1, ADDR(6),  
"144 ( BC_1, ADDR(5),  
"145 ( BC_1, ADDR(4),  
"146 ( BC_1, ADDR(3),  
"147 ( BC_1, ADDR(2),  
"148 ( BC_1, ADDR(1),  
"149 ( BC_1, ADDR(0),  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
A-20  
S3C4510B  
APPENDIX A  
"150 ( BC_1, ExtMACK,  
"151 ( BC_2, ExtMREQ,  
output2, X) ," &  
input, X) ," &  
"152 ( BC_1, nWBE(3),  
"153 ( BC_1, nWBE(2),  
"154 ( BC_1, nWBE(1),  
"155 ( BC_1, nWBE(0),  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
"156 ( BC_1, nDWE,  
output3, X, 184, 1, Z) ," &  
"157 ( BC_1, nCAS(3),  
"158 ( BC_1, nCAS(2),  
"159 ( BC_1, nCAS(1),  
"160 ( BC_1, nCAS(0),  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
"161 ( BC_1, nRAS(3),  
"162 ( BC_1, nRAS(2),  
"163 ( BC_1, nRAS(1),  
"164 ( BC_1, nRAS(0),  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
"165 ( BC_1, nRCS(5),  
"166 ( BC_1, nRCS(4),  
"167 ( BC_1, nRCS(3),  
"168 ( BC_1, nRCS(2),  
"169 ( BC_1, nRCS(1),  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
"170 ( BC_2, CLKSEL,  
"171 ( BC_2, nRESET,  
"172 ( BC_4, MCLK,  
"173 ( BC_1, MCLKO,  
"174 ( BC_2, CLKOEN,  
input, X) ," &  
input, X) ," &  
input, X) ," &  
output2, X) ," &  
input, X) ," &  
"175 ( BC_1, nRCS(0),  
output3, X, 184, 1, Z) ," &  
"176 ( BC_2, B0SIZE(1),  
"177 ( BC_2, B0SIZE(0),  
input, X) ," &  
input, X) ," &  
"178 ( BC_1, nOE,  
output3, X, 184, 1, Z) ," &  
input, X) ," &  
"179 ( BC_2, nEWAIT,  
"180 ( BC_1, nECS(3),  
"181 ( BC_1, nECS(2),  
"182 ( BC_1, nECS(1),  
"183 ( BC_1, nECS(0),  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
output3, X, 184, 1, Z) ," &  
A-21  
APPENDIX A  
S3C4510B  
"184 ( BC_1, *,  
controlr, 1) ," & --DIS_BUS  
"185 ( BC_2, UCLK,  
"186 ( BC_2, TMODE,  
input, X) ," &  
input, X) ," &  
"187 ( BC_1, MDC,  
"188 ( BC_2, LITTLE,  
output2, X) ," &  
input, X) ," &  
"189 ( BC_1, *,  
"190 ( BC_1, MDIO,  
"191 ( BC_2, MDIO,  
controlr, 1) ," & --MDIO_OE  
output3, X, 189, 1, Z) ," &  
input, X) ," &  
"192 ( BC_1, TX_EN_TXEN_10M, output2, X) ," &  
"193 ( BC_2, TX_CLK_TXCLK_10M, input, X) ," &  
"194 ( BC_1, TX_ERR_PCOMP_10M, output2, X) ," &  
"195 ( BC_1, TXD3,  
"196 ( BC_1, TXD2,  
output2, X) ," &  
output2, X) ," &  
"197 ( BC_1, TXD1_LOOP10,  
"198 ( BC_1, TXD0_TXD_10M, output2, X) ," &  
"199 ( BC_2, COL_COL_10M, input, X) ," &  
"200 ( BC_2, RX_CLK_RXCLK_10M, input, X) ," &  
output2, X) ," &  
"201 ( BC_2, RX_ERR,  
"202 ( BC_2, RXD3,  
"203 ( BC_2, RXD2,  
"204 ( BC_2, RXD1,  
input, X) ," &  
input, X) ," &  
input, X) ," &  
input, X) ," &  
"205 ( BC_2, RXD0_RXD_10M, input, X) ," &  
"206 ( BC_2, RX_DV_LINK10, input, X) ," &  
"207 ( BC_2, CRS_CRS_10M,  
input, X) ," &  
"208 ( BC_1, *,  
"209 ( BC_1, TXCB,  
"210 ( BC_2, TXCB,  
controlr, 1) ," & --TXCBEN  
output3, X, 208, 1, Z) ," &  
input, X) ," &  
"211 ( BC_1, nSYNCB,  
"212 ( BC_2, RXCB,  
"213 ( BC_2, nDCDB,  
"214 ( BC_2, nCTSB,  
"215 ( BC_1, TXDB,  
"216 ( BC_1, nRTSB,  
"217 ( BC_2, RXDB,  
"218 ( BC_1, nDTRB,  
output2, X) ," &  
input, X) ," &  
input, X) ," &  
input, X) ," &  
output2, X) ," &  
output2, X) ," &  
input, X) ," &  
output2, X) ," &  
"219 ( BC_1, *,  
"220 ( BC_1, TXCA,  
"221 ( BC_2, TXCA,  
controlr, 1), " & --TXCAEN  
output3, X, 219, 1, Z) ," &  
input, X) ," &  
A-22  
S3C4510B  
APPENDIX A  
"222 ( BC_1, nSYNCA,  
"223 ( BC_2, RXCA,  
"224 ( BC_2, nDCDA,  
"225 ( BC_2, nCTSA,  
"226 ( BC_1, TXDA,  
"227 ( BC_1, nRTSA,  
"228 ( BC_2, RXDA,  
"229 ( BC_1, nDTRA,  
"230 ( BC_1, nUADSR1,  
"231 ( BC_1, UATXD1,  
"232 ( BC_2, nUADTR1,  
end S3C4510B;  
output2, X) ," &  
input, X) ," &  
input, X) ," &  
input, X) ," &  
output2, X) ," &  
output2, X) ," &  
input, X) ," &  
output2, X) ," &  
output2, X) ," &  
output2, X) ," &  
input, X) ";  
A-23  
APPENDIX A  
S3C4510B  
NOTES  
A-24  

相关型号:

SI9130DB

5- and 3.3-V Step-Down Synchronous Converters

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9135LG-T1

SMBus Multi-Output Power-Supply Controller

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9135LG-T1-E3

SMBus Multi-Output Power-Supply Controller

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9135_11

SMBus Multi-Output Power-Supply Controller

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9136_11

Multi-Output Power-Supply Controller

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9130CG-T1-E3

Pin-Programmable Dual Controller - Portable PCs

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9130LG-T1-E3

Pin-Programmable Dual Controller - Portable PCs

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9130_11

Pin-Programmable Dual Controller - Portable PCs

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9137

Multi-Output, Sequence Selectable Power-Supply Controller for Mobile Applications

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9137DB

Multi-Output, Sequence Selectable Power-Supply Controller for Mobile Applications

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9137LG

Multi-Output, Sequence Selectable Power-Supply Controller for Mobile Applications

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY

SI9122E

500-kHz Half-Bridge DC/DC Controller with Integrated Secondary Synchronous Rectification Drivers

Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
VISHAY