
- •Introduction
- •ARM7TDMI Architecture
- •The THUMB Concept
- •THUMB’s Advantages
- •ARM7TDMI Block Diagram
- •ARM7TDMI Core Diagram
- •ARM7TDMI Functional Diagram
- •Key to signal types
- •Processor Operating States
- •Switching State
- •Entering THUMB state
- •Entering ARM state
- •Memory Formats
- •Big endian format
- •Little endian format
- •Instruction Length
- •Data Types
- •Operating Modes
- •Registers
- •The ARM state register set
- •The THUMB state register set
- •The relationship between ARM and THUMB state registers
- •Accessing Hi registers in THUMB state
- •The Program Status Registers
- •The condition code flags
- •The control bits
- •Exceptions
- •Action on entering an exception
- •Action on leaving an exception
- •Exception entry/exit summary
- •Notes
- •Abort
- •Software interrupt
- •Undefined instruction
- •Exception vectors
- •Exception priorities
- •Not all exceptions can occur at once:
- •Interrupt Latencies
- •Reset
- •Instruction Set Summary
- •Format summary
- •Instruction summary
- •The Condition Field
- •Branch and Exchange (BX)
- •Instruction cycle times
- •Assembler syntax
- •Using R15 as an operand
- •Examples
- •Branch and Branch with Link (B, BL)
- •The link bit
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Data Processing
- •CPSR flags
- •Shifts
- •Instruction specified shift amount
- •Register specified shift amount
- •Immediate operand rotates
- •Writing to R15
- •Using R15 as an operand
- •TEQ, TST, CMP and CMN opcodes
- •Instruction cycle times
- •Assembler syntax
- •where:
- •Examples
- •PSR Transfer (MRS, MSR)
- •Operand restrictions
- •Reserved bits
- •Example
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Multiply and Multiply-Accumulate (MUL, MLA)
- •If the operands are interpreted as signed
- •If the operands are interpreted as unsigned
- •Operand restrictions
- •CPSR flags
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Multiply Long and Multiply-Accumulate Long (MULL,MLAL)
- •Operand restrictions
- •CPSR flags
- •Instruction cycle times
- •For signed instructions SMULL, SMLAL:
- •For unsigned instructions UMULL, UMLAL:
- •Assembler syntax
- •where:
- •Examples
- •Single Data Transfer (LDR, STR)
- •Offsets and auto-indexing
- •Shifted register offset
- •Bytes and words
- •Little endian configuration
- •Big endian configuration
- •Restriction on the use of base register
- •Example:
- •Data aborts
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Halfword and Signed Data Transfer(LDRH/STRH/LDRSB/LDRSH)
- •Offsets and auto-indexing
- •Halfword load and stores
- •Signed byte and halfword loads
- •Endianness and byte/halfword selection
- •Little endian configuration
- •Big endian configuration
- •Data aborts
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Block Data Transfer (LDM, STM)
- •The register list
- •Addressing modes
- •Address alignment
- •LDM with R15 in transfer list and S bit set (Mode changes)
- •STM with R15 in transfer list and S bit set (User bank transfer)
- •R15 not in list and S bit set (User bank transfer)
- •Use of R15 as the base
- •Inclusion of the base in the register list
- •Data aborts
- •Aborts during STM instructions
- •Aborts during LDM instructions
- •Instruction cycle times
- •Assembler syntax
- •Addressing mode names
- •Examples
- •Single Data Swap (SWP)
- •Bytes and words
- •Data aborts
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Software Interrupt (SWI)
- •Return from the supervisor
- •Comment field
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Supervisor code
- •Coprocessor Data Operations (CDP)
- •The coprocessor fields
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Coprocessor Data Transfers (LDC, STC)
- •The coprocessor fields
- •Addressing modes
- •Address alignment
- •Data aborts
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Coprocessor Register Transfers (MRC, MCR)
- •The coprocessor fields
- •Transfers to R15
- •Transfers from R15
- •Instruction cycle times
- •Assembler syntax
- •Examples
- •Undefined Instruction
- •Instruction cycle times
- •Assembler syntax
- •Instruction Set Examples
- •Using the conditional instructions
- •Using conditionals for logical OR
- •Absolute value
- •Multiplication by 4, 5 or 6 (run time)
- •Combining discrete and range tests
- •Division and remainder
- •Overflow detection in the ARM7TDMI
- •Pseudo-random binary sequence generator
- •Multiplication by constant using the barrel shifter
- •Multiplication by 2^n (1,2,4,8,16,32..)
- •Multiplication by 2^n+1 (3,5,9,17..)
- •Multiplication by 2^n-1 (3,7,15..)
- •Multiplication by 6
- •Multiply by 10 and add in extra number
- •General recursive method for Rb := Ra*C, C a constant:
- •Loading a word from an unknown alignment
- •Format Summary
- •Opcode Summary
- •Format 1: move shifted register
- •Operation
- •Instruction cycle times
- •Examples
- •Format 2: add/subtract
- •Operation
- •Instruction cycle times
- •Examples
- •Format 3: move/compare/add/subtract immediate
- •Operations
- •Instruction cycle times
- •Examples
- •Format 4: ALU operations
- •Operation
- •Instruction cycle times
- •Examples
- •Format 5: Hi register operations/branch exchange
- •Operation
- •Instruction cycle times
- •The BX instruction
- •Examples
- •Using R15 as an operand
- •Format 6: PC-relative load
- •Operation
- •Instruction cycle times
- •Examples
- •Format 7: load/store with register offset
- •Operation
- •Instruction cycle times
- •Examples
- •Format 8: load/store sign-extended byte/halfword
- •Operation
- •Instruction cycle times
- •Examples
- •Format 9: load/store with immediate offset
- •Operation
- •Instruction cycle times
- •Examples
- •Format 10: load/store halfword
- •Operation
- •Instruction cycle times
- •Examples
- •Format 11: SP-relative load/store
- •Operation
- •Instruction cycle times
- •Examples
- •Format 12: load address
- •Operation
- •Instruction cycle times
- •Examples
- •Format 13: add offset to Stack Pointer
- •Operation
- •Instruction cycle times
- •Examples
- •Format 14: push/pop registers
- •Operation
- •Instruction cycle times
- •Examples
- •Format 15: multiple load/store
- •Operation
- •Instruction cycle times
- •Examples
- •Format 16: conditional branch
- •Operation
- •Instruction cycle times
- •Examples
- •Format 17: software interrupt
- •Operation
- •Instruction cycle times
- •Examples
- •Format 18: unconditional branch
- •Operation
- •Examples
- •Format 19: long branch with link
- •Operation
- •Instruction cycle times
- •Examples
- •Instruction Set Examples
- •Multiplication by a constant using shifts and adds
- •General purpose signed divide
- •Thumb code
- •ARM code
- •Division by a constant
- •Explanation of divide-by-constant ARM code
- •ARM code
- •THUMB code
- •Overview
- •Cycle Types
- •Address Timing
- •Data Transfer Size
- •Instruction Fetch
- •Memory Management
- •Locked Operations
- •Stretching Access Times
- •The ARM Data Bus
- •The External Data Bus
- •The unidirectional data bus
- •The bidirectional data bus
- •Example system: The ARM7TDMI Testchip
- •Overview
- •Interface Signals
- •Coprocessor present/absent
- •Busy-waiting
- •Pipeline following
- •Data transfer cycles
- •Register Transfer Cycle
- •Privileged Instructions
- •Idempotency
- •Undefined Instructions
- •Debug Interface
- •Overview
- •Debug Systems
- •Debug Interface Signals
- •Entry into debug state
- •Entry into debug state on breakpoint
- •Entry into debug state on watchpoint
- •Entry into debug state on debug-request
- •Action of ARM7TDMI in debug state
- •Scan Chains and JTAG Interface
- •Scan limitations
- •Scan chain 0
- •Scan chain 1
- •Scan Chain 2
- •The JTAG state machine
- •Reset
- •Pullup Resistors
- •Instruction Register
- •Public Instructions
- •EXTEST (0000)
- •SCAN_N (0010)
- •INTEST (1100)
- •IDCODE (1110)
- •BYPASS (1111)
- •CLAMP (0101)
- •HIGHZ (0111)
- •CLAMPZ (1001)
- •SAMPLE/PRELOAD (0011)
- •RESTART (0100)
- •Test Data Registers
- •Bypass register
- •ARM7TDMI device identification (ID) code register
- •Operating mode:
- •Instruction register
- •Scan chain select register
- •Scan chains 0,1 and 2
- •Scan chain 0 and 1
- •Scan chain 0
- •Scan chain 1
- •Scan chain 3
- •ARM7TDMI Core Clocks
- •Clock switch during debug
- •Clock switch during test
- •Determining the Core and System State
- •Determining the core’s state
- •Determining system state
- •Exit from debug state
- •The PC’s Behaviour During Debug
- •Breakpoint
- •Watchpoints
- •Watchpoint with another exception
- •Debug request
- •System speed access
- •Summary of return address calculations
- •Priorities / Exceptions
- •Breakpoint with prefetch abort
- •Interrupts
- •Data aborts
- •Scan Interface Timing
- •Debug Timing
- •Overview
- •The Watchpoint Registers
- •Programming and reading watchpoint registers
- •Using the mask registers
- •The control registers
- •Programming Breakpoints
- •Hardware breakpoints:
- •Software breakpoints:
- •Hardware breakpoints
- •Software breakpoints
- •Setting the breakpoint
- •Clearing the breakpoint
- •Programming Watchpoints
- •The Debug Control Register
- •Debug Status Register
- •Coupling Breakpoints and Watchpoints
- •Example
- •CHAINOUT signal
- •RANGEOUT signal
- •Example
- •Disabling ICEBreaker
- •ICEBreaker Timing
- •Programming Restriction
- •Debug Communications Channel
- •Debug comms channel registers
- •Communications via the comms channel
- •Introduction
- •Branch and Branch with Link
- •THUMB Branch with Link
- •Branch and Exchange (BX)
- •Data Operations
- •Multiply and Multiply Accumulate
- •Load Register
- •Store Register
- •Load Multiple Registers
- •Store Multiple Registers
- •Data Swap
- •Software Interrupt and Exception Entry
- •Coprocessor Data Operation
- •Coprocessor Data Transfer (from memory to coprocessor)
- •Coprocessor Data Transfer (from coprocessor to memory)
- •Coprocessor Register Transfer (Load from coprocessor)
- •Coprocessor Register Transfer (Store to coprocessor)
- •Undefined Instructions and Coprocessor Absent
- •Unexecuted Instructions
- •Instruction Speed Summary
- •Timing Diagrams

Timing Diagrams
Figure 89. General Timings
MCLK
ECLK
Tcdel
A[31:0]
nRW
MAS[1:0],
LOCK
nM[4:0], nTRANS TBIT
nOPC
nMREQ, SEQ
Tmsh
Tmsd
nEXEC
Texh
Texd
Tcdel
Tah
Taddr
Trwh
Trwd
Tblh
Tbld
Tmdh
Tmdd
Topch
Topcd
Note: nWAIT, APE, ALE and ABE are all HIGH during the cycle shown. Tcdel is the delay (on either edge) from MCLK changing to ECLK changing.
190 Timing Diagrams

Timing Diagrams
Figure 90. ALE Address Control
MCLK
ALE
Tale |
Tald |
|
A[31:0], nRW, LOCK, nOPC, nTRANS, MAS[1:0]
Note: Tald is the time by which ALE must be driven LOW in order to latch the current address in phase 2. If ALE is driven low after Tald, then a new address will be latched.
Figure 91. APE Address Control
MCLK
APE |
|
Taph |
Taps |
A[31:0], |
|
nRW, |
|
LOCK, |
|
nOPC, |
|
nTRANS, |
Tald |
MAS[1:0] |
Figure 92. ABE Address Control
MCLK
ABE |
|
|
Tabz |
Tabe |
Taddr |
A[31:0], |
|
|
nRW, |
|
|
LOCK, |
|
|
nOPC, |
|
|
nTRANS, |
|
|
MAS[1:0] |
|
|
191

Figure 93. Bidirectional Data Write Cycle
MCLK
Tnen
nENOUT
Tnenh
D[31:0]
Tdout |
Tdoh |
Note: DBE is HIGH and nENIN is LOW during the cycle shown.
Figure 94. Bidirectional Data Read Cycle
MCLK |
|
Tnen |
|
nENOUT |
|
D[31:0] |
|
Tdis |
Tdih |
BL[3:0]
Tbylh |
Tbyls |
Note: DBE is HIGH and nENIN is LOW during the cycle shown.
192 Timing Diagrams

Timing Diagrams
Figure 95. Data Bus Control
MCLK
nENOUT |
|
|
Tdbnen |
Tdbnen |
|
DBE |
|
|
Tdbz |
Tdbe |
|
D[31:0] |
|
|
Tdout |
Tdbz |
Tdoh |
nENIN |
|
|
|
|
Tdbe |
Note: The cycle shown is a data write cycle since nENOUT was driven LOW during phase 1. Here, DBE has first been used to modify the behaviour of the data bus, and then nENIN.
Figure 96. Output 3-State Time
MCLK |
|
|
TBE |
|
|
A[31:0], |
Ttbz |
Ttbe |
D[31:0], |
|
|
nRW, LOCK, |
|
|
nOPC, |
|
|
nTRANS |
|
|
MAS[1:0] |
|
|
193

Figure 97. Unidirectional Data Write Cycle
MCLK
Tnen
nENOUT
Tdohu
DOUT[31:]
Tdoutu
Figure 98. Unidirectional Data Read Cycle
MCLK
Tnen
nENOUT
DIN[31:0]
Tdisu Tdihu
BL[3:0]
Tbylh |
Tbyls |
Figure 99. Configuration Pin Timing
MCLK
Tcth |
Tcts |
|
BIGEND
ISYNC |
|
Tcts |
Tcth |
194 Timing Diagrams

Timing Diagrams
Figure 100. |
Coprocessor Timing |
|
|
MCLK |
|
|
Tcpi |
|
|
nCPI |
|
|
|
Tcps |
CPA, CPB |
|
|
|
Tcpms |
Tcph |
nMREQ, |
|
|
|
SEQ |
|
Tcpih |
Note: Normally, nMREQ and SEQ become valid Tmsd after the falling edge of MCLK. In this cycle the ARM has been busy-waiting, waiting for a coprocessor to complete the instruction. If CPA and CPB change during phase 1, the timing of nMREQ and SEQ will depend on Tcpms. Most systems should be able to generate CPA and CPB during the previous phase 2, and so the timing of nMREQ and SEQ will always be Tmsd.
Figure 101. Exception Timing
MCLK
Tabts Tabth
ABORT
Tis Tim
nFIQ, IRQ
Trs Trm
nMREQ, SEQ
Note: |
Tis/Trs guarantee recognition of the interrupt (or reset) source by the corresponding clock edge. Tim/Trm guarantee non-recog- |
|
nition by that clock edge. These inputs may be applied fully asynchronously where the exact cycle of recognition is unimportant. |
195

Figure 102. Debug Timing |
|
|
MCLK |
|
|
|
Tdbgh |
|
DBGACK |
|
|
|
|
Tdbgd |
BREAKPT |
|
|
|
Tbrks |
Tbrkh |
DBGRQ |
|
|
|
Trqs |
Trqh |
TERN[1:0] |
|
|
Texts |
Texth |
|
Figure 103. Breakpoint Timing
MCLK
BREAKPT
Tbcems
nCPI, nEXEC, nMREQ, SEQ
Note: BREAKPT changing in the LOW phase of MCLK to signal a watchpointed store can affect nCPI, nEXEC, nMREQ, and SEQ in the LOW phase of MCLK.
Figure 104. TCK-ECLK Relationship
MCLK
ECLK
Tctdel |
Tctdel |
196 Timing Diagrams

Timing Diagrams
Figure 105. MCLK Timing
MCLK |
|
Tmckl |
Tmckh |
nWAIT |
|
Tws |
|
ECLK |
|
nMREQ/ |
|
SEQ |
|
Tmsd |
|
A[31:0] |
|
Twh
Taddr
Note: The ARM core is not clocked by the HIGH phase of MCLK enveloped by nWAIT. Thus, during the cycles shown, nMREQ and SEQ change once, during the first LOW phase of MCLK, and A[31:0] change once, during the second HIGH phase of MCLK. For reference, ph2 is shown. This is the internal clock from which the core times all its activity. This signal is included to show how the high phase of the external MCLK has been removed from the internal core clock.
197

Atmel Headquarters |
Atmel Operations |
Corporate Headquarters |
Atmel Colorado Springs |
2325 Orchard Parkway |
1150 E. Cheyenne Mtn. Blvd. |
San Jose, CA 95131 |
Colorado Springs, CO 80906 |
TEL (408) 441-0311 |
TEL (719) 576-3300 |
FAX (408) 487-2600 |
FAX (719) 540-1759 |
Europe |
Atmel Rousset |
Atmel U.K., Ltd. |
Zone Industrielle |
Coliseum Business Centre |
13106 Rousset Cedex, France |
Riverside Way |
TEL (33) 4 42 53 60 00 |
Camberley, Surrey GU15 3YL |
FAX (33) 4 42 53 60 01 |
England |
|
TEL (44) 1276-686677 |
|
FAX (44) 1276-686697 |
|
Asia |
|
Atmel Asia, Ltd. |
|
Room 1219 |
|
Chinachem Golden Plaza |
|
77 Mody Road |
|
Tsimshatsui East |
|
Kowloon, Hong Kong |
|
TEL (852) 27219778 |
|
FAX (852) 27221369 |
|
Japan |
|
Atmel Japan K.K. |
|
Tonetsu Shinkawa Bldg., 9F |
|
1-24-8 Shinkawa |
|
Chuo-ku, Tokyo 104-0033 |
|
Japan |
|
TEL (81) 3-3523-3551 |
|
FAX (81) 3-3523-7581 |
|
Fax-on-Demand
North America: 1-(800) 292-8635
International: 1-(408) 441-0732
e-mail literature@atmel.com
Web Site
http://www.atmel.com
BBS
1-(408) 436-4309
© Atmel Corporation 1999.
Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard warranty which is detailed in Atmel’s Terms and Conditions located on the Company’s website. The Company assumes no responsibility for any errors which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use as critical components in life support devices or systems.
Marks bearing ® and/or ™ are registered trademarks and trademarks of Atmel Corporation.
Terms and product names in this document may be trademarks of others.
Printed on recycled paper.
Rev. 0673B–01/99