| 数据搜索系统,热门电子元器件搜索 |
|
AM186ED-20KC/W 数据表(PDF) 45 Page - Advanced Micro Devices |
|
|
|||||||||||||||||||||||||||||
AM186ED-20KC/W 数据表(HTML) 45 Page - Advanced Micro Devices |
|
45 / 88 page ![]() Am186ED/EDLV Microcontrollers 45 PRELI M INARY D RA F T TIMER CONTROL UNIT There are three 16-bit programmable timers and a watchdog timer on the Am186ED/EDLV microcontrol- lers. Timer 0 and timer 1 are connected to four external pins (each one has an input and an output). These two tim- ers can be used to count or time external events, or to generate nonrepetitive or variable-duty-cycle wave- forms. When pulse width demodulation is enabled, timer 0 and timer 1 are used to measure the width of the High and Low pulses on the PWD pin. (See the Pulse Width Demodulation section on page 45.) Timer 2 is not connected to any external pins. It can be used for real-time coding and time-delay applications. It can also be used as a prescaler to timers 0 and 1 or to synchronize DMA transfers. The programmable timers are controlled by eleven 16- bit registers in the peripheral control block. A timer’s timer-count register contains the current value of that timer. The timer-count register can be read or written with a value at any time, whether the timer is running or not. The microcontroller increments the value of the timer-count register each time a timer event occurs. Each timer also has a maximum-count register that de- fines the maximum value the timer can reach. When the timer reaches the maximum value, it resets to 0 during the same clock cycle. The value in the maxi- mum-count register is never stored in the timer-count register. Also, timers 0 and 1 have a secondary maxi- mum-count register. Using both the primary and sec- ondary maximum-count registers lets the timer alternate between two maximum values. If the timer is programmed to use only the primary max- imum-count register, the timer output pin switches Low for one clock cycle after the maximum value is reached. If the timer is programmed to use both of its maximum-count registers, the output pin indicates which maximum-count register is currently in control, thereby creating a waveform. The duty cycle of the waveform depends on the values in the maximum- count registers. Each timer is serviced every fourth clock cycle, so a timer can operate at a speed of up to one-quarter of the internal clock frequency. A timer can be clocked exter- nally at this same frequency; however, because of in- ternal synchronization and pipelining of the timer circuitry, the timer output can take up to six clock cycles to respond to the clock or gate input. Watchdog Timer The Am186ED/EDLV microcontrollers provide a true watchdog timer function. The Watchdog Timer (WDT) can be used to regain control of the system when soft- ware fails to respond as expected. The WDT is active after reset. It can only be modified a single time by a keyed sequence of writes to the watchdog timer control register (WDTCON) following reset. This single write can either disable the timer or modify the timeout pe- riod and the action taken upon timeout. A keyed se- quence is also required to reset the current WDT count. This behavior ensures that randomly executing code will not prevent a WDT event from occurring. The WDT supports up to a 1.67-second timeout period in a 40-MHz system. After reset, the WDT is enabled and the timeout period is set to its maximum value. The WDT can be configured to cause either an NMI in- terrupt or a system reset upon timeout. If the WDT is configured for NMI, the NMIFLAG in the WDTCON reg- ister is set when the NMI is generated. The NMI inter- rupt service routine (ISR) should examine this flag to determine if the interrupt was generated by the WDT or by an external source. If the NMIFLAG is set, the ISR should clear the flag by writing the correct keyed se- quence to the WDTCON register. If the NMIFLAG is set when a second WDT timeout occurs, a WDT system reset is generated rather than a second NMI event. When the processor takes a WDT reset, either due to a single WDT event with the WDT configured to gener- ate resets or due to a WDT event with the NMIFLAG set, the RSTFLAG in the WDTCON register is set. This allows system initialization code to differentiate be- tween a hardware reset and a WDT reset and take ap- propriate action. The RSTFLAG is cleared when the WDTCON register is read or written. The processor does not resample external pins during a WDT reset. This means that the clocking, the reset configuration register, and any other features that are user-select- able during reset do not change when a WDT system reset occurs. All other activities are identical to those of a normal system reset. Note: The Watchdog Timer (WDT) is active after re- set. PULSE WIDTH DEMODULATION For many applications, such as bar-code reading, it is necessary to measure the width of a signal in both its High and Low phases. The Am186ED/EDLV microcon- trollers provide a pulse-width demodulation (PWD) op- tion to fulfill this need. The PWD bit in the System Configuration Register (SYSCON) enables the PWD option. Analog-to-digital conversion is not supported. In PWD mode, TMRIN0, TMRIN1, INT2, and INT4 are configured internal to the microcontroller to support the detection of rising and falling edges on the PWD input pin (INT2/INTA0/PWD) and to enable either timer 0 when the signal is High or timer 1 when the signal is Low. The INT4, TMRIN0, and TMRIN1 pins are not used in PWD mode and so are available for use as PIOs. |
|
链接网址 |
| 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 |