- 1
- 0
- 约7.4千字
- 约 29页
- 2019-10-27 发布于福建
- 举报
Chapter 6-2 : Timer/Counter * Microcontroller Principle and Application 主讲教师:黄英 6.2 Timer/Counter 6.2.1 Introduction of Timing Methods 6.2.2 Functions of Timer/Counter Contents: 6.2.3 Control Register of Timer/Counter 6.2.4 Mode 0(13-bit Timer Mode) 6.2.5 Mode 1(16-bit Timer Mode) 6.2.6 Mode 2(8-bit Auto Reload Mode) 6.2.7 Mode 3(Split Timer Mode) Home Work Return 6.1.1 Introduction of Timing Methods 1. Software Timing: Delay program 2. Hardware Timing 3. Programmable Timer 6.2.2 Functions of Timer/Counter · 8051 has two 16-bit Timer/Counter: Timer 0、Timer 1. · Each of them has two 8-bit timer registers: TH0+TL0、TH1+TL1 1. Timer · The register T1 or T0 is incremented every machine cycle. · Since a machine cycle consists of 12 oscillator periods, the count rate is 1/12 of the oscillator frequency. If fosc =12MHz, then fcount = 1MHz 2. Counter · The register T0 or T1 is incremented in response to the falling edge at its corresponding external input pin T0(P3.4)or T1(P3.5). · Since 2 machine cycles(24 oscillator periods) are required to recognize a falling edge, the maximum count rate is 1/24 of the oscillator frequency. Return 6.2.3 Control Register of Timer/Counter 1. Timer/Counter Control Register(TCON) 2. Timer/Counter Modes Control Register(TMOD) 3. Interrupt Enable Register(IE) Return Contents: 1. Timer/Counter Control Register(TCON) Return · Cell addresses: 88H · Bit address: 8FH~88H 2. Timer/Counter Modes Control Register(TMOD) Cell addresses: 89H Return 3. Interrupt Enable Register(IE) · Cell address: 0A8H · Bit addresses: 0AFH~0A8H · Reset Value: 0?00 0000b Return 6.2.4 Mode 0(13-bit Timer Mode) Contents: 1. Circuit Logic Structure Return 2. Rang of Timing Counting 3. Example 1. Circuit Logic Structure C/T = 0:Timer;C/T = 1:Counter · GATE = 0:if TR1 = 1, then turns on T/C. if TR1 = 0, then turns off T/C. · GATE = 1:if /INT1 pin = high level and TR1 = 1, then turns on T/C.
原创力文档

文档评论(0)