| công cụ tìm kiếm bảng dữ liệu linh kiện điện tử |
|
HT46R92 bảng dữ liệu(PDF) 19 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT46R92 bảng dữ liệu(HTML) 19 Page - Holtek Semiconductor Inc |
|
19 / 61 page ![]() HT46R92 Rev. 1.10 19 November 5, 2008 Timer/Event Counters The provision of timers form an important part of any microcontroller, giving the designer a means of carrying out time related functions. The device contains one 8-bit count up timers. With three different operating modes, the timers can be configured to operate as a general timer, an external event counter or as a Pulse Width Measurement device. The provision of a prescaler in the input clock circuitry of each Timer/Event Counter gives added range to the timer. There are two types of registers related to the Timer/Event Counter. The first is the register that con- tains the actual value of the timer and into which an ini- tial value can be preloaded. Reading from this register retrieves the contents of the Timer/Event Counter. The second type of associated register is the timer control register which defines the timer options and determines how the timer is to be used. The devices can have the timer clock configured to come from the internal clock source. In addition, the timer clock source can also be configured to come from an external timer pin. Configuring the Timer/Event Counter Input Clock Source The internal timer ¢s clock can originate from various sources, chosen via a configuration option. The internal clock input timer source is used when the timer is in the timer mode or in the pulse width measurement mode. The clock timer source is also first divided by a prescaler, the division ratio of which is conditioned by the timer control register bits PSC0~PSC2. An external clock source is used when the timer is in the event counting mode, the clock source being provided on the external timer TMR pin. Depending upon the con- dition of the TE bit, each high to low, or low to high transi- tion on the external timer pin will increment the counter by one. Timer Register - TMR The timer register are special function register location within the special purpose Data Memory where the ac- tual timer value is stored. This register has the name TMR. The value in the timer registers increases by one each time an internal clock pulse is received or an exter- nal transition occurs on the external timer pin. The timer will count from the initial value loaded by the preload register to the full count value of FFH at which point the timer overflows and an internal interrupt signal gener- ated. The timer value will then be reset with the initial preload register value and continue counting. To achieve a maximum full range count of FFH the preload register must first be cleared to 00H. It should be noted that after power-on the preload register will be in an un- known condition. Note that if the Timer/Event Counter is not running and data is written to its preload register, this data will be immediately written into the actual counter. However, if the counter is enabled and counting, any new data written into the preload register during this pe- riod will remain in the preload register and will only be written into the actual counter the next time an overflow occurs. Timer Control Register - TMRC The flexible features of the Holtek microcontroller Timer/ Event Counters enable them to operate in three different modes, the options of which are determined by the con- tents of their respective control register. The device con- tains one timer control register known as TMRC. It is the timer control register together with its corresponding timer registers that control the full operation of the Timer/Event Counters. Before the timer can be used, it is essential that the timer control register is fully pro- grammed with the right data to ensure its correct opera- tion, a process that is normally carried out during program initialisation. To choose which of the three modes the timer is to oper- ate in, either in the timer mode, the event counting mode or the Pulse Width Measurement mode, bits 7 and 6 of the Timer Control Register, which are known as the bit pair TM1/TM0 respectively, must be set to the required logic levels. The timer-on bit, which is bit 4 of the Timer Control Register and known as TON, provides the basic on/off control of the respective timer. Setting the bit high allows the counter to run, clearing the bit stops the coun- ter. The Timer/Event Counters also contains a prescaler function, with bits 0~2 of the associated Timer Control Register determining the division ratio of the input clock. T M R T E f I N T M U X C o n f i g u r a t i o n O p t i o n f S / 1 6 f S M U X f S Y S / 4 f S Y S / 4 W D T O S C f S P 9 - B i t C o u n t e r W D T T i m e - o u t 8 - B i t T i m e r / E v e n t C o u n t e r P r e l o a d R e g i s t e r 8 - B i t T i m e r / E v e n t C o u n t e r ( T M R ) D a t a B u s R e l o a d O v e r f l o w t o I n t e r r u p t C o n f i g u r a t i o n O p t i o n 1 6 ¸ T i m e r / E v e n t C o u n t e r M o d e C o n t r o l T M 1 T M 0 T O N P r e s c a l e r P S C 2 ~ P S C 0 ( 1 / 2 ~ 1 / 2 5 6 ) R T C O S C 8-bit Timer/Event Counter Structure |
|
Link URL |
| Cho đến nay ALLDATASHEET có giúp ích cho doanh nghiệp của bạn hay không? [ DONATE ] |
Alldatasheet là | Quảng cáo | Liên lạc với chúng tôi | Chính sách bảo mật | Liên kết đến bảng dữ liệu | Trao đổi link | Tìm kiếm theo nhà sản xuất 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 |