Registers

The abbreviations given in Column Access are explained in Section Access Types for Registers .

RTL8721Dx:

Base Address: 0x41100200

Name

Address offset

Access

Description

REG_TIM_EN

000h

varies

Users can configure and observe the counter operation.

REG_TIM_CR

004h

varies

This register is about the update operation.

REG_TIM_DIER

008h

varies

REG_TIM_SR

00Ch

varies

REG_TIM_EGR

010h

varies

This register is about the update operation, and is user-defined.

REG_TIM_CNT

014h

varies

This is timer count register.

REG_TIM_PSC

018h

varies

This is prescaler value register.

REG_TIM_ARR

01Ch

varies

This is auto-reload value register.

REG_TIM_CCR0

024h

varies

This is the register about input capture configuration and the data of capture.

REG_TIM_PULSE_DBC

028h

varies

REG_TIM_PULSE_DUMMY

02Ch

R/W

REG_TIM_EN

  • Name: TIM enable register

  • Size: 32

  • Address offset: 000h

  • Read/write access: varies

Users can configure and observe the counter operation.

31:17 RSVD 16 CNT_EN 15:9 RSVD 8 CEN 7:2 RSVD 1 CNT_STOP 0 CNT_START

Bit

Symbol

Access

INI

Description

31:17

RSVD

-

Reserved

16

CNT_EN

R

0x0

Counter working status

  • 0: Counter is stopped

  • 1: Counter is working

15:9

RSVD

-

Reserved

8

CEN

R

0x0

Counter run status

  • 0: Counter is disabled

  • 1: Counter is enabled

7:2

RSVD

-

Reserved

1

CNT_STOP

WA0

0x0

Disable the counter

Poll CNT_RUN to see the counter status. If CNT_RUN is 0, it means that the counter has been disabled internally.

0

CNT_START

WA0

0x0

Enable the counter

Poll CNT_RUN to see the counter status. If CNT_RUN is 1, it means that the counter has been enabled internally.

REG_TIM_CR

  • Name: TIM control register

  • Size: 32

  • Address offset: 004h

  • Read/write access: varies

This register is about the update operation.

31:5 RSVD 4 ARPE 3 RSVD 2 URS 1 UDIS 0 RSVD

Bit

Symbol

Access

INI

Description

31:5

RSVD

-

Reserved

4

ARPE

R/W

0x0

Enable auto-reload preloading

  • 0: TIM_ARR register is not buffered

  • 1: TIM_ARR register is buffered

3

RSVD

-

Reserved

2

URS

R/W

0x0

Update request source

  • 0: Counter overflow and setting the UG bit

  • 1: Counter overflow

1

UDIS

R/W

0x0

Disable UEV

Shadow registers keep their values. Otherwise, buffered registers are then loaded with their preload values when UEV happens.

0

RSVD

-

Reserved

REG_TIM_DIER

  • Name: TIM interrupt enable register

  • Size: 32

  • Address offset: 008h

  • Read/write access: varies

31:2 RSVD 1 CC0IE 0 UIE

Bit

Symbol

Access

INI

Description

31:2

RSVD

-

Reserved

1

CC0IE

R/W

0x0

Enable Capture/Compare 0 interrupt

0

UIE

R/W

0x0

Enable update interrupt

REG_TIM_SR

  • Name: TIM status register

  • Size: 32

  • Address offset: 00Ch

  • Read/write access: varies

31 UG_DONE 30:2 RSVD 1 CC0IF 0 UIF

Bit

Symbol

Access

INI

Description

31

UG_DONE

R

0x1

UG operation status

This bit is cleared by hardware when the UG bit in the TIMx_EGR register is set. When the UG operation is done, hardware set this bit to ‘1’. So, software can poll this bit to see the UG operation status.

30:2

RSVD

-

Reserved

1

CC0IF

RW1C

0x0

Capture/Compare 0 interrupt flag

CC0 channel configured as pulse mode 0: This bit is set when TRGI is transferred to inactive level from active level.

CC0 channel configured as pulse mode 1: This bit is set by hardware when the counter overflows. It is cleared by software.

0

UIF

RW1C

0x0

Update interrupt flag

REG_TIM_EGR

  • Name: TIM event generation register

  • Size: 32

  • Address offset: 010h

  • Read/write access: varies

This register is about the update operation, and is user-defined.

31:2 RSVD 1 CC0G 0 UG

Bit

Symbol

Access

INI

Description

31:2

RSVD

-

Reserved

1

CC0G

WA0

0x0

Capture/Compare 0 generation

This bit is set by software and is automatically cleared by hardware. A Capture/Compare event is generated on channel 0: the current value of the counter is captured in TIM_CCR0 register. The CC0IF flag is set, the corresponding interrupt or request is sent if enabled.

0

UG

WA0

0x0

Update generation

Re-initialize the counter and generate an update of registers. Note that the prescaler counter is cleared too. (anyway the prescaler ratio is not affected)

REG_TIM_CNT

  • Name: TIM counter

  • Size: 32

  • Address offset: 014h

  • Read/write access: varies

This is timer count register.

31:16 RSVD 15:0 CNT

Bit

Symbol

Access

INI

Description

31:16

RSVD

-

Reserved

15:0

CNT

R

0x0

Counter value

REG_TIM_PSC

  • Name: TIM prescaler register

  • Size: 32

  • Address offset: 018h

  • Read/write access: varies

This is prescaler value register.

31:16 RSVD 15:0 PSC

Bit

Symbol

Access

INI

Description

31:16

RSVD

-

Reserved

15:0

PSC

R/W

0x0

Prescaler value

PSC contains the value to be loaded in the actual prescaler register at each UEV (including when the counter is cleared through UG bit of TIM_EGR register).

REG_TIM_ARR

  • Name: TIM auto-reload register

  • Size: 32

  • Address offset: 01Ch

  • Read/write access: varies

This is auto-reload value register.

31:16 RSVD 15:0 ARR

Bit

Symbol

Access

INI

Description

31:16

RSVD

-

Reserved

15:0

ARR

R/W

0xFFFF

The value to be loaded in the actual auto-reload register. It can be preloaded by setting ARPE bit in TIM_CR.

REG_TIM_CCR0

  • Name: TIM Capture register

  • Size: 32

  • Address offset: 024h

  • Read/write access: varies

This is the register about input capture configuration and the data of capture.

31:29 RSVD 28 CC0PM 27 RSVD 26 CC0P 25 RSVD 24 CC0E 23:16 RSVD 15:0 CCR0

Bit

Symbol

Access

INI

Description

31:29

RSVD

-

Reserved

28

CC0PM

R/W

0x0

CC0 pulse mode

  • 0: Pulse mode 0

  • 1: Pulse mode 1

27

RSVD

-

Reserved

26

CC0P

R/W

0x0

CC0 channel configured as output:

  • 0: OC0 active high

  • 1: OC0 active low

CC0 channel configured as input:

  • 0: Positive edge of TRGI is active for capture

  • 1: Negative edge of TRGI is active for capture

25

RSVD

-

Reserved

24

CC0E

R/W

0x0

Enable CC0

23:16

RSVD

-

Reserved

15:0

CCR0

R/W/ES

0x0

Capture/Compare 0 value

CC0 channel configured as pulse mode 0: the pulse width of TRGI

CC0 channel configured as pulse mode 1: the pulse number of TRGI when the counter counts from 0 to ARR

REG_TIM_PULSE_DBC

  • Name: Timer Pulse DBC Register

  • Size: 32

  • Address offset: 028h

  • Read/write access: varies

31:16 RSVD 15:1 R_DBC_CYC 0 R_DBC_FEN

Bit

Symbol

Access

INI

Description

31:16

RSVD

-

Reserved

15:1

R_DBC_CYC

R/W

0x0

DBC cycle

0

R_DBC_FEN

R/W

0x0

Enable debounce for pulse

  • 0: Disable

  • 1: Enable

REG_TIM_PULSE_DUMMY

  • Name: Timer Pulse Dummy Register

  • Size: 32

  • Address offset: 02Ch

  • Read/write access: R/W

31:0 DUMMY

Bit

Symbol

Access

INI

Description

31:0

DUMMY

R/W

ffffh

Dummy register