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

RM0016

16-bit advanced control timer (TIM1)

 

 

17.7.13Capture/compare enable register 1 (TIM1_CCER1)

Address offset: 0x0C

Reset value: 0x00

7

6

5

4

3

2

1

0

 

 

 

 

 

 

 

 

CC2NP

CC2NE

CC2P

CC2E

CC1NP

CC1NE

CC1P

CC1E

 

 

 

 

 

 

 

 

rw

rw

rw

rw

rw

rw

rw

rw

 

 

 

 

 

 

 

 

Bit 7 CC2NP: Capture/compare 2 complementary output polarity

Refer to CC1NP description.

Bit 6 CC2NE: Capture/compare 2 complementary output enable

Refer to CC1NE description.

Bit 5 CC2P: Capture/compare 2 output polarity

Refer to CC1P description.

Bit 4 CC2E: Capture/compare 2 output enable

Refer to CC1E description.

Bit 3 CC1NP: Capture/compare 1 complementary output polarity

0:OC1N active high

1:OC1N active low

Note: This bit is no longer writable while LOCK level 2 or 3 have been programmed (LOCK bits in TIM1_BKR register) and CC1S = 00 (the channel is configured in output).

On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIM1_CR2 register, the CC1NP active bit takes the new value from the preload bit only when a COM is generated.

Bit 2 CC1NE: Capture/compare 1 complementary output enable

0:Off - OC1N is not active. OC1N level is then a function of the MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.

1:On - OC1N signal is output on the corresponding output pin depending on the MOE, OSSI, OSSR, OIS1, OIS1N and CC1E bits.

Note: On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIM1_CR2 register, the CC1NE active bit takes the new value from the preload bit when a COM is generated.

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 trigger function (see Figure 64):

0:Trigger on a high level or rising edge of TI1F

1:Trigger on a low level or falling edge of TI1F

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

0:Capture on a rising edge of TI1F or TI2F

1:Capture on a falling edge of TI1F or TI2F

Note: This bit is no longer writable while LOCK level 2 or 3 have been programmed (LOCK bits in TIM1_BKR register).

On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIM1_CR2 register, the CC1P active bit takes the new value from the preload bit when a COM is generated.

Doc ID 14587 Rev 9

201/454

16-bit advanced control timer (TIM1)

RM0016

 

 

Bit 0 CC1E: Capture/compare 1 output enable

CC1 channel is configured as output:

0:Off - OC1 is not active. OC1 level is then a function of the MOE, OSSI, OSSR, OIS1, OIS1N and CC1NE bits.

1:On - OC1 signal is output on the corresponding output pin depending on the MOE, OSSI, OSSR, OIS1, OIS1N and CC1NE bits.

CC1 channel is configured as input:

This bit determines if a capture of the counter value can be made in the input capture/compare register 1 (TIM1_CCR1) or not.

0:Capture disabled

1:Capture enabled

Note: On channels that have a complementary output, this bit is preloaded. If the CCPC bit is set in the TIM1_CR2 register, the CC1E active bit takes the new value from the preload bit only when a COM is generated.

Table 38. Output control for complementary OCi and OCiN channels with break feature(1)

 

Control bits

 

 

Output states

 

 

 

 

 

 

 

 

MOE

OSSI

OSSR

 

CCiE

CCiNE

OCi

OCiN

 

 

 

 

 

 

 

 

 

 

0

 

0

0

Output disabled

Output disabled

 

 

 

(not driven by the timer)

(not driven by the timer)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

0

1

Output disabled

OCiREF + polarity OCiN =

 

 

 

(not driven by the timer)

OCiREF xor CCiNP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

1

0

OCiREF + polarity OCi =

Output disabled

 

 

 

OCiREF xor CCiP

(not driven by the timer)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Complementary to OCiREF

 

 

0

 

1

1

OCiREF + polarity + deadtime

(not OCiREF) + polarity +

 

 

 

 

 

 

 

deadtime

 

 

 

 

 

 

 

 

1

x(2)

1

 

0

0

Output disabled

Output disabled

 

 

 

(not driven by the timer)

(not driven by the timer)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Off state

OCiREF + polarity OCiN =

 

 

1

 

0

1

(output enabled with inactive

 

 

 

OCiREF xor CCiNP

 

 

 

 

 

 

state) OCi = CCiP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OCiREF + polarity OCi =

Off state

 

 

1

 

1

0

(output enabled with inactive

 

 

 

OCiREF xor CCiP

 

 

 

 

 

 

state) OCiN = CCiNP

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Complementary to OCiREF

 

 

1

 

1

1

OCiREF + polarity + deadtime

(not OCiREF) + polarity +

 

 

 

 

 

 

 

deadtime

 

 

 

 

 

 

 

 

202/454

Doc ID 14587 Rev 9

RM0016

 

 

 

 

 

16-bit advanced control timer (TIM1)

 

 

 

 

 

 

 

 

Table 38.

Output control for complementary OCi and OCiN channels with break

 

 

feature(1) (continued)

 

 

 

 

 

 

Control bits

 

 

Output states

 

 

 

 

 

 

 

 

 

 

 

MOE

 

OSSI

OSSR

 

CCiE

CCiNE

OCi

 

OCiN

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

Output disabled (not driven by the timer)

 

 

 

 

 

 

 

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

 

0

x(2)

 

x

x

 

 

 

 

 

 

 

 

 

 

1

 

Off state (output enabled with inactive state)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1

 

 

 

 

Asynchronously: OCi = CCiP and OCiN = CCiNP

 

 

 

 

 

 

 

Then if the clock is present: OCi = OISi and OCiN = OISiN after

 

 

1

 

 

 

 

 

 

 

 

 

 

a deadtime, assuming that OISi and OISiN do not correspond

 

 

 

 

 

 

 

with OCi and OCiN in active state

 

 

 

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1.Never set CCiE = CCNiE = 0 when the channel is used. When the channel is not used, program CCiP = CCiNP = OISi = OISiN = 0 otherwise.

2.Don’t care

Note:

The state of the external I/O pins connected to the OCi channels depends on the OCi

 

channel state and the GPIO registers.

Doc ID 14587 Rev 9

203/454

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