| Electronic Components Datasheet Search |
|
P83CE559 Datasheet(PDF) 22 Page - NXP Semiconductors |
|
|
|||||||||||||||||||||||||||||
P83CE559 Datasheet(HTML) 22 Page - NXP Semiconductors |
|
22 / 72 page ![]() Philips Semiconductors Preliminary specification P83CE559/P80CE559 Single-chip 8-bit microcontroller 1996 Aug 06 22 6.7 Timer / Counters The P8xCE559 contains three 16-bit timer/event counters: Timer 0, Timer 1 and Timer T2 and one 8-bit timer, T3. Timer 0 and Timer 1 may be programmed to carry out the following functions: • Measure time intervals and pulse durations • Count events • Generate interrupt requests 6.7.1 Timer 0 and Timer 1 Timers 0 and 1 each have a control bit in SFR TMOD that selects the timer or counter function of the corresponding timer. In the timer function, the register is incremented every machine cycle. Thus, one can think of it as counting machine cycles. Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency. In the counter function, the register is incremented in response to a 1-to-0 transition at the corresponding external input pin, T0 or T1. In this function, the external input is sampled during S5P2 of every machine cycle. When the samples show a HIGH in one cycle and a LOW in the next cycle, the counter is incremented. Thus, it takes two machine cycles (24 oscillator periods) to recognize a 1-to-0 transition. There are no restrictions on the duty cycle of the external input signal, but to insure that a given level is sampled at least once before it changes, it should be held for at least one full machine cycle. Timer 0 and Timer 1 can be programmed independently to operate in one of four modes: • Mode 0: 8-bit timer or 8-bit counter each with divide-by-32 prescaler • Mode 1: 16-bit time-interval or event counter • Mode 2: 8-bit time-interval or event counter with automatic reload upon overflow • Mode 3: -Timer 0: one 8-bit time-interval or event counter and one 8-bit time-interval counter -Timer 1: stopped When Timer 0 is in Mode 3, Timer 1 can be programmed to operate in Modes 0, 1 or 2 but cannot set an interrupt request flag or generate an interrupt. However the overflow from Timer 1 can be used to pulse the serial port baud-rate generator. With a 16 MHz crystal, the counting frequency of these timer/counters is as follows: • In the timer function, the timer is incremented at a frequency of 1.33 MHz - a division by 12 of the system clock frequency • 0 Hz to an upper limit of 0.66 MHz (1/24 of the system clock frequency) when programmed for external inputs Both internal and external inputs can be gated to the counter by a second external source for directly measuring pulse durations. When configured as a counter, the register is incremented on every falling edge on the corresponding input pin, T0 or T1. The incremented register value can be read earliest during the second machine cycle after that one, during which the incrementing pulse occurred. The counters are started and stopped under software control. Each one sets its interrupt request flag when it overflows from all HIGHs to all LOWs (or automatic reload value), with the exception of mode 3 as previously described. Figure 19. Timer/Counter mode control (TMOD) register. 7 6 54 321 0 TMOD (89H) GATE C/T M1 M0 GATE C/T M1 M0 Timer 1 Timer 0 Table 12. Description of TMOD bits SYMBOL BIT FUNCTION Gate TMOD.7 TMOD.3 Gating control when set. Timer/Counter “x” is enabled only while “INTx” pin is high and “TRx” control pin is set. When cleared Timer “x” is enabled whenever “TRx” control bit is set. C/T TMOD.6 TMOD.2 Timer or Counter Selector cleared for Timer operation (input from internal system clock). Set for Counter operation (input from “Tx” input pin). M1 M0 TMOD.5 TMOD.1 TMOD.4 TMOD.0 Timer 0, Timer 1 mode select see Table 13. Table 13. Timer 0 / Timer 1 operation select M1 M0 OPERATING 0 0 8048 Timer “TLx” serves as 5-bit prescaler. 0 1 16-bit Timer/Counter “THx” and “TLx” are cascaded; there is no prescaler. 1 0 8-bit auto-reload Timer/Counter “THx” holds a value which is to be reloaded into “TLx” each time it overflows. 1 1 (Timer 0) TL0 is an 8-bit Timer/Counter controlled by the standard Timer 0 control bits. TH0 is an 8-bit timer only controlled by Timer 1 control bits. 1 1 (Timer 1) Timer/Counter 1 stopped. |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List 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 |