Motor de Búsqueda de Datasheet de Componentes Electrónicos
  Mexican  ▼
ALLDATASHEET.COM.MX

X  

RM0312 Datasheet(PDF) 130 Page - STMicroelectronics

No. de pieza RM0312
Descripción Electrónicos  STM8TL5xxx microcontroller family
PDF  275 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Fabricante Electrónico  STMICROELECTRONICS [STMicroelectronics]
Página de inicio  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

RM0312 Datasheet(HTML) 130 Page - STMicroelectronics

Back Button RM0312 Datasheet HTML 126Page - STMicroelectronics RM0312 Datasheet HTML 127Page - STMicroelectronics RM0312 Datasheet HTML 128Page - STMicroelectronics RM0312 Datasheet HTML 129Page - STMicroelectronics RM0312 Datasheet HTML 130Page - STMicroelectronics RM0312 Datasheet HTML 131Page - STMicroelectronics RM0312 Datasheet HTML 132Page - STMicroelectronics RM0312 Datasheet HTML 133Page - STMicroelectronics RM0312 Datasheet HTML 134Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 130 / 275 page
background image
16-bit general purpose timer (TIM2/TIM3)
RM0312
130/275
DocID022352 Rev 3
Figure 51. Input stage of TIM 1 channel 1
17.5.3
Input capture mode
In Input capture mode, the Capture/Compare Registers (TIMx_CCRi) are used to latch the
value of the counter after a transition detected on the corresponding ICi signal. When a
capture occurs, the corresponding CCiIF flag (TIMx_SR1 register) is set.
An interrupt can be sent if it is enabled by setting the CCiIE bit in the TIMx_IER register. If a
capture occurs while the CCiIF flag was already high, then the over-capture flag CCiOF
(TIMx_SR2 register) is set. CCiIF can be cleared by software by writing it to ‘0’ or by reading
the captured data stored in the TIMx_CCRiL register. CCiOF is cleared when you write it to
‘0’.
The following example shows how to capture the counter value in TIMx_CCR1 when TI1
input rises. To do this, use the following procedure:
1.
Select the active input: For example, to link the TIMx_CCR1 register to the TI1 input,
write the CC1S bits to 0b01 in the TIMx_CCMR1 register. This configures the channel
in input mode and the TIMx_CCR1 register becomes read-only.
2.
Program the input filter duration that is needed for the type of the signal to be
conntected to the timer. This is done for each TIi input using the ICiF bits in the
TIMx_CCMRi register. For example, if you know that when, the input signal toggles, it
is unstable for up to 5 fMASTER cycles, you must program the filter duration longer than
5 clock cycles. The filter bits allow you to select a duration of 8 cycles by writing the
value 0b0011 in in these bits the TIMx_CCMR1 register. With this filter setting, a
transition on TI1 is valid only when 8 consecutive samples with the new level have
been detected (sampled at fMASTER frequency).
3.
Select the edge of the active transition on the TI1 channel by writing CC1P bit to ‘0’ in
the TIMx_CCER1 register (rising edge in this case).
4.
Program the input prescaler. In our example, we want the capture to be performed at
each valid transition, so the prescaler is disabled (write IC1PS bits to 0b00 in the
TIMx_CCMR1 register).
5.
Enable capture from the counter into the capture register by setting the CC1E bit in the
TIMx_CCER1 register.
6.
If needed, enable the related interrupt request by setting the CC1IE bit in the TIMx_IER
register.
TI1
0
1
TIMx_CCER1
CC1P
divider
/1, /2, /4, /8
ICPS[1:0]
TI1F_ED
filter
ICF[3:0]
down-counter
TIMx_CCMR1
Edge
Detector
TI1F_rising
TI1F_falling
to clock/trigger controller
TI1FP1
11
01
TIMx_CCMR1
CC1S[1:0]
IC1
TI2FP1
TRC
(from channel 2)
(from clock/trigger
controller)
10
fMASTER
TIMx_CCER1
CC1E
ICPS
TI1F
0
1
TI2F_rising
TI2F_falling
(from channel 2)



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Descarga

Go To PDF Page


Enlace URL



¿ALLDATASHEET es útil para Ud.?  [ DONATE ] 

Todo acerca de Alldatasheet   |   Publicidad   |   Contáctenos   |   Política de Privacidad   |   Enlace a la hoja de datos    |   Intercambio de Enlaces   |   Lista de Fabricantes
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com