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

RM0016

16-bit advanced control timer (TIM1)

 

 

17.2TIM1 main features

TIM1 features include:

16-bit up, down, up/down counter auto-reload counter

Repetition counter to update the timer registers only after a given number of cycles of the counter.

16-bit programmable prescaler allowing the counter clock frequency to be divided “on the fly” by any factor between 1 and 65536.

Synchronization circuit to control the timer with external signals and to interconnect several timers (timer interconnection not implemented in some devices).

4 independent channels that can alternately be configured as:

Input capture

Output compare

PWM generation (edge and center-aligned mode)

6-step PWM generation

One-pulse mode output

Complementary outputs on three channels with programmable deadtime insertion.

Break input to put the timer output signals in reset state or in a known state.

External trigger input pin (ETR)

Interrupt generation on the following events:

Update: Counter overflow/underflow, counter initialization (by software or internal/external trigger)

Trigger event (counter start, stop, initialization or count by internal/external trigger)

Input capture

Output compare

Break input

Doc ID 14587 Rev 9

137/454

16-bit advanced control timer (TIM1)

 

 

 

 

 

RM0016

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Figure 31. TIM1 general block diagram

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

fMASTER/DIV

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TRGO to TIM5/TIM6 or to ADC

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TIM1_ETR

 

 

 

 

 

ETR

 

 

 

 

CLOCK/TRIGGER CONTROLLER

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ITR

 

 

 

 

 

 

 

 

 

 

TRGO from other TIM timers

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TRC

 

 

 

 

 

 

 

 

 

 

 

 

 

Clock/reset/enable

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

TIME BASE UNIT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Repetition

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

counter

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CK_CNT

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CK_PSC

Prescaler

UP-DOWN COUNTER

 

Auto-reload register

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

CAPTURE COMPARE ARRAY

 

 

 

 

 

 

CC1I

 

 

 

 

TIM1_CH1

TI1

IC1

UEV

 

 

 

 

IC1PS

Capture/Compare 1 Register

OC1REF

OC1

 

 

 

 

Prescaler

 

TIM1_CH1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

OC1N

TIM1_CH1N

 

 

 

CC2I

 

 

 

TIM1_CH2

TI2

IC2

IC2PS UEV

 

OC2REF

OC2

 

 

 

 

Prescaler

Capture/Compare 2 Register

OUTPUT

TIM1_CH2

 

 

 

 

 

INPUT

 

 

 

 

 

 

 

 

STAGE

OC2N

TIM1_CH2N

 

STAGE

 

CC3I

 

 

 

 

TIM1_CH3

TI3

IC3

IC3PS UEV

 

OC3REF

OC3

TIM1_CH3

 

 

 

Prescaler

Capture/Compare 3 Register

 

 

 

 

 

 

 

 

OC3N

TIM1_CH3N

 

 

 

CC4I

 

 

 

 

 

 

 

 

 

 

TIM1_CH4

TI4

IC4

IC4PS UEV

OC4REF

OC4

 

 

Prescaler

Capture/Compare 4 Register

 

TIM1_CH4

TIM1_BKIN

Legend:

Preload registers transferred Reg to shadow registers on update

event (UEV) according to control bit

event

interrupt

138/454

Doc ID 14587 Rev 9

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