|
| HT46R064D |
|
||
|
HOLTEK |
|
53 page
TMR1CRegister Bit 7 6 5 4 3 2 1 0 Name T1M1 T1M0 T1S T1ON T1EG ¾ ¾ ¾ R/W R/W R/W R/W R/W R/W ¾ ¾ ¾ POR 0 0 0 0 1 ¾ ¾ ¾ Bit7,6 T1M1,T1M0:Timer1Operationmodeselection 00:nomodeavailable 01:eventcountermode 10:timermode 11:pulsewidthcapturemode Bit5 T1S:timerclocksource 0: f SYS/4 1: LXT oscillator Bit4 T1ON:Timer/eventcountercountingenable 0:disable 1:enable Bit3 T1EG: Eventcounteractiveedgeselection 0:countonraisingedge 1:countonfallingedge PulseWidthCaptureactiveedgeselection 0:startcountingonfallingedge,stoponrasingedge 1:startcountingonraisingedge,stoponfallingedge Bit2~0 unimplemented,readas ²0² TimerMode In this mode, the Timer/Event Counter can be utilised to measure fixed time intervals, providing an internal interrupt signal each time the Timer/Event Counter overflows. To operate in this mode, the Operating Mode Select bit pair, TnM1/TnM0, in the Timer Control Register must be set to the correct value as shown. ControlRegisterOperatingMode SelectBitsfortheTimerMode Bit7 Bit6 1 0 In this mode the internal clock is used as the timer clock. The timer input clock source is either fSYS , fSYS/4 or the LXT oscillator. However, this timer clock source is further divided by a prescaler, the value of which is determined by the bits TnPSC2~TnPSC0 in the Timer Control Register. The timer-on bit, TnON must be set high to enable the timer to run. Each time an internal clock high to low transition occurs, the timer increments by one; when the timer is full and overflows, an interrupt signal is generated and the timer will reload the value already loaded into the preload register and continue counting. A timer overflow condition and corresponding internal interrupt is one of the wake-up sources, however, the internal interrupts can be disabled by ensuring that the ETnI bits of the INTCn register are reset to zero. Rev.1.00 48 January12,2011 HT46R064D/065D/066D EnhancedA/DType8-Bit OTP MCU withLEDDriver I n c r e m e n t T i m e r C o n t r o l l e r P r e s c a l e r O u t p u t T i m e r + 1 T i m e r + 2 T i m e r + N T i m e r + N + 1 TimerModeTimingChart |