Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
162
Добавлен:
01.03.2016
Размер:
3.56 Mб
Скачать

16-bit general purpose timers (TIM2, TIM3, TIM5)

RM0016

 

 

18.6.14Counter low (TIMx_CNTRL)

Address offset: 0x0B or 0x0D (TIM2), 0x09 (TIM3), 0x0D (TIM5); for TIM2 address see

Section

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

CNT[7:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 CNT[7:0]: Counter value (LSB)

18.6.15Prescaler register (TIMx_PSCR)

Address offset: 0x0C or 0x0E (TIM2), 0x0A (TIM3), 0x0E (TIM5); for TIM2 address see

Section

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

Reserved

 

 

 

PSC[3:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

 

rw

rw

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bits 7:3

Reserved

 

 

 

 

 

 

 

Bits 2:0

PSC[3:0]: Prescaler value

 

 

 

 

 

 

The prescaler value divides the CK_PSC clock frequency.

The counter clock frequency fCK_CNT is equal to fCK_PSC / 2(PSC[3:0]). PSC[7:4] are forced to 0 by hardware.

PSCR contains the value which is loaded in the active prescaler register at each update event (including when the counter is cleared through the UG bit of the TIMx_EGR register).

This means that a UEV must be generated so that a new prescaler value can be taken into account.

18.6.16Auto-reload register high (TIMx_ARRH)

Address offset: 00x0D or 0x0F (TIM2), 0x0B (TIM3), 0x0F (TIM5); for TIM2 address see

Section

Reset value: 0xFF

7

6

5

4

3

2

1

0

 

 

 

 

ARR[15:8]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 ARR[15:8]: Auto-reload value (MSB)

ARR is the value to be loaded in the actual auto-reload register.

Refer to the Section 17.3: TIM1 time base unit on page 139 for more details about ARR update and behavior.

The counter is blocked while the auto-reload value is 0.

236/454

Doc ID 14587 Rev 9

RM0016

16-bit general purpose timers (TIM2, TIM3, TIM5)

 

 

18.6.17Auto-reload register low (TIMx_ARRL)

Address offset: 00x0E or 0x10 (TIM2), 0x0C (TIM3), 0x10 (TIM5); for TIM2 address see

Section

Reset value: 0xFF

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

ARR[7:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 ARR[7:0]: Auto-reload value (LSB)

18.6.18Capture/compare register 1 high (TIMx_CCR1H)

Address offset: 00x0F or 0x11 (TIM2), 0x0D (TIM3), 0x11 (TIM5); for TIM2 address see

Section

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

CCR1[15:8]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 CCR1[15:8]: Capture/compare 1 value (MSB)

If the CC1 channel is configured as output (CC1S bits in TIMx_CCMR1 register):

The value of CCR1 is loaded permanently into the actual capture/compare 1 register if the preload feature is not enabled (OC1PE bit in TIMx_CCMR1). Otherwise, the preload value is copied in the active capture/compare 1 register when a UEV occurs. The active capture/compare register contains the value which is compared to the counter register, TIMx_CNT, and signalled on the OC1 output.

If the CC1 channel is configured as input (CC1S bits in TIMx_CCMR1 register):

The value of CCR1 is the counter value transferred by the last input capture 1 event (IC1). In this case, these bits are read only.

Doc ID 14587 Rev 9

237/454

16-bit general purpose timers (TIM2, TIM3, TIM5)

RM0016

 

 

18.6.19Capture/compare register 1 low (TIMx_CCR1L)

Address offset: 00x10 or 0x12 (TIM2), 0x0E (TIM3), 0x12 (TIM5); for TIM2 address see

Section

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

CCR1[7:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 CCR1[7:0]: Capture/compare 1 value (LSB)

18.6.20Capture/compare register 2 high (TIMx_CCR2H)

Address offset: 00x11 or 0x13 (TIM2), 0x0F (TIM3), 0x13 (TIM5); for TIM2 address see

Section

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

CCR2[15:8]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 CCR2[15:8]: Capture/compare 2 value (MSB)

If the CC2 channel is configured as output (CC2S bits in TIMx_CCMR2 register):

The value of CCR2 is loaded permanently into the actual capture/compare 2 register if the preload feature is not enabled (OC2PE bit in TIMx_CCMR2). Otherwise, the preload value is copied in the active capture/compare 2 register when a UEV occurs. The active capture/compare register contains the value which is compared to the counter register, TIMx_CNT, and signalled on the OC2 output.

If the CC2 channel is configured as input (CC2S bits in TIMx_CCMR2 register):

The value of CCR2 is the counter value transferred by the last input capture 2 event (IC2).

18.6.21Capture/compare register 2 low (TIMx_CCR2L)

Address offset: 00x12 or 0x14 (TIM2), 0x10 (TIM3), 0x14 (TIM5); for TIM2 address see

Section

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

CCR2[7:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 CCR2[7:0]: Capture/compare value (LSB)

238/454

Doc ID 14587 Rev 9

Соседние файлы в папке Минимум документации STM8_1