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

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

RM0016

 

 

Bits 1:0 CC1S[1:0]: Capture/compare 1 selection

This bitfield defines the direction of the channel (input/output) as well as the used input. 00: CC1 channel is configured as output

01: CC1 channel is configured as input, IC1 is mapped on TI1FP1

10:CC1 channel is configured as input, IC1 is mapped on TI2FP1

11:Reserved

Note: CC1S bits are writable only when the channel is OFF (CC1E = 0 in TIMx_CCER1 and updated).

18.6.9Capture/compare mode register 2 (TIMx_CCMR2)

Note:

Refer to Capture/compare mode register 1 (TIMx_CCMR1) on page 230 for details on using

 

these bits.

 

Address offset: 0x06 or 0x08 (TIM2), 0x06 (TIM3), 0x08 (TIM5 ); for TIM2 address see

 

Section

 

Reset value: 0x00

Channel configured in output

7

6

5

4

3

2

1

0

 

 

OC2M[2:0]

 

OC2PE

 

 

CC2S[1:0]

Reserved

 

 

 

 

Reserved

 

 

 

rw

rw

rw

rw

 

 

rw

 

 

 

 

 

 

 

 

Bit 7 Reserved

Bits 6:4 OC2M[2:0]: Output compare 2 mode

Bit 3 OC2PE: Output compare 2 preload enable

Bit 2 Reserved

Bits 1:0 CC2S[1:0]: Capture/compare 2 selection

This bitfield defines the direction of the channel (input/output) as well as the used input. 00: CC2 channel is configured as output

01: CC2 channel is configured as input, IC2 is mapped on TI2FP2 10: CC2 channel is configured as input, IC2 is mapped on TI1FP2

11:CC2 channel is configured as input, IC2 is mapped on TRC. This mode works only if an internal trigger input is selected through the TS bit (TIM5_SMCR register).

Note: CC2S bits are writable only when the channel is off (CC2E = 0 in TIMx_CCER1).

232/454

Doc ID 14587 Rev 9

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

Channel configured in input

7

6

5

 

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

IC2F[3:0]

 

 

IC2PSC[1:0]

 

CC2S[1:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

 

rw

 

rw

rw

 

rw

rw

 

rw

 

 

 

 

 

 

 

 

 

 

 

Bits 7:4 IC2F[3:0]: Input capture 2 filter

 

 

 

 

 

 

 

Bits 3:2

IC2PCS[1:0]: Input capture 2 prescaler

 

 

 

 

 

 

Bits 1:0 CC2S[1:0]: Capture/compare 2 selection

This bitfield defines the direction of the channel (input/output) as well as the used input. 00: CC2 channel is configured as output

01: CC2 channel is configured as input, IC2 is mapped on TI2FP2

10:CC2 channel is configured as input, IC2 is mapped on TI1FP2

11:Reserved

Note: CC2S bits are writable only when the channel is off (CC2E = 0 in TIMx_CCER1).

18.6.10Capture/compare mode register 3 (TIMx_CCMR3)

Refer to Capture/compare mode register 1 (TIM1_CCMR1) on page 195 for details on using these bits.

Address offset: 0x07 or 0x09 (TIM2), 0x09 (TIM5); for TIM2 address see Section

Reset value: 0x00

Channel configured in output

7

6

5

4

3

2

1

0

 

 

OC3M[2:0]

 

OC3PE

 

 

CC3S[1:0]

Reserved

 

 

 

 

Reserved

 

 

 

 

rw

rw

rw

rw

 

rw

 

rw

 

 

 

 

 

 

 

 

 

Note:

This register is not available in TIM3.

 

 

 

 

 

Bit 7 Reserved

Bits 6:4 OC3M[2:0]: Output compare 3 mode

Bit 3 OC3PE: Output compare 3 preload enable

Bit 2 Reserved

Bits 1:0 CC3S[1:0]: Capture/compare 3 selection

This bitfield defines the direction of the channel (input/output) as well as the used input. 00: CC3 channel is configured as output

01: CC3 channel is configured as input, IC3 is mapped on TI3FP3

10:Reserved

11:Reserved

Note: CC3S bits are writable only when the channel is off (CC3E = 0 in TIMx_CCER2).

Doc ID 14587 Rev 9

233/454

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

RM0016

 

 

Channel configured in input

7

6

5

 

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IC3F[3:0]

 

 

IC3PSC[1:0]

 

CC3S[1:0]

 

 

 

 

 

 

 

 

 

 

 

 

rw

rw

 

rw

 

rw

rw

 

rw

rw

 

rw

 

 

 

 

 

 

 

 

 

 

Note:

This register is not available in TIM3.

 

 

 

 

 

 

Bits 7:4

IC3F[3:0] Input capture 3 filter

 

 

 

 

 

 

 

Bits 3:2

IC3PSC(1:0]: Input capture 3 prescaler

 

 

 

 

 

 

Bits 1:0 CC3S[1:0]: Capture/compare 3 selection

This bitfield defines the direction of the channel (input/output) as well as the used input. 00: CC3 channel is configured as output

01: CC3 channel is configured as input, IC3 is mapped on TI3FP3

10:Reserved

11:Reserved

Note: CC3S bits are writable only when the channel is off (CC3E = 0 in TIMx_CCER2).

18.6.11Capture/compare enable register 1 (TIMx_CCER1)

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

Section

Reset value: 0x00

7

6

5

4

3

2

1

0

 

Reserved

CC2P

CC2E

 

Reserved

CC1P

CC1E

 

 

 

 

 

 

 

rw

rw

 

rw

rw

 

 

 

 

 

 

 

 

 

 

 

 

Bits 6:7 Reserved

Bit 5 CC2P: Capture/compare 2 output polarity

Refer to CC1P description

Bit 4 CC2E: Capture/compare 2 output enable

Refer to CC1E description.

Bits 2:3 Reserved

Bit 1 CC1P: Capture/compare 1 output polarity

CC1 channel configured as output:

0:OC1 active high

1:OC1 active low

CC1 channel configured as input for capture function (see Figure 64):

0:Capture is done on a rising edge of TI1F or TI2F

1:Capture is done on a falling edge of TI1F or TI2F

234/454

Doc ID 14587 Rev 9

RM0016

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

 

 

Bit 0 CC1E: Capture/Compare 1 output Enable.

CC1 channel configured as output:

0:Off - OC1 is not active.

1:On - OC1 signal is output on the corresponding output pin.

CC1 channel configured as input:

In this case, this bit determines if a capture of the counter value can be made in the input capture/compare register 1 (TIMx_CCR1) or not.

0:Capture disabled

1:Capture enabled

18.6.12Capture/compare enable register 2 (TIMx_CCER2)

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

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CC3P

CC3E

 

 

Reserved

 

 

 

 

 

 

 

 

 

 

rw

rw

 

 

 

 

 

 

 

 

 

 

 

 

Note:

This register is not available in TIM3.

 

 

 

 

Bits 7:2

Reserved

 

 

 

 

 

 

Bit 1

CC3P: Capture/compare 3 output polarity

 

 

 

 

 

Refer to CC1P description.

 

 

 

 

 

Bit 0

CC3E: Capture/compare 3 output enable

 

 

 

 

 

Refer to CC1E description.

 

 

 

 

 

18.6.13Counter high (TIMx_CNTRH)

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

Section

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)

Doc ID 14587 Rev 9

235/454

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