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

16-bit advanced control timer (TIM1)

RM0016

 

 

17.7.14Capture/compare enable register 2 (TIM1_CCER2)

Address offset: 0x0D

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

Reserved

CC4P

CC4E

CC3NP

CC3NE

CC3P

CC3E

 

 

 

 

 

 

 

 

rw

rw

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

 

Bits 7:6 Reserved

Bit 5 CC4P: Capture/compare 4 output polarity

Refer to CC1P description.

Bit 4 CC4E: Capture/compare 4 output enable

Refer to CC1E description.

Bit 3 CC3NP: Capture/compare 3 complementary output polarity

Refer to CC1NP description.

Bit 2 CC3NE: Capture/compare 3 complementary output enable

Refer to CC1NE description.

Bit 1 CC3P: Capture/compare 3 output polarity

Refer to CC1P description.

Bit 0 CC3E: Capture/compare 3 output enable

Refer to CC1E description.

17.7.15Counter high (TIM1_CNTRH)

Address offset: 0x0E

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

CNT[15:8]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 CNT[15:8]: Counter value (MSB)

204/454

Doc ID 14587 Rev 9

RM0016

16-bit advanced control timer (TIM1)

 

 

17.7.16Counter low (TIM1_CNTRL)

Address offset: 0x0F

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).

17.7.17Prescaler high (TIM1_PSCRH)

Address offset: 0x10

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

PSC[15:8]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

PSC[15:8]: Prescaler value (MSB)

The prescaler value divides the CK_PSC clock frequency. The counter clock frequency fCK_CNT is Bits 7:0 equal to fCK_PSC / (PSCR[15:0]+1). PSCR contain the value which is loaded in the active prescaler

register at each UEV (including when the counter is cleared through the UG bit of the TIM1_EGR register or through the trigger controller when configured in trigger reset mode). A UEV must be generated so that a new prescaler value can be taken into account.

17.7.18Prescaler low (TIM1_PSCRL)

Address offset: 0x11

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

PSC[7:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 PSC[7:0]: Prescaler value (LSB)

The prescaler value divides the CK_PSC clock frequency. The counter clock frequency fCK_CNT is equal to fCK_PSC / (PSCR[15:0]+1). PSCR contains the value which is loaded in the active prescaler register at each UEV (including when the counter is cleared through the UG bit of the TIM1_EGR register or through the trigger controller when configured in trigger reset mode).

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

Doc ID 14587 Rev 9

205/454

16-bit advanced control timer (TIM1)

RM0016

 

 

17.7.19Auto-reload register high (TIM1_ARRH)

Address offset: 0x12

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 null.

17.7.20Auto-reload register low (TIM1_ARRL)

Address offset: 0x13

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).

17.7.21Repetition counter register (TIM1_RCR)

Address offset: 0x14

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

REP[7:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

rw

rw

 

rw

rw

rw

rw

 

 

 

 

 

 

 

 

 

Bits 7:0 REP[7:0]: Repetition counter value.

When the preload registers are enabled, these bits allow the user to set up the update rate of the compare registers (periodic transfers from preload to shadow registers) as well as the update interrupt generation rate if the update interrupt is enabled (UIE=1).

Each time the REP_CNT related down-counter reaches zero, a UEV is generated and it restarts counting from the REP value. As REP_CNT is reloaded with the REP value only at the repetition update event U_RC, any write to the TIM1_RCR register is not taken into account until the next repetition update event.

In PWM mode (REP+1) corresponds to:

The number of PWM periods in edge-aligned mode

The number of half PWM periods in center-aligned mode

206/454

Doc ID 14587 Rev 9

RM0016

16-bit advanced control timer (TIM1)

 

 

17.7.22Capture/compare register 1 high (TIM1_CCR1H)

Address offset: 0x15

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 TIM1_CCMR1 register):

The value of CCR1 is loaded permanently into the actual capture/compare 1 register if the preload feature is 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 TIM1_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.

17.7.23Capture/compare register 1 low (TIM1_CCR1L)

Address offset: 0x16

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)

Doc ID 14587 Rev 9

207/454

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