beautypg.com

Address assignment of timer registers, Timer register description, Timer 0/1 interrupts – Siemens ERTEC200 User Manual

Page 40: Timer 0/1 prescaler, Cascading of timers 0/1, Timer 2, Ctrl_stat0

background image

4.3.3

Address Assignment of Timer Registers


The timer registers are 32 bits in width. For read/write access of the timer registers to be meaningful, a 32-bit access is
required. However, a byte-by-byte write operation is not intercepted by the hardware.

Timer

(Base Address 0x4000_2000)

Register Name Offset Address Address Area

Access

Default

Description

CTRL_STAT0

0x0000

4 bytes

R/W

0x00000000

Control/status register timer 0

CTRL_STAT1

0x0004

4 bytes

R/W

0x00000000

Control/status register timer 1

RELD0

0x0008

4 bytes

R/W

0x00000000

Reload register timer 0

RELD1

0x000C

4 bytes

R/W

0x00000000

Reload register timer 1

CTRL_PREDIV

0x0010

4 bytes

R/W

0x00000000 Control register for both prescalers

RELD_PREDIV

0x0014

4 bytes

R/W

0x00000000 Reload register for both prescalers

TIM0

0x0018

4 bytes

R

0x00000000

Timer 0 value register

TIM1

0x001C

4 bytes

R

0x00000000

Timer 1 value register

TIM2_CTRL

0x0020

4 bytes

R/W

0x00000000

Timer 2-Control Register

TIM2

0x0024

4 bytes

R

0x00000000

Timer 2 count value register

Table 10: Overview of Timer Registers

4.3.4

Timer Register Description

CTRL_STAT0

R/W

Addr.: 0x4000_2000 Default: 0x0000_0000

Description

Control/status register 0. Configuration and control bits for Timer No. 0 .

Bit No.

Name

Description

0 Run/xStop

*)

Stop/start of timer:
0: Timer is stopped
1: Timer is running
Note: If this bit = 0, the timer interrupt is inactive (0) and the status bit (Bit 5)
is reset (0).

1 Load

Trigger=Load the timer with the reload register value:
0: Not relevant
1: Timer is loaded with the value of the reload register
(irrespective of Bit 0=Run/xStop)
While this bit can be read back, it only has an effect at the instant of writing.
Writing a value of 1 to this bit is sufficient to trigger the timer; a 0/1 edge is
not needed.

2

Reload mode *)

Reload mode (continuous mode) of the timer:
0: Timer stops at value 00000000h
1: Timer is loaded with the reload register value when the timer value is
00000000h
and the timer continues running
Important note: If timers 0 and 1 are cascaded, the Reload mode setting of
Timer 0 is irrelevant.

3 Reserved

Not relevant (can be read/write-accessed)

4 Reserved

Not relevant (read=0)

5 Status

Timer status (writing is ignored)
0: Timer has not expired
1: Timer has expired (count is 0 and Run/xStop=Bit 0=1)
Note: This bit can only be read as 1 if Run/xStop (Bit 0) is active (1).

31-6 Reserved

Not relevant (read=0)


Important note: The bits designated with *) are not applicable if the timers are cascaded! See CTRL_STAT1




Copyright © Siemens AG 2007. All rights reserved.

40

ERTEC 200 Manual

Technical data subject to change Version 1.1.0