| 数据搜索系统,热门电子元器件搜索 |
|
HT82K75R 数据表(PDF) 20 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT82K75R 数据表(HTML) 20 Page - Holtek Semiconductor Inc |
|
20 / 66 page ![]() HT82M75R/HT82M75RE HT82K75R/HT82K75RE Rev. 1.10 20 June 11, 2010 Configuring the Event Counter Mode In this mode, a number of externally changing logic events, occurring on external pin PA2/TMR, can be re- corded by the internal timer. For the timer to operate in the event counting mode, bits TM1 and TM0 of the TMRC register must be set to 0 and 1 respectively. The timer-on bit, TON must be set high to enable the timer to count. With TE low, the counter will increment each time the PA2/TMR pin receives a low to high transition. If the TE bit is high, the counter will increment each time PA2/TMR receives a high to low transition. As in the case of the other two modes, when the counter is full and overflows, the timer will be reset to the value al- ready loaded into the preload register and continue counting. If the timer interrupt is enabled, an interrupt signal will also be generated. The timer interrupt can be disabled by ensuring that the ETI bit in the INTC register is cleared to zero. To ensure that the external pin PA2/TMR is configured to operate as an event counter input pin, two things have to happen. The first is to en- sure that the TM0 and TM1 bits place the timer/event counter in the event counting mode, the second is to en- sure that the port control register configures the pin as an input. In the Event Counting mode, the Timer/Event Counter will continue to record externally changing logic events on the timer input pin, even if the microcontroller is in the Power Down Mode. Configuring the Pulse Width Measurement Mode In this mode, the width of external pulses applied to the pin-shared external pin PA2/TMR can be measured. In the Pulse Width Measurement Mode, the timer clock source is supplied by the internal clock. For the timer to operate in this mode, bits TM0 and TM1 must both be set high. If the TE bit is low, once a high to low transition has been received on the PA2/TMR pin, the timer will start counting until the PA2/TMR pin returns to its origi- nal high level. At this point the TON bit will be automati- cally reset to zero and the timer will stop counting. If the TE bit is high, the timer will begin counting once a low to high transition has been received on the PA2/TMR pin and stop counting when the PA2/TMR pin returns to its original low level. As before, the TON bit will be automat- ically reset to zero and the timer will stop counting. It is important to note that in the Pulse Width Measurement Mode, the TON bit is automatically reset to zero when the external control signal on the external timer pin re- turns to its original level, whereas in the other two modes the TON bit can only be reset to zero under pro- gram control. The residual value in the timer, which can now be read by the program, therefore represents the length of the pulse received on pin PA2/TMR. As the TON bit has now been reset any further transitions on the PA2/TMR pin will be ignored. Not until the TON bit is again set high by the program can the timer begin fur- ther pulse width measurements. In this way single shot pulse measurements can be easily made. It should be noted that in this mode the counter is controlled by logi- cal transitions on the PA2/TMR pin and not by the logic level. As in the case of the other two modes, when the counter is full and overflows, the timer will be reset to the value already loaded into the preload register. If the timer in- terrupt is enabled, an interrupt signal will also be gener- ated. To ensure that the external pin PA2/TMR is configured to operate as a pulse width measuring input pin, two things have to happen. The first is to ensure that the TM0 and TM1 bits place the timer/event counter in the pulse width measuring mode, the second is to en- sure that the port control register configures the pin as an input. T i m e r + 2 E x t e r n a l E v e n t I n c r e m e n t T i m e r C o u n t e r T i m e r + 3 T i m e r + 1 Event Counter Mode Timing Chart + 1 + 2 + 3 + 4 T i m e r E x t e r n a l T i m e r P i n I n p u t T O N ( w i t h T E = 0 ) f S Y S I n c r e m e n t T i m e r C o u n t e r f S Y S i s s a m p l e d a t e v e r y f a l l i n g e d g e o f T 1 . Pulse Width Measure Mode Timing Chart |
|
链接网址 |
| 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 |