ORIGINATOR:Samsung Electronics, SOC Development Group, Ki-Heung, South Korea
PRODUCT NAME: S3C3410X RISC Microcontroller
DOCUMENT NAME:S3C3410X User's Manual, Revision 2
DOCUMENT NUMBER:22-S3-C3410X-06-2001
EFFECTIVE DATE: June, 2001
SUMMARY:As a result of additional product testing and evaluation, to correct the errata and
to add more detailed explanations, some specifications published in the
S3C3410X User's Manual, Revision 1, have been changed. These changes for
S3C3410X microcontroller, which are described in detail in the RevisionDescriptions section below, are related to the followings:
— Chapter 7. Port 7 and Port 9 Control Registers
— Chapter 11. Interrupt Priority Register (INTPRIx)
— Chapter 14. Multi-Master IIC-Bus Status Register (IICSTAT)
DIRECTIONS:Please note the changes in your copy (copies) of the S3C3410X User's Manual,
Revision 1. Or, simply attach the Revision Descriptions of the next page to
S3C3410X User's Manual, Revision 1.
REVISION HISTORY
RevisionDateRemark
0–There is no preliminary spec.
1August, 2000Reviewed by Gwang-Su Han.
2June, 2001Reviewed by Gwang-Su Han.
REVISION DESCRIPTIONS
1. PIN DESCRIPTIONS:
1) Pin descriptions about A[23:0], D[15:0], nCS[7:0] nECS[1:0], nWAIT and nWREXP, are changed and the
content of RP[7:0] are added.
1) More detailed explanations about the internal SRAM address (when the cache is disabled) is added.
S3C3410X User's Manual reference: page 5-4
4. PORT 7 AND PORT 9 CONTROL REGISTERS:
1) The contents of P7BR(0xB00B) is added in PORT 7 and the pin descriptions of P7.x are changed to P7.x
(RPx).
S3C3410X User's Manual reference: page 7-20
2) More detailed explanations about P9.0(LP) and P9.1(DCLK) are added.
S3C3410X User's Manual reference: page 7-25
(Continued to the next page)
5. INTERRUPT PRIORITY REGISTER:
1) The contents about the INTPRIx are changed .
S3C3410X User's Manual reference: page 11-10
6. MULTI-MASTER IIC-BUS STATUS REGISTER:
1) The contents of INTFLAG is added to IICSTAT register.
S3C3410X User's Manual reference: page 14-7
2) The prescaler value (4 × (prescaler value + 1)) is changed to (16 × (prescaler value + 1)) in IICPS.
S3C3410X User’s Manual reference: page 14-9
S3C3410X RISC MICROPROCESSOR PRODUCT OVERVIEW
1 PRODUCT OVERVIEW
INTRODUCTION
Samsung's S3C3410X 16/32-bit RISC microcontroller is a cost-effective and high-performance microcontroller
solution for PDA and general purpose application.
An outstanding feature of the S3C3410X is its CPU core, a 16/32-bit RISC processor(ARM7TDMI) designed by
Advanced RISC Machines, Ltd. The ARM7TDMI core is a low-power, general purpose, microprocessor macrocell, which was developed for the use in application-specific and customer-specific integrated circuits. Its simple,
elegant, and fully static design is particularly suitable for cost-sensitive and power-sensitive application.
The S3C3410X has been developed by using the ARM7TDMI core, CMOS standard cell, and a data path
compiler. Most of the on-chip function blocks have been designed using an HDL synthesizer. The S3C3410X has
been fully verified in SAMSUNG ASIC test environment including the internal Qualification Assurance Process.
By providing a complete set of common system peripherals, the S3C3410X can minimize the overall system cost
and eliminates the need to configure additional components, externally.
The integrated on-chip functions which are described in this document include:
• Integrated external memory controller (ROM/SRAM and FP/EDO DRAM/SDRAM controller)
• 2-channel general DMA controller
• Internal 4K-byte memory can be configured as (4KB Cache only), (2KB Cache and 2KB SRAM), or (4KB
SRAM only).
• 1-channel UART with IrDA 1.0, 1-channel IIC, and 2-channel SIO(Synchronous serial IO)
• 3-channel 16-bit timers and 2-channel 8-bit timers
• Real time clock with calendar function.
• Crystal/Ceramic oscillator or external clock can be used as the clock source.
• Power control: Normal, Idle, and Stop mode
• 1-channel 8-bit basic timer and 3-bit watch-dog timer
• Interrupt controller: 35 interrupt sources, interrupt priority control logic and interrupt vector generation by H/W.
• 8-channel 10-bit ADC
• 10 programmable I/O port group (Total 74 I/O ports including the multiplexed I/O)
1-1
PRODUCT OVERVIEWS3C3410X RISC MICROPROCESSOR
FEATURES
Architecture
•Integrated system for hand-held and general
embedded application.
•Fully 16/32-bit RISC architecture(32-bit ARM
instruction as well as 16-bit Thumb instruction).
•ARM7TDMI CPU core, supporting the efficient
and powerful instruction set.
•On-chip ICEBreakerTM debug support by JTAG-
based solution.
•Address space: 16Mbytes per each bank
(Total 128Mbyte)
•Support 8-bit/16-bit data bus width for external
memory/device access.
•The bank can support ROM/SRAM/Flash,
External I/O device or FP/EDO/SDRAM.
•Among total 8 memory banks, bank0,1,2,3,4
and 5 can be mapped to ROM/SRAM/Flash,
while bank6 and 7 can be mapped to
FP/EDO/SDRAM as well as ROM/SRAM/Flash.
•Fully programmable access cycle for all memory
banks
DMA Controller
•Two-channel general purposed DMA(Direct
Memory Access) controller.
•The data transfer of Memory-to-memory, serial
port-to-memory, memory-to-serial port, memoryto-SFR(Special Function Register), SFR-tomemory, internal SRAM-to-memory, and
memory-to-internal SRAM without CPU
intervention
•Initiated by the software or external DMA
request
•Increment or decrement source or destination
addresses.
•Supports 8-bit(byte), 16-bit(half-word), and 32bit(word) of data transfer size.
I/O Ports
•10 Programmable Input, Output, and I/O port
group (74 I/O ports including the multiplexed
I/O)
•One programmable Output port (2-bit
multiplexed output ports)
vdd, vss3.3V Vdd/Vss
vddt, vsst3.3V Vdd/Vss for analog circuitry
pbceuct4bi-direction pad, CMOS level, pull-up resister with control, tri-state, Io = 4mA
pbseuct4bi-direction pad, CMOS schmitt-trigger, pull-up resister with control, tri-state, Io = 4mA
pbceuct8bi-direction pad, CMOS level, pull-up resister with control, tri-state, Io = 8mA
pbseuct8bi-direction pad, CMOS schmitt-trigger, pull-up resister with control, tri-state, Io = 8mA
pbcedct8bi-direction pad, CMOS level, pull-down resister with control, tri-state, Io = 8mA
pbsedct8bi-direction pad, CMOS schmitt-trigger, pull-down resister with control, tri-state, Io = 8mA
pob8output pad, Io = 8mA
pisinput pad, CMOS schmitt-trigger
pisuinput pad, CMOS schmitt-trigger, pull-up resister
piceucinput pad, CMOS level, pull-up resister with control
piseucinput pad, CMOS schmitt-trigger, pull-up resister with control
apadpad for analog pin
oscmpad for x-tal oscillation
1-10
S3C3410X RISC MICROPROCESSOR PRODUCT OVERVIEW
PIN DESCRIPTIONS
Table 1-3. S3C3410X Pin Descriptions
PinI/ODescription
BUS CONTROLLER
TEST[1:0]IThe TEST[1:0] can configure the data bus size for bank 0 in normal or MDS mode.
The normal mode is for CPU to start its operation by fetching the instruction from
external memory. The MDS mode is for CPU to be debugged by the external
Emulator, EmbeddedICE, etc.
00 = Normal mode with 8-bit data bus size for bank 0 access.
01 = Normal mode with 16-bit data bus size for bank 0 access.
10 = MDS mode with 8-bit data bus size for bank 0 access.
11 = MDS mode with 16-bit data bus size for bank 0 access.
A[23:0]OA[23:0] (address bus) generate the address when external memory access.
D[15:0]I/OD[15:0] (Data bus) input the data during memory read and output the data during
memory write. The data bus width can be programmable for 8-bit or 16-bit by the
BANKCONx register option.
nCS[7:0]OnCS[7:0] (Chip Select) selectively generate the chip select signal of each bank when
the external memory access address is within the address range of each bank. The
number of access cycle and the bank size can be programmable by the BANKCONx
register option.
nECS[1:0]OnECS[1:0] (External Chip Select) generate the external chip select signal for the
extra device (External I/O device).
nOEOnOE (Output Enable) indicates that the current bus cycle is a read cycle.
nWEOnWE (Write Enable for x16 SRAM or SDRAM) indicates that the current bus cycle is
a write cycle. To support the byte write to external memory, the byte to be accessed
can be determined by nBE[1:0], which is the selection on upper byte or lower byte.
For example, in case of 16-bit SRAM, nBE[1:0] should play it role as UB(Upper
Byte)/LB(Lower Byte) to select the upper byte or lower byte. In case of SDRAM,
nWBE[1:0] should play it role as DQM[1:0] to select the upper byte or lower byte. For
16-bit access, not 8-bit access, both nWBE[1:0] should be activated at same time. In
certain case, no more byte access is needed. For example, x16 Flash Memory does
not need byte access through 16-bit bus when user need the programming in the
flash memory. In this case, please use nWBE[0] instead of nWE to indicate that the
current bus cycle is a write cycle. Summarizing, nWE should be used to indicate the
write bus cycle in case of x16 SRAM and x16/x8 SDRAM. In case of x16 with two x8
SRAM, nWBE[0] and nWBE[1] should be connected to the WE of SRAM,
respectively. For more detail information, please refer the chapter 4.
nWBE[1:0]OnWBE[1:0] (Write Byte Enable). In case of Flash or ROM access, nWBE[0] should
be connected to the WE of memory. For the access to the non-volatile memory, we
do not need the selection on bytes because the 8-bit write cycle via 16-bit bus is no
more necessary. To program the data into the non-volatile memory, we should
always use the 16-bit access. In this configuration, please use nWBE[0] instead of
nWE to indicate that the current bus cycle is a write cycle. Summarizing, nWBE[0]
should be used to indicate the current write bus cycle in case of x8 SRAM, x8/x16
ROM, EDODRAM or Flash memory. For more detail information, please refer the
chapter 4.
1-11
PRODUCT OVERVIEWS3C3410X RISC MICROPROCESSOR
Table 1-3. S3C3410X Signal Descriptions (Continued)
PinI/ODescription
nASOnAS generates an address strobe signal for latch device in multiplexed address
mode which generate A[23:16] and A[15:8] address in A[15:8] pins.
nWAITInWAIT receives request signal to prolong a current bus cycle. As long as nWAIT is
"Low", the current bus cycle cannot be completed.
nWREXPOnWREXP outputs write strobe signal for external device, when you write any data
into EXTPORT register to interface external device.
URXDIUART receives data input
UTXDOUART transmits data output
SIO
SIOCLK[1:0]I/OSIO external clock
SIORXD[1:0]ISIO receives data input
SIOTXD[1:0]OSIO transmits data output
SIORDYI/OSIO handshakes signal when SIO operation is done by DMA
IIC-BUS
IICSDAI/OIIC-bus data
IICSCKI/OIIC-bus Clock
1-12
S3C3410X RISC MICROPROCESSOR PRODUCT OVERVIEW
Table 1-3. S3C3410X Signal Descriptions (Continued)
PinI/ODescription
ADC
AIN[7:0]AADC input
AVREFAADC Vref
General Purpose I/O
Pn.xI/OGeneral purpose input/output ports
RP[7:0]OReal time buffer output ports (refer to P7)
RESET & Clock
RESET
I
RESET is the global reset input for the S3C3410X. For a system reset, RESET must
be held to "Low" level for at least 1us.
XTAL0ACrystal input for internal oscillation circuit for system clock
EXTAL0ACrystal output for internal oscillation circuit for system clock. It's the inverted output
of XTAL0.
XTAL1A32.768KHz crystal input for RTC
EXTAL1A32.768KHz crystal output for RTC. It's the inverted output of XTAL1.
LCD Interface
LPOLCD Line Pulse (Inversion of nECS0)
DCLKOLCD Clock (Inversion of nWREXP)
JTAG Test Logic
nTRSTInTRST (TAP Controller Reset) can reset the TAP controller at power-up. A 100K
pull-up resistor is connected to nTRST pin, internally. If the debugger(BlackICE) is
not used, nTRST pin should be "Low" level or low active pulse should be applied
before CPU running. For example, RESET signal can be tied with nTRST.
TMSITMS (TAP Controller Mode Select) can control the sequence of the state diagram of
TAP controller. A 100K pull-up resistor is connected to TMS pin, internally.
TCKITCK (TAP Controller Clock) can provide the clock input for the JTAG logic. A 100K
pull-up resistor is connected to TCK pin, internally.
TDIITDI (TAP Controller Data Input) is the serial input for JTAG port. A 100K pull-up
resistor is connected to TDI pin, internally.
TDOOTDO (TAP Controller Data Output) is the serial output for JTAG port.
POWER
VDDPPower supply pin
VSSPGround pin
RTCVDDPRTC power supply
ADCVDDPADC power supply
ADCVSSPADC ground & RTC ground
1-13
PRODUCT OVERVIEWS3C3410X RISC MICROPROCESSOR
S3C3410X SPECIAL FUNCTION REGISTER
Table 1-4. S3C3410X Special Function Register
GroupRegisterOffsetR/WDescriptionAccessReset Value
ManagerBANKCON00x2000R/WMemory Bank 0 Control RegisterW0x00200070
BANKCON10x2004R/WMemory Bank 1 Control RegisterW0x0
BANKCON20x2008R/WMemory Bank 2 Control RegisterW0x0
BANKCON30x200cR/WMemory Bank 3 Control RegisterW0x0
BANKCON40x2010R/WMemory Bank 4 Control RegisterW0x0
BANKCON50x2014R/WMemory Bank 5 Control RegisterW0x0
BANKCON60x2018R/WMemory Bank 6 Control RegisterW0x0
BANKCON70x201cR/WMemory Bank 7 Control RegisterW0x0
REFCON0x2020R/WDRAM Refresh Control RegisterW0x1
EXTCON00x2030R/WExtra device control register 0W0x0
EXTCON10x2034R/WExtra device control register 1W0x0
EXTPORT0x203eR/WExternal port data registerB/H0x0
EXTDAT00x202cR/WExtra chip selection data register 0B/H0x0
EXTDAT10x202eR/WExtra chip selection data register 1B/H0x0
PDAT10xb001R/WPort 1 data registerB0x0
PDAT20xb002R/WPort 2 data registerB0x0
PDAT30xb003R/WPort 3 data registerB0x0
PDAT40xb004R/WPort 4 data registerB0x0
PDAT50xb005R/WPort 5 data registerB0x0
PDAT60xb006R/WPort 6 data registerB0x0
PDAT70xb007R/WPort 7 data registerB0x0
PDAT80xb008RPort 8 data registerB0x0
1-14
S3C3410X RISC MICROPROCESSOR PRODUCT OVERVIEW
Table 1-4. S3C3410X Special Function Register (Continued)
GroupRegisterOffsetR/WDescriptionAccessReset Value
I/O PortPDAT90xb009R/WPort 9 data registerB0x0
P7BR0xb00bR/WPort 7 buffer registerB0x0
PCON00xb010R/WPort 0 control registerH0x0
PCON10xb012R/WPort 1 control registerH0x0
PCON20xb014R/WPort 2 control registerH0x0
PCON30xb016R/WPort 3 control registerH0x0
PCON40xb018R/WPort 4 control registerH0x0
PCON50xb01cR/WPort 5 control registerW0x0
PCON60xb020R/WPort 6 control registerW0x0
PCON70xb024R/WPort 7 control registerH0x0
PCON80xb026R/WPort 8 control registerB0x0
PCON90xb027R/WPort 9 control registerB0x0
PUR00xb028R/WPort 0 pull-up control registerB0x80
PDR10xb029R/WPort 1 pull-down control registerB0xff
PUR20xb02aR/WPort 2 pull-up control registerB0xff
PUR30xb02bR/WPort 3 pull-up control registerB0xff
PDR40xb02cR/WPort 4 pull-down control registerB0xff
PUR50xb02dR/WPort 5 pull-up control registerB0x0
PUR60xb02eR/WPort 6 pull-up control registerB0x0
PUR70xb02fR/WPort 7 pull-up control registerB0x0
PUR80xb03cR/WPort 8 pull-up control registerB0x0
EINTPND0xb031R/WExternal interrupt pending registerB0x0
EINTCON0xb032R/WExternal interrupt control registerH0x0
Table 1-4. S3C3410X Special Function Register (Continued)
GroupRegisterOffsetR/WDescriptionAccessReset Value
RTCRTCCON0xa013R/WRTC control registerB0x0
RTCALM0xa012R/WRTC alarm control registerB0x0
ALMSEC0xa033R/WAlarm second data registerB0x59
ALMMIN0xa032R/WAlarm minute data registerB0x59
ALMHOUR0xa031R/WAlarm hour data registerB0x23
ALMDAY0xa037R/WAlarm day data registerB0x31
ALMMON0xa036R/WAlarm month data registerB0x12
ALMYEAR0xa035R/WAlarm year data registerB0x99
BCDSEC0xa023R/WBCD second data registerB–
BCDMIN0xa022R/WBCD minute data registerB–
BCDHOUR0xa021R/WBCD hour data registerB–
BCDDAY0xa027R/WBCD day data registerB–
BCDDATE0xa020R/WBCD date data registerB–
BCDMON0xa026R/WBCD month data registerB–
BCDYEAR0xa025R/WBCD year data registerB–
RINTPND0xa010R/WRTC time interrupt pending registerB0x0
RINTCON0xa011R/WRTC time interrupt control registerB0x0
1-18
S3C3410X RISC MICROPROCESSORPROGRAMMER'S MODEL
2PROGRAMMER'S MODEL
OVERVIEW
S3C3410X was developed using the advanced ARM7TDMI core designed by Advanced RISC Machines, Ltd.
ARM7TDMI supports big-endian and little-endian memory formats, but the S3C3410X supports only the bigendian memory format.
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, halfword-aligned THUMB instructions. In this state, the PC uses bit
1 to select between alternate halfwords.
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:
•On execution of the BX instruction with the state bit clear in the operand register.
•On the processor taking an exception (IRQ, FIQ, RESET, UNDEF, ABORT, SWI etc.). In this case, the PC is
placed in the exception mode's link register, and execution commences at the exception's vector address.
MEMORY FORMATS
ARM7TDMI views memory as a linear collection of bytes numbered upwards from zero. Bytes 0 to 3 hold the first
stored word, bytes 4 to 7 the second and so on. ARM7TDMI can treat words in memory as being stored either in
Big-Endian or Little-Endian format.
2-1
PROGRAMMER'S MODELS3C3410X RISC MICROPROCESSOR
BIG-ENDIAN FORMAT
In Big-Endian format, the most significant byte of a word is stored at the lowest numbered byte and the least
significant byte at the highest numbered byte. Byte 0 of the memory system is therefore connected to data lines
31 through 24.
Higher Address
Lower Address
31
8
4
0
Most significant byte is at lowest address.
Word is addressed by byte address of most significant byte.
23
241516
9
5
1
10
6
2
870
11
7
3
Word Address
8
4
0
Figure 2-1. Big-Endian Addresses of Bytes within Words
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.
Higher Address
3123870
241516
Word Address
8
4
0
Lower Address
11
7
3
Least significant byte is at lowest address.
Word is addressed by byte address of least significant byte.
10
6
2
9
5
1
8
4
0
Figure 2-2. Little-Endian Addresses of Bytes whthin Words
INSTRUCTION LENGTH
Instructions are either 32 bits long (in ARM state) or 16 bits long (in THUMB state).
Data Types
ARM7TDMI supports byte (8-bit), halfword (16-bit) and word (32-bit) data types. Words must be aligned to fourbyte boundaries and half words to two-byte boundaries.
2-2
S3C3410X RISC MICROPROCESSORPROGRAMMER'S MODEL
OPERATING MODES
ARM7TDMI supports seven modes of operation:
•User (usr): The normal ARM program execution state
•FIQ (fiq): Designed to support a data transfer or channel process
•IRQ (irq): 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.
REGISTERS
ARM7TDMI has a total of 37 registers - 31 general-purpose 32-bit registers and six status registers - but these
cannot all be seen at once. The processor state and operating mode dictate which registers are available to the
programmer.
The ARM State Register Set
In ARM state, 16 general registers and one or two status registers are visible at any one time. In privileged (nonUser) 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 14is 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 15holds the Program Counter (PC). In ARM state, bits [1:0] of R15 are zero and bits
[31:2] contain the PC. In THUMB state, bit [0] is zero and bits [31:1] contain the PC.
Register 16is 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.
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
User/System
R0
R1
R2
R3
R4
R5
R6
R7
SP
LR
PC
CPSRCPSR
= banked register
FIQ
R0
R1
R2
R3
R4
R5
R6
R7
SP_fiq
LR_fiq
PC
SupervisorIRQAbortUndefined
R0
R1
R2
R3
R4
R5
R6
R7
SP_svc
LR_svc
PC
R0
R1
R2
R3
R4
R5
R6
R7
SP_abt
LR_abt
PC
THUMB State Program Status Registers
SPSR_fiq
CPSR
SPSR_svc
CPSR
SPSR_abt
R0
R1
R2
R3
R4
R5
R6
R7
SP_und
LR_und
PC
CPSR
SPSR_irq
R0
R1
R2
R3
R4
R5
R6
R7
SP_fiq
LR_fiq
PC
CPSR
SPSR_und
Figure 2-4. Register Organization in THUMB state
2-5
PROGRAMMER'S MODELS3C3410X RISC MICROPROCESSOR
Lo-registersHi-registers
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 stateARM state
R0
R1
R2
R3
R4
R5
R6
R7
Stack Pointer (SP)
Link register (LR)
Program Counter (PC)
CPSR
SPSR
R0
R1
R2
R3
R4
R5
R6
R7
R8
R9
R10
R11
R12
Stack Pointer (R13)
Link register (R14)
Program Counter (R15)
CPSR
SPSR
2-6
Figure 2-5. Mapping of THUMB State Registers onto ARM State Registers
S3C3410X RISC MICROPROCESSORPROGRAMMER'S MODEL
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.
Condition Code Flags
31
3029272826252423876543210
NZCVIFTM4M3 M2 M1 M0
Overflow
Carry/Borrow/Extend
Zero
Negative/Less Than
(Reserved)Control Bits
~
~
~
~
Mode bits
State bit
FIQ disable
IRQ disable
Figure 2-6. Program Status Register Format
2-7
PROGRAMMER'S MODELS3C3410X RISC MICROPROCESSOR
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
be changed 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 I and F bits are the interrupt disable bits. When set, these disable the IRQ and FIQ
interrupts respectively.
The mode bits
The M4, M3, M2, M1 and M0 bits (M[4:0]) are the mode bits. These determine the
processor's operating mode, as shown in Table 2-1. Not all combinations of the mode bits
define a valid processor mode. Only those explicitly described shall be used. The user
should be aware that if any illegal value is programmed into the mode bits, M[4:0], then the
processor will enter an unrecoverable state. If this occurs, reset should be applied.
Reserved bitsThe remaining bits in the PSRs are reserved. When changing a PSR's flag or control bits,
you must ensure that these unused bits are not altered. Also, your program should not rely
on them containing specific values, since in future processors they may read as one or
zero.
2-8
Loading...
+ 284 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.