| 数据搜索系统,热门电子元器件搜索 |
|
PC87570-ICC/VUL 数据表(PDF) 112 Page - National Semiconductor (TI) |
|
|
|
|||||||||||||||||||||||||||||
PC87570-ICC/VUL 数据表(HTML) 112 Page - National Semiconductor (TI) |
|
112 / 168 page ![]() Multi-Function 16-Bit Timer (MFT16) 112 www.national.com Mode 4, Input Capture and Timer It is also possible to operate in a mode which offers a com- bination of a single timer with automatic reload and a single capture timer. In this mode TCNT1 operates as a PWM-tim- er which is reloaded from TCRA on underflow while TCNT2 forms the time base of the capture timer. The value on TCNT2 is transferred to TCRB on detection of a valid event on TB. It is possible to toggle TA on every underflow of TCNT1 and thus generate a 50% duty cycle PWM signal on TA. This mode is a combination of mode 3 and mode 2, and al- lows you to operate the timer/counter 2 as a single input capture timer, while timer/counter 1 can be used as a sys- tem timer as described above. Figure 14-7 shows a block diagram of the timer in mode 4. TCNT1 starts counting down once a clock has been en- abled. On underflow TCNT1 is reloaded from the TCRA reg- ister, and counting proceeds downwards from that value. If enabled the TA pin toggles on every underflow of TCNT1. Software can select the initial value of the TA output signal as either high or low. See “Timer I/O Functions” on page 113 for additional details. In addition, the TAPND interrupt pending flag is set, and a timer interrupt 1 is generated, if the TAIEN bit is set to 1. (See Section “Timer Interrupts” on page 113 for detailed information). Since TA toggles on ev- ery underflow a 50% duty cycle PWM signal can be gener- ated on TA without requiring any interaction of the user software and thus the CPU. TCNT2 starts counting down once a clock has been en- abled. When a transition is received on TB the value con- tained in TCNT2 is transferred to TCRB, and the interrupt pending flag TBPND is set. A timer interrupt 2 is generated, if it is enabled. You can enable a preset of the counter to FFFFh on detection of a transition on TB. In this case the current value of TCNT2 is transferred to TCRB, followed by a preset of the counter to FFFFh. TCNT2 starts counting downwards from FFFFh, until the next transition is received on TB, which causes the procedure of capture and preset to be repeated. Underflow of TCNT2 sets the TDPND interrupt pending flag, and can also generate a timer interrupt II, if enabled. (See Section “Timer Interrupts” for detailed infor- mation.) The input signal on TB must have a pulse width equal to, or greater than, one system clock cycle. (See the AC Electrical Specs in Chapter 3 for additional details.) TB can be configured to sense either positive-going or nega- tive-going transitions. Note that TCNT2 can not operate in the “Pulse Accumulate” or “External Event Counter” modes of operations since the TB input is used as a capture input. Selecting either “Pulse Accumulate” mode or “External Event Counter” mode for TCNT2 causes TCNT2 to stop. However, all available clock source modes may be selected for TCNT1. Thus it is possible to determine the number of capture events on TB or the elapsed time between capture events on TB by using TCNT1. Reload A Timer/Counter 1 Capture B Timer 1 Clock TA TAIEN TAPND TCNT1 TCRA TCRB Timer Interrupt 1 TATEN Timer/Counter 2 TCNT2 Timer 2 Clock Underflow TDIEN TDPND Timer Interrupt 2 TBIEN TBPND Timer Interrupt 1 TB TBEN Preset Figure 14-7. Mode 4, Input Capture and Timer |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| 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 |