ARM Dual-Timer Module SP804 Manual
ARM Dual-Timer Module SP804 Manual
Revision: r1p0
Change history
Proprietary Notice
Words and logos marked with ® or ™ are registered trademarks or trademarks of ARM Limited in the EU and
other countries, except as otherwise stated below in this proprietary notice. Other brands and names
mentioned herein may be the trademarks of their respective owners.
Neither the whole nor any part of the information contained in, or the product described in, this document
may be adapted or reproduced in any material form except with the prior written permission of the copyright
holder.
The product described in this document is subject to continuous developments and improvements. All
particulars of the product and its use contained in this document are given by ARM Limited in good faith.
However, all warranties implied or expressed, including but not limited to implied warranties of
merchantability, or fitness for purpose, are excluded.
This document is intended only to assist the reader in the use of the product. ARM Limited shall not be liable
for any loss or damage arising from the use of any information in this document, or any error or omission in
such information, or any incorrect use of the product.
Confidentiality Status
This document is Non-Confidential. The right to use, copy and disclose this document may be subject to
license restrictions in accordance with the terms of the agreement entered into by ARM and the party that
ARM delivered this document to.
Product Status
Web Address
[Link]
ii Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Contents
ARM Dual-Timer Module (SP804) Technical
Reference Manual
Preface
About this book .............................................................................................. x
Feedback ..................................................................................................... xiv
Chapter 1 Introduction
1.1 About the ARM Dual-Timer module (SP804) .............................................. 1-2
1.2 Features ...................................................................................................... 1-3
1.3 Programmable parameters ......................................................................... 1-4
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. iii
Contents
iv Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
List of Tables
ARM Dual-Timer Module (SP804) Technical
Reference Manual
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. v
List of Tables
vi Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
List of Figures
ARM Dual-Timer Module (SP804) Technical
Reference Manual
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. vii
List of Figures
viii Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Preface
This preface introduces the Dual-Timer module (SP804) and its reference
documentation. It contains the following sections:
• About this book on page x
• Feedback on page xiv.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. ix
Preface
Intended audience
Chapter 1 Introduction
Read this chapter for an introduction to the Dual-Timer module and its
features.
The rnpn identifier indicates the revision status of the product described in this
document, where:
x Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Preface
Typographical conventions
monospace bold Denotes language keywords when used outside example code.
Other conventions
This document uses other conventions. They are described in the following sections:
• Signals
• Bytes, Halfwords, and Words on page xii
• Bits, bytes, k, and M on page xii
• Register fields on page xii.
Signals
When a signal is described as being asserted, the level depends on whether the signal is
active HIGH or active LOW. Asserted means HIGH for active high signals and LOW
for active low signals:
Prefix n Active LOW signals are prefixed by a lowercase n except in the case of
AHB or APB reset signals. These are named HRESETn and PRESETn
respectively.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. xi
Preface
Suffix K When used to indicate an amount of memory means 1024. When used to
indicate a frequency means 1000.
Suffix M When used to indicate an amount of memory means 10242 = 1048 576.
When used to indicate a frequency means 1000000.
Register fields
All reserved or unused address locations must not be accessed as this can result in
unpredictable behavior of the device.
All reserved or unused bits of registers must be written as zero, and ignored on read
unless otherwise stated in the relevant text.
All registers bits are reset to logic 0 by a system reset unless otherwise stated in the
relevant text.
Unless otherwise stated in the relevant text, all registers support read and write accesses.
A write updates the contents of the register and a read returns the contents of the register.
All registers defined in this document can only be accessed using word reads and word
writes, unless otherwise stated in the relevant text.
Numbers
xii Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Preface
Further reading
This section lists publications from ARM Limited that provide additional information
about ARM devices.
ARM publications
This document contains information that is specific to the ARM Dual-Timer module.
Refer to the following document for other relevant information:
• AMBA Specification (Rev 2.0) (ARM IHI 0011).
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. xiii
Preface
Feedback
ARM Limited welcomes feedback on both the Dual-Timer Module (SP804), and its
documentation.
If you have any problems with the Dual-Timer Module (SP804), contact your supplier.
To help us provide a rapid and useful response, give:
• details of the release you are using
• details of the platform you are running on, such as the hardware platform,
operating system type and version
• a small standalone sample of code that reproduces the problem
• a clear explanation of what you expected to happen, and what actually happened
• the commands you used, including any command-line options
• sample output illustrating the problem
• the version string of the tool, including the version number and date.
If you have any comments on this book, send email to errata@[Link] giving:
• the document title
• the document number
• the page number(s) to which your comments apply
• a concise explanation of your comments.
xiv Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Chapter 1
Introduction
This chapter introduces the Dual-Timer Module (SP804). It contains the following
sections:
• About the ARM Dual-Timer module (SP804) on page 1-2
• Features on page 1-3
• Programmable parameters on page 1-4.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 1-1
Introduction
The module is an AMBA slave module and connects to the Advanced Peripheral Bus
(APB). The Dual-Timer module consists of two programmable 32/16-bit down counters
that can generate interrupts on reaching zero.
1-2 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Introduction
1.2 Features
The features of the Dual-Timer module are:
• Compliance to the AMBA Specification (Rev 2.0) for easy integration into an
SoC implementation.
• Two 32/16-bit down counters with free-running, periodic and one-shot modes.
• Common clock with separate clock-enables for each timer gives flexible control
of the timer intervals.
• Identification registers that uniquely identify the Dual-Timer module. These can
be used by software to automatically configure itself.
Note
In Figure 1-1, test logic is not shown for clarity.
Load Register
Value Register
Background load Register TIMINT2
Control Register
Raw Interrupt Status Register
Masked Interrupt Status Register
Interrupt Clear Register
TIMCLKEN2
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 1-3
Introduction
1-4 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Chapter 2
Functional Overview
This chapter describes the Dual-Timer Module (SP804) operation. It contains the
following sections:
• Overview on page 2-2
• Functional description on page 2-4.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 2-1
Functional Overview
2.1 Overview
This section gives a basic overview of the Dual-Timer module operation. See
Functional description on page 2-4 for a full description of the Dual-Timer module
functionality.
The FRCs operate from a common timer clock, TIMCLK with each FRC having its
own clock enable input, TIMCLKEN1 and TIMCLKEN2. Each FRC also has a
prescaler that can divide down the enabled TIMCLK rate by 1, 16, or 256. This enables
the count rate for each FRC to be controlled independently using their individual clock
enables and prescalers.
The operation of each Timer module is identical. A Timer module can be programmed
for a 32-bit or 16-bit counter size and one of three timer modes using the Control
Register. The three timer modes are:
One-shot The counter is loaded with a new value by writing to the Load
Register. The counter decrements to zero and then halts until it is
reprogrammed.
The timer count is loaded by writing to the Load Register and, if enabled, the timer
count decrements at a rate determined by TIMCLK, TIMCLKENX, and the prescaler
setting. When the Timer counter is already running, writing to the Load Register causes
the counter to immediately restart from the new value.
An alternative way of loading the Timer count is by writing to the Background Load
Register. This has no immediate effect on the current count but the counter continues to
decrement. On reaching zero, the Timer count is reloaded from the new load value if it
is in periodic mode.
2-2 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Functional Overview
When the Timer count reaches zero an interrupt is generated. The interrupt is cleared by
writing to the Interrupt Clear Register. The external interrupt signals can be masked off
by the Interrupt Mask Registers.
The current counter value can be read from the Value Register at any time.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 2-3
Functional Overview
Note
In Figure 2-1, test logic is not shown for clarity.
Timer1BGLoad Timer1Control
PRESETn AMBA APB Interface PWDATA[31:0]
Register Register
PSEL PADDR[11:2]
PENABLE FrcSel1
32/16-bit down counter
PWRITE Frc1Data[31:0]
PADDR[11:2] FrcSel2
PWDATA[31:0] ID Registers Frc2Data[31:0]
Timer1Value Interrupt and
PRDATA[31:0] Integration Test Registers TIMINT1
Register reload control
PCLK
Timer2BGLoad Timer2Control
Register Register
2-4 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Functional Overview
The AMBA APB slave interface generates read and write decodes for accesses to all
registers in the Dual-Timer module.
The two FRCs are identical and contain the 32/16-bit down counter and interrupt
functionality. The counter logic is clocked independently of PCLK by TIMCLK in
conjunction with a clock enable TIMCLKENX although there are constraints on the
relationship between PCLK and TIMCLK. See Clock signals and clock enables on
page 2-6 for details of these constraints.
Although the two FRCs are driven from a common clock, TIMCLK, each timer count
rate can be independently controlled by their respective clock enables, TIMCLKEN1
and TIMCLKEN2. The prescaler in each FRC gives a further independent control of
the count rate of each FRC.
See Timer operation on page 2-9 for an operational description of the FRCs.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 2-5
Functional Overview
• PCLK is used to time all APB accesses to the Dual-Timer module registers.
The relationship between TIMCLK and PCLK must observe the following
constraints:
• the rising edges of TIMCLK must be synchronous and balanced with a rising
edge of PCLK
TIMCLK, TIMCLKEN1, and TIMCLKEN2 can be used in the ways described in the
following sections:
• TIMCLK equals PCLK and TIMCLKENX equals one
• TIMCLK equals PCLK and TIMCLKENX is pulsed on page 2-7
• TIMCLK is less than PCLK and TIMCLKENX equals one on page 2-7
• TIMCLK is less than PCLK and TIMCLKENX is pulsed on page 2-8.
Note
Unless otherwise stated these examples use a prescale setting of divide by 1. The
examples apply to either Timer1 or Timer2 in the module. TIMCLKENX refers to
either TIMCLKEN1 or TIMCLKEN2.
Figure 2-2 on page 2-7 shows the case where TIMCLK is identical to PCLK and
TIMCLKENX is permanently enabled. In this case, the counter is decremented on
every TIMCLK edge.
2-6 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Functional Overview
PCLK
TIMCLK
TIMCLKENX=1
Figure 2-2 TIMCLK equals PCLK and TIMCLKENX equals one, clock example
Figure 2-3 shows the case where TIMCLK is identical to PCLK but TIMCLKENX
only enables every second TIMCLK edge. In this case, the counter is decremented on
every second TIMCLK rising edge.
PCLK
TIMCLK
TIMCLKENX
Figure 2-3 TIMCLK equals PCLK and TIMCLKENX is pulsed, clock example
Figure 2-4 shows the case where TIMCLK frequency is a submultiple of the PCLK
frequency but the rising edges of TIMCLK are synchronous and balanced with PCLK
edges. TIMCLKENX is permanently enabled. In this case, the counter is decremented
on every TIMCLK rising edge.
Count n n-1
PCLK
TIMCLK
TIMCLKENX=1
Figure 2-4 TIMCLK is less than PCLK and TIMCLKENX equals one, clock example
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 2-7
Functional Overview
Figure 2-5 shows the case where TIMCLK frequency is a submultiple of the PCLK
frequency but the rising edges of TIMCLK are synchronous and balanced with PCLK
edges. TIMCLKENX only enables every second TIMCLK edge. In this case, the
counter is decremented on every second TIMCLK rising edge.
PCLK
TIMCLK
TIMCLKENX
Figure 2-5 TIMCLK is less than PCLK and TIMCLKENX is pulsed, clock example
The prescaler generates a timer clock enable that is used to enable the decrementing of
the timer counter at one of the following rates:
• the effective timer clock rate where TIMCLK is qualified by TIMCLKENX
• the effective timer clock rate divided by 16
• the effective timer clock rate divided by 256.
Figure 2-6 shows how the timer clock enable is generated by the prescaler.
Timer clock
enable Divide by 16 Divide by 16
(TIMCLKENX)
10
Timer clock enable
01
after prescaling
00
TimerX Control
TimerPre[1:0]
Register
Figure 2-7 on page 2-9 shows an example of how the prescaler generates the timer clock
enable for a prescaler setting of divide by 16.
2-8 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Functional Overview
PCLK
TIMCLK
TIMCLKENX
After the initial application and release of PRESETn, the Timer state is initialized as
follows:
• the counter is disabled, TimerEn=0
• free-running mode is selected, TimerMode=0 and OneShot=0
• 16-bit counter mode is selected, TimerSize=0
• prescalers are set to divide by 1, TimerPre=0x0
• interrupts are cleared but enabled, IntEnable=1
• the Load Register is set to zero
• the counter Value is set to 0xFFFFFFFF.
Free-running mode
The 32-bit or 16-bit counter operation is selected by setting the TimerSize bit
appropriately in the TimerControl Register.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 2-9
Functional Overview
On reset the timer value is initialized to 0xFFFFFFFF and if the counter is enabled then
the count decrements by one for each TIMCLK positive edge when TIMCLKENX is
HIGH and the prescaler generates an enable pulse. Alternatively, a new initial counter
value can be loaded by writing to the TimerXLoad Register and the counter starts
decrementing from this value if the counter is enabled.
In 32-bit mode, when the count reaches zero, 0x00000000, an interrupt is generated and
the counter wraps around to 0xFFFFFFFF irrespective of the value in the TimerXLoad
Register. The counter starts to decrement again and this whole cycle repeats for as long
as the counter is enabled.
In 16-bit mode, only the least significant 16-bits of the counter are decremented and
when the count reaches 0x0000, an interrupt is generated and the counter wraps round to
0xFFFF irrespective of the value in the TimerXLoad Register.
If the counter is disabled by clearing the TimerEn bit in the TimerControl Register, the
counter halts and holds its current value. If the counter is re-enabled again then the
counter continues decrementing from the current value.
The counter value can be read at any time by reading the TimerXValue Register.
Periodic mode
Periodic mode is selected by setting the following bits in the TimerControl Register:
• set TimerMode bit to 0
• set OneShot bit to 0.
The 32-bit or 16-bit counter operation is selected by setting the TimerSize bit
appropriately in the TimerControl Register.
An initial counter value can be loaded by writing to the TimerXLoad Register and the
counter starts decrementing from this value if the counter is enabled.
In 32-bit mode, the full 32 bits of the counter are decremented and when the count
reaches zero, 0x00000000, an interrupt is generated and the counter reloads with the
value in the TimerXLoad Register. The counter starts to decrement again and this whole
cycle repeats for as long as the counter is enabled.
In 16-bit mode, only the least significant 16-bits of the counter are decremented and
when the count reaches 0x0000, an interrupt is generated and the counter reloads with
the value in the TimerXLoad Register. The counter starts to decrement again and this
whole cycle repeats for as long as the counter is enabled.
If a new value is loaded into the counter by writing to the TimerXLoad Register while
the counter is running then the counter values changes to the new load value on the next
TIMCLK when TIMCLKENX is HIGH.
2-10 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Functional Overview
If a new value is written to the Background Load Register, TimerXBGLoad, while the
counter is running then the TimerXLoad Register is also updated with the same load
value but the counter continues to decrement to zero. When it reaches zero, the counter
reloads with the new load value and uses this new load value for each subsequent reload
for as long as the timer is enabled in periodic mode.
If the counter is disabled by clearing the TimerEn bit in the TimerControl Register, the
counter halts and holds its current value. If the counter is re-enabled again then the
counter continues decrementing from the current value.
One-shot mode
One-shot timer mode is selected by setting the OneShot bit in the TimerControl Register
to 1. The TimerMode bit has no effect in one-shot mode.
The 32-bit or 16-bit counter operation is selected by setting the TimerSize bit
appropriately in the TimerControl Register.
To initiate a count down sequence in one-shot mode, write a new load value to the
TimerXLoad Register and the counter starts decrementing from this value if enabled.
In 32-bit mode, the full 32-bits of the counter are decremented and when the count
reaches zero, 0x00000000, an interrupt is generated and the counter halts.
In 16-bit mode, only the least significant 16-bits of the counter are decremented and
when the count reaches 0x0000, an interrupt is generated and the counter halts.
One-shot mode can be retriggered by writing a new value to the TimerXLoad Register.
The counter values changes to the new load value on the next TIMCLK when
TIMCLKENX is HIGH.
When the Timer module raises an interrupt by asserting TIMINTX, the timing of this
signal is generated from a rising clock edge of TIMCLK enabled by TIMCLKENX.
When the interrupt is cleared by a write to the Interrupt Clear Register, TimerXIntClr,
the TIMINTX signal is deasserted immediately in the PCLK domain rather than
waiting for the next enabled TIMCLK rising edge.
Figure 2-8 on page 2-12 illustrates an example of the timing for an interrupt being
raised and cleared.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 2-11
Functional Overview
PCLK
TIMCLK
TIMCLKENX
Interrupt cleared immediately on
TIMINTX Interrupt asserted when counter write to Interrupt Clear Register
reaches zero
PSEL
PENABLE
The interrupt signals generated by the Timer module, TIMINT1 and TIMINT2, can be
masked by setting the IntEnable bit to 0 in the TimerXControl Register. The raw
interrupt status prior to masking can be read from the TimerXRIS Register and the
masked interrupt status can be read from the TimerXMIS Register. Figure 2-9 shows
how the raw and masked interrupt status is accessed.
TimerXMIS
Register
TimerXRIS
Register
TimerXControl
IntEnable
Register
Table 2-1 on page 2-13 shows the equations that are used to calculate the timer interval
generated for each timer mode in terms of:
2-12 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Functional Overview
Mode Interval
Free-running 32-bit
TIMCLKENXDIV x PRESCALEDIV
x 232
TIMCLKFREQ
Free-running 16-bit
TIMCLKENXDIV x PRESCALEDIV
x 216
TIMCLKFREQ
TIMCLKENXDIV x PRESCALEDIV
x TimerXLoad
TIMCLKFREQ
For example, the TimerXLoad value required for a 1ms periodic interval with
TIMCLK=100MHz, TIMCLKENXDIV=1, and PRESCALEDIV=1 is calculated as
shown in Example 2-1.
Interval x TIMCLKFREQ
TimerXLoad =
TIMCLKENXDIV x PRESCALEDIV
1ms x 100MHz
TimerXLoad = = 105 = 0x000186A0
1x1
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 2-13
Functional Overview
Note
The minimum valid value for TimerXLoad is 1. If TimerXload is set to 0 then an
interrupt is generated immediately.
The Dual-Timer module contains a set of read-only Identification Registers that can be
used by software to identify the timer peripheral type and revision. Software can use this
information to automatically configure itself.
2-14 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Chapter 3
Programmer’s Model
This chapter describes the registers of the Dual-Timer Module (SP804). It contains the
following sections:
• Summary of registers on page 3-2
• Register descriptions on page 3-4.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 3-1
Programmer’s Model
Base+0x00 Read/write 32 0x00000000 Timer1Load See Load Register, TimerXLoad on page 3-4
Base+0x20 Read/write 32 0x00000000 Timer2Load See Load Register, TimerXLoad on page 3-4
3-2 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Programmer’s Model
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 3-3
Programmer’s Model
Note
The letter X used in register names means a register in either FRC1 or FRC2.
The TimerXLoad Register is a 32-bit register that contains the value from which the
counter is to decrement. This is the value used to reload the counter when Periodic mode
is enabled, and the current count reaches zero.
When this register is written to directly, the current count immediately resets to the new
value at the next rising edge of TIMCLK which is enabled by TIMCLKENX.
Note
The minimum valid value for TimerXLoad is 1. If TimerXload is set to 0 then an
interrupt is generated immediately.
The value in this register is also over-written if the TimerXBGLoad Register is written
to, but the current count is not immediately affected.
If values are written to both the TimerXLoad and TimerXBGLoad Registers before an
enabled rising edge on TIMCLK, then on the next enabled TIMCLK edge the value
written to the TimerXLoad value replaces the current count value. After that, each time
the counter reaches zero the current count value resets to the value written to
TimerXBGLoad.
3-4 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Programmer’s Model
Reading from the TimerXLoad Register at any time after the two writes have occurred
retrieves the value written to TimerXBGLoad. That is, the value read from TimerXLoad
is always the value that takes effect for Periodic mode after the next time the counter
reaches zero.
The TimerXValue Register is a 32-bit read-only register that gives the current value of
the decrementing counter.
After a load operation has taken place by writing a new load value to TimerXLoad, the
TimerXValue register reflects the new load value immediately in the PCLK clock
domain without waiting for the next TIMCLK edge qualified by TIMCLKENX.
Note
The most significant 16 bits of the 32-bit TimerXValue Register are not automatically
set to 0 when in 16-bit timer mode. If the timer is in 16-bit mode then the most
significant 16 bits of the TimerXValue Register might have a non-zero value if the timer
was previously in 32-bit mode and a write to the TimerXLoad Register has not occurred
since the change to 16-bit mode.
The bit assignments of the Control Register are listed in Table 3-2.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 3-5
Programmer’s Model
Caution
The counter mode, size or prescale settings must not be changed while the Timer
module is running. If a new configuration is required then the Timer module must be
disabled and then the new configuration values written to the appropriate registers. The
Timer module must then be re-enabled after the configuration changes are complete.
Failure to follow this procedure can result in unpredictable behavior of the device.
Any write to this register, clears the interrupt output from the counter.
The TimerXRIS Register indicates the raw interrupt status from the counter. The bit
assignment is listed in Table 3-3.
3-6 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Programmer’s Model
The TimerXMIS Register indicates the masked interrupt status from the counter. This
value is the logical AND of the raw interrupt status with the Timer Interrupt Enable bit
from the control register, and is the same value which is passed to the interrupt output
pin, TIMINTX. The bit assignment is listed in Table 3-4.
The TimerXBGLoad Register is a 32-bit register that contains the value from which the
counter is to decrement. This is the value used to reload the counter when Periodic mode
is enabled, and the current count reaches zero.
Reading from this register returns the same value returned from TimerXLoad. See Load
Register, TimerXLoad on page 3-4 for more information.
The TimerPeriphID0-3 Registers are four 8-bit registers, that span address locations
0xFE0 - 0xFEC. The registers can conceptually be treated as a 32-bit register. The
read-only registers provide the peripheral options listed in Table 3-5.
Bits Function
PartNumber[11:0] This is used to identify the peripheral. The three digits product code 0x804 is used.
Designer ID[19:12] This is the identification of the designer. ARM Limited is 0x41 (ASCII A).
Revision[23:20] This is the revision number of the peripheral. The revision number starts from 0.
Configuration[31:24] This is the configuration option of the peripheral. The configuration value is 0.
Figure 3-1 on page 3-8 shows the bit assignments for the registers.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 3-7
Programmer’s Model
Revision Part
Configuration Designer 1 Designer 0 Part number 0
Actual register bit number number 1
assignment
7 07 43 07 43 07 0
31 24 23 20 19 16 15 12 11 87 0
Conceptual register
bit assignment Configuration
Revision
Designer Part number
number
Note
When you design a system memory map you must remember that the peripheral has a
4KB-memory footprint. The 4-bit revision number is implemented by instantiating a
component called RevAnd four times with its inputs tied off as appropriate, and the
output sent to the read multiplexor. All memory accesses to the peripheral identification
registers must be 32-bit, using the LDR instructions.
The four, 8-bit peripheral identification registers are described in the following
subsections:
• Timer Peripheral ID0 Register, TimerPeriphID0 on page 3-9
• Timer Peripheral ID1 Register, TimerPeriphID1 on page 3-9
• Timer Peripheral ID2 Register, TimerPeriphID2 on page 3-9
• Timer Peripheral ID3 Register, TimerPeriphID3 on page 3-10.
3-8 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Programmer’s Model
The TimerPeriphID0 Register is hard-coded and the fields in the register determine the
reset value. Table 3-6 lists the bit assignments of the register.
The TimerPeriphID1 Register is hard-coded and the fields in the register determine the
reset value. Table 3-7 lists the bit assignments of the register.
The TimerPeriphID2 register is hard-coded and the fields in the register determine the
reset value. Table 3-8 lists the bit assignment of the register.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 3-9
Programmer’s Model
The TimerPeriphID3 register is hard-coded and the fields in the register determine the
reset value. Table 3-9 shows the bit assignments of the register.
The TimerPCellID0-3 Registers are four 8-bit registers, that span address locations
0xFF0-0xFFC. The read-only registers can conceptually be treated as a 32-bit register. The
register is used as a standard cross-peripheral identification system. The TimerPCellID
Register is set to 0xB105F00D. Figure 3-2 shows the bit assignment for the registers.
31 24 23 16 15 87 0
Conceptual register
bit assignment TimerPCellID3 TimerPCellID2 TimerPCellID1 TimerPCellID0
The four, 8-bit PrimeCell identification registers are described in the following
subsections:
• PrimeCell ID0 Register, TimerPCellID0 on page 3-11
• PrimeCell ID1 Register, TimerPCellID1 on page 3-11
• PrimeCell ID2 Register, TimerPCellID2 on page 3-11
• PrimeCell ID3 Register, TimerPCellID3 on page 3-12.
3-10 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Programmer’s Model
The TimerPCellID0 register is hard-coded and the fields in the register determine the
reset value. Table 3-10 shows the bit assignments of the register.
The TimerPCellID1 register is hard-coded and the fields in the register determine the
reset value. Table 3-11 shows the bit assignment of the register.
The TimerPCellID2 register is hard-coded and the fields in the register determine the
reset value. Table 3-12 shows the bit assignment of the TimerPCellID2 register.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 3-11
Programmer’s Model
The TimerPCellID3 register is hard-coded and the fields in the register determine the
reset value. Table 3-13 shows the bit assignment of the TimerPCellID3 register.
3-12 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Chapter 4
Programmer’s Model for Test
This chapter describes the additional logic for functional verification and production
testing. It contains the following sections:
• Integration test harness overview on page 4-2
• Scan testing on page 4-3
• Test registers on page 4-4.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 4-1
Programmer’s Model for Test
Figure 3-1 shows a block diagram of the output integration test harness and how
TIMINT1, TIMINT2, and TIMINTC are controlled in integration test mode.
TimerITOP[1] 1
TimerITOP TIMINT2
0
Register
TimerITOP[0]
Timer module
TIMINTC
outputs
TimerITCR
ITEN
Register
4-2 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Programmer’s Model for Test
The Dual-Timer module includes placeholder signals to aid the scan insertion process.
These are:
• SCANENABLE
• SCANINPCLK
• SCANOUTPCLK.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. 4-3
Programmer’s Model for Test
This is a single-bit register used to enable integration test mode. When in this mode, the
masked interrupt outputs are directly controlled by the integration test output set
register. The bit assignments are listed in Table 4-1.
[0] ITEN Read/write Integration test enable. When this bit is 1 the Dual-Timer module is placed in
Integration Test Mode, otherwise it is in normal mode.
When in integration test mode, the enabled interrupt outputs are driven directly from the
values in this register. The combined interrupt output TIMINTC then becomes the
logical OR of the bits set in the integration test output set register. The bit assignments
are listed in Table 4-2.
[1] TIMINT2 Write Value output on TIMINT2 when in Integration Test Mode
[0] TIMINT1 Write Value output on TIMINT1 when in Integration Test Mode
4-4 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Appendix A
Signal Descriptions
This chapter describes the signals that interface with the Dual-Timer Module (SP804).
It contains the following sections:
• AMBA APB signals on page A-2
• Non-AMBA signals on page A-3.
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. A-1
Signal Descriptions
PADDR[11:2] Input APB bridge Subset of the AMBA APB address bus.
PENABLE Input APB bridge AMBA APB enable signal. PENABLE is asserted HIGH for
one cycle of PCLK to enable a bus transfer.
PRDATA[31:0] Output APB bridge Unidirectional AMBA APB read data bus.
PRESETn Input Reset controller APB bus reset signal, active LOW.
PSEL Input APB bridge Timer module select signal from the decoder within the APB
bridge. When HIGH this signal indicates the slave device is
selected by the APB bridge, and that a data transfer is required.
PWDATA[31:0] Input APB bridge Unidirectional AMBA APB write data bus.
PWRITE Input APB bridge AMBA APB transfer direction signal, indicates a write access
when HIGH, read access when LOW.
A-2 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Signal Descriptions
SCANENABLE Input Test controller Placeholder for Dual-Timer module scan enable signal
SCANINPCLK Input Test controller Placeholder for Dual-Timer module input scan signal
SCANOUTPCLK Output Test controller Placeholder Dual-Timer module output scan signal
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. A-3
Signal Descriptions
A-4 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
Index
ARM DDI 0271D Copyright © 2002-2004 ARM Limited. All rights reserved. Index-1
Index
P Timer interval
programming 2-12
Peripheral Identification Registers 3-7 TimerITCR 4-4
Prescaler 1-4 TimerITOP 4-4
operation 2-8 TimerPCellID0-3 3-10
PrimeCell Identification Registers TimerPeriphID0-3 3-7
3-10 TimerXBGLoad 3-7
Product revision status x TimerXControl 3-5
Programmable parameters 1-4 TimerXIntClr 3-6
TimerXLoad 3-4
TimerXMIS 3-7
R TimerXRIS 3-6
TimerXValue 3-5
Raw Interrupt Status Register 3-6
Register descriptions 3-4
Background Load Register 3-7 W
Control Register 3-5
Current Value Register 3-5 Word length conventions xii
Interrupt Clear Register 3-6
Load Register 3-4
Masked Interrupt Status Register
3-7
Peripheral Identification Registers
3-7
PrimeCell Identification Registers
3-10
Raw Interrupt Status Register 3-6
Register field conventions xii
Reset signal 2-5
Revision status x
S
Scan testing 4-3
Signal conventions xi
Signals
APB A-2
non-AMBA A-3
Summary of registers 3-2
T
Test registers
Integration Test Control Register
4-4
Integration Test Output Set Register
4-4
Index-2 Copyright © 2002-2004 ARM Limited. All rights reserved. ARM DDI 0271D
The Free Running Counters (FRCs) in the ARM Dual-Timer module operate in three distinct modes: free-running, periodic, and one-shot, each offering specific operational characteristics tailored for different application needs . In free-running mode, the counter continuously decrements and wraps to its maximum value after reaching zero, useful for uninterrupted timing such as system uptime tracking . Periodic mode refills the counter from the Load Register upon reaching zero, ideal for repetitive tasks like clock generation or periodic updates . One-shot mode triggers a countdown from a preloaded value and halts at zero, suitable for single event timings . These modes collectively enhance the versatility of the dual-timer in handling various timing requirements across different processes in System-on-Chip (SoC) applications .
In the ARM Dual-Timer module, interrupts are generated when the timer count reaches zero. In 32-bit mode, this occurs when the counter value is 0x00000000, and in 16-bit mode, when it is 0x0000 . The interrupts are handled by writing to the Interrupt Clear Register (TimerXIntClr), which immediately deasserts the interrupt signal in the PCLK domain . The module raises the interrupt by asserting the TIMINTX signal, timed with a rising TIMCLK edge . The interrupts can be masked by setting the IntEnable bit to 0 in the TimerXControl Register, allowing selective handling or suppression of interrupt signals . The current interrupt status, both raw and masked, can be monitored via the TimerXRIS and TimerXMIS registers .
The Integration Test Control Register (TimerITCR) and the Integration Test Output Set Register (TimerITOP) are used to facilitate functional verification and integration testing in the ARM Dual-Timer module . The TimerITCR is a single-bit register enabling the integration test mode, allowing direct manipulation of masked interrupt outputs for verifying connectivity and response in SoC designs . In test mode, the TIMINT1, TIMINT2, and TIMINTC signals are controlled directly from the TimerITOP register . This functionality is important for verifying module integration by enabling external control over interrupt outputs, ensuring that they interfaced correctly within the System-on-Chip environment .
The prescaler in the ARM Dual-Timer module plays a critical role in adjusting the operational frequency of each Free Running Counter by dividing the timer clock (TIMCLK) rate . It provides three division options: 1, 16, or 256, allowing the frequency of the timer to be tailored to different operational needs . By adjusting the count rate, the prescaler enables precise control over the timing intervals generated by the timers, which is essential for applications that require variable timing frequencies . This functionality is crucial for optimizing the processing load and power consumption within different SoC applications, where different tasks may have varying timing requirements .
The ARM Dual-Timer module offers enhanced timing functionalities through its support for two identical, programmable Free Running Counters (FRCs) that can operate in 32-bit or 16-bit modes . These two FRCs can be configured in three modes: free-running, periodic, or one-shot . The flexibility of configuring these modes allows the device to handle continuous operations, specified periodic intervals, or single execution cycles effectively. Each timer uses a prescaler to divide the clock, enabling selective speed operations, making it suitable for various timing and control applications within an SoC . The independent operation of each timer enhances multitasking capabilities, providing efficient timer operations essential for managing multiple parallel processes .
The AMBA Advanced Peripheral Bus (APB) interface serves a crucial role in the ARM Dual-Timer module by providing a standard communication protocol that facilitates efficient data exchange between the timer module and other system components . This interface is designed for low power consumption and minimal complexity, making it ideal for connecting peripheral devices on the SoC . The APB interface simplifies integration and communication pathways, reducing latency and enhancing the overall system responsiveness . It allows for easy accessibility to timer registers, facilitating control over timing functions without intricate wiring or increased signal noise, thus streamlining the design and operation of complex SoC systems .
The Background Load Register offers an alternative method for updating the timer count without interrupting the current counting process . This register allows a new load value to be written while the timer continues its countdown, particularly in periodic mode . Once the timer reaches zero, it reloads from the Background Load Register, permitting seamless timer operation without requiring a pause or reset when a new timer interval value is needed . This capability is vital for applications that need to switch timing intervals on the fly, maintaining continuous execution and reducing the overhead caused by halting and reprogramming the timer .
In periodic mode, the ARM Dual-Timer module operates by continuously decrementing the counter - initialized by a load value - until reaching zero, subsequently triggering an interrupt and refilling the counter from the Load Register . This repetitive cycle continues as long as the counter remains enabled, keeping the operation consistent and timing precise . Primary applications include generating periodic interrupts for time-based tasks, such as scheduling in real-time systems, creating consistent timing pulses for hardware synchronization, and maintaining regular checks or updates in polling algorithms . Such use cases are critical in environments that necessitate predictability and scheduling accuracy, such as embedded systems .
For synchronizing TIMCLK with PCLK in the ARM Dual-Timer module, it is vital that the positive edges of these clocks are synchronous and balanced to maintain system stability and consistent timing . This synchronization is crucial because any mismatch or phase difference between TIMCLK and PCLK could lead to timing errors, affecting timer precision and reliability . The module allows TIMCLK to either match or be a subsidiary frequency of PCLK, providing flexibility while demanding careful alignment during system design to ensure accurate timing operations and prevent potential data corruption or functional anomalies within the timer module .
The clock enable input, TIMCLKENX, is pivotal in controlling the operation of the Free Running Counters (FRCs) within the ARM Dual-Timer module, effectively gating the TIMCLK signal based on the input state . TIMCLKENX allows the FRCs to decrement their counters only when it is high, providing a mechanism to precisely manage timing operations by dictating when the counters should be active . This selective triggering is vital for conserving power and ensuring synchronous operation with other system components, as it allows the counters to be active only during necessary time intervals, particularly in resource-constrained embedded systems .