データシートサーチシステム
  Japanese  ▼
ALLDATASHEET.JP

X  

STM8S データシート(PDF) 147 Page - STMicroelectronics

部品番号 STM8S
部品情報  STM8S Series and STM8AF Series 8-bit microcontrollers
PDF  467 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
メーカー  STMICROELECTRONICS [STMicroelectronics]
ホームページ  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

STM8S データシート(HTML) 147 Page - STMicroelectronics

Back Button STM8S Datasheet HTML 143Page - STMicroelectronics STM8S Datasheet HTML 144Page - STMicroelectronics STM8S Datasheet HTML 145Page - STMicroelectronics STM8S Datasheet HTML 146Page - STMicroelectronics STM8S Datasheet HTML 147Page - STMicroelectronics STM8S Datasheet HTML 148Page - STMicroelectronics STM8S Datasheet HTML 149Page - STMicroelectronics STM8S Datasheet HTML 150Page - STMicroelectronics STM8S Datasheet HTML 151Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 147 / 467 page
background image
DocID14587 Rev 14
147/467
RM0016
16-bit advanced control timer (TIM1)
261
17.3.6
Center-aligned mode (up/down counting)
In center-aligned mode, the counter counts from 0 to the auto-reload value of -1 (content of
the TIM1_ARR register). This generates a counter overflow event. The counter then counts
down to 0 and generates a counter underflow event. After this, the counter restarts counting
from 0.
In this mode, the direction bit (DIR) in the TIM1_CR1 register cannot be written. It is updated
by hardware and gives the current direction of the counter.
The Figure 40 shows an example of this counting mode.
Figure 40. Counter in center-aligned mode
If the timer has a repetition counter (as in TIM1), the UEV is generated after up and down
counting and repeated for the number of times programmed in the repetition counter
register (TIM1_RCR). Otherwise, the UEV is generated at each counter overflow and at
each counter underflow.
Setting the UG bit in the TIM1_EGR register (by software or by using the clock/trigger mode
controller) also generates an update event. In this case, the counter and the prescaler
restart counting from 0.
The UEV can be disabled by software by setting the UDIS bit in the TIM1_CR1 register. This
is to avoid updating the shadow registers while writing new values in the preload registers.
In this way, no update event occurs until the UDIS bit is written to 0. However, the counter
continues counting up and down, based on the current auto-reload value. In timers with a
repetition counter, the new update rate is used because the repetition register is not double
buffered. For this reason, care must be taken when changing the update rate.
In addition, if the URS bit in the TIM1_CR1 register is set, setting the UG bit generates a
UEV without setting the UIF flag. Consequently, no interrupt request is sent. This avoids
generating both update and capture interrupts when clearing the counter on the capture
event.
When an update event occurs, all registers are updated and the update flag (the UIF bit in
the TIM1_SR1 register) is set (depending on the URS bit).
The buffer of the prescaler is reloaded with the preload value (content of the
TIM1_PSCR register).
The auto-reload shadow register is updated with the preload value (content of the
TIM1_ARR register). Note that if the update source is a counter overflow, the auto-
reload is updated before the counter is reloaded, so that the next period is the expected
one (the counter is loaded with the new value).
Below are some examples of the counter behavior for different clock frequencies.
MSv45279V1
Counter
TIMx_ARR
0
Overflow
Underflow
Overflow
Underflow
Time



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


データシート ダウンロード

Go To PDF Page


リンク URL



ALLDATASHEETはお客様のビジネスに役立ちますか?  [ DONATE ] 

Alldatasheetは   |   広告   |   お問い合わせ   |   プライバシーポリシー   |   データシートへのリンク    |   リンク交換   |   メーカーリスト
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