| 전자부품 데이터시트 검색엔진 |
|
HMS91C8032 데이터시트(PDF) 46 Page - Hynix Semiconductor |
|
|
|||||||||||||||||||||||||||||
HMS91C8032 데이터시트(HTML) 46 Page - Hynix Semiconductor |
|
46 / 157 page ![]() HMS91C8032/97C8032 NOV., 2001 Ver 1.02 43 4.3 Timer/Counters (Timer0, Timer1 and Timer2) The HMS9XC8032 has five 16-bit Timer/Counter registers: Tim- er 0, Timer 1, Timer2, Timer 3 and Timer 4. All of them can be configured to operate either as timers or event counters. In this chapter, Timer0, Timer1 and Timer2 which are compatible with Intel 8052 are described. Timer3 and Timer4 are described in Part C: Timer/Counters (Timer3 and Timer4) chapter. In the "Timer" function, the register is incremented every ma- chine cycle. Thus, one can think of it as counting machine cycles. Since a machine cycle consists of 6 CPU clock periods, the count rate is 1/6 of the CPU clock frequency. In the "Counter" function, the register is incremented in response to a 1-to-0 transition at its 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 count is incremented. The new count value appears in the register during S2P1 of the cycle fol- lowing the one in which the transition was detected. Since it takes 2 machine cycles (12 CPU clock periods) to recognize a 1-to-0 transition, the maximum count rate is 1/12 of the CPU clock fre- quency. There are no restrictions on the duty cycle of the external input signal, but to ensure that a given level is sampled at least once before it changes, it should be held for at least one full cycle. In addition to the "Timer" or "Counter" selection, Timer 0 and Timer1 have four operating modes from which to select. Timer 0 and Timer 1 The "Timer" or "Counter" function is selected by control bits C/ T in the Special Function Register TMOD. These Timer/Counters have four operating modes, which are selected by bit-pairs (M1, M0) in TMOD. Modes 0, 1, and 2 are the same for Timers/ Counters. Mode 3 is different. The four operating modes are de- scribed in the following text. Mode 0 Putting either Timer into Mode 0 makes it look like an 8048 Tim- er, which is an 8-bit Counter with a divide-by-32 prescaler. Fig- ure 4-6 shows the Mode 0 operation as it applies to Timer 1. In this mode, the Timer register is configured as a 13-bit register. As the count rolls over from all 1s to all 0s, it sets the Timer in- terrupt flag TF1. The counted input is enabled to the Timer when TR1 = 1 and either GATE = 0 or /INT1 = 1. (Setting GATE = 1 allows the Timer to be controlled by external input /INT1, to fa- cilitate pulse width measurements). TR1 is a control bit in the Special Function Register TCON (TCON Control Reigster). GATE is in TMOD. The 13-bit register consists of all 8 bits of TH1 and the lower 5 bits of TL1. The upper 3 bits of TL1 are indeterminate and should be ignored. Setting the run flag does not clear the registers. Mode 0 operation is the same for the Timer 0 as for Timer 1. Sub- stitute TR0, TF0, and /INT0 for the corresponding Timer 1 sig- nals in Figure 4-6. There are two different GATE bits, one for Timer 1 and one for Timer 0. Mode 1 Mode 1 is the same as Mode 0, except that the Timer register is being run with all 16 bits. Figure 4-4 TCON Control Reigster Symbol Position Name and Significance (MSB) (LSB) TF1 TR1 TF0 TR0 IE1 IT1 IE0 IT0 TCON.7 Timer 1 overflow flag. Set by hardware on Timer/Counter overflow. Cleared by hardware when processor vectors to interrupt routine. TF1 TCON.6 Timer 1 Run control bit. Set/cleared by software to turn Timer/Counter on/off. TR1 TCON.5 Timer 0 overflow flag. Set by hardware on Timer/Counter overflow. Cleared by hardware when processor vectors to interrupt routine. TCON.4 TF0 TR0 Timer 0 Run control bit. Set/cleared by software to turn Timer/Counter on/off. Symbol Position Name and Significance TCON.3 Interrupt 1 Edge flag. Set by hardware when external interrupt edge detected. Cleared when interrupt Processed. IE1 TCON.2 Interrupt 1 Type control bit. Set/ cleared by software to specify falling Edge/low level triggered external Interrupt. IT1 TCON.1 Interrupt 0 Edge flag. Set by hardware when external interrupt edge detected. Cleared when interrupt Processed. TCON.0 IE0 IT0 Interrupt 1 Type control bit. Set/ cleared by software to specify falling Edge/low level triggered external Interrupt. |
|
링크 URL |
| 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 |