Lecture05_Timer_Interrupt_notes

Lecture05_Timer_Interrupt_notes - Embedded Control Lab...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Embedded Control Lab Manual Appendix C -: More Specifications on the C8051F020 EVB 151 More Specifications on the C8051F020 EVB Figure C.2 - Block Diagram of the C8051F020 Evaluation Board
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
C8051F020/1/2/3 Rev. 1.4 225 22. TIMERS The C8051F020/1/2/3 devices contain 5 counter/timers: three are 16-bit counter/timers compatible with those found in the standard 8051, and two are 16-bit auto-reload timers for use with the ADCs, SMBus, UART1, or for general purpose use. These can be used to measure time intervals, count external events and generate periodic interrupt requests. Timer 0 and Timer 1 are nearly identical and have four primary modes of operation. Timer 2 offers addi- tional capabilities not available in Timers 0 and 1. Timer 3 is similar to Timer 2, but without the capture or Baud Rate Generator modes. Timer 4 is identical to Timer 2, and can supply baud-rate generation capabilities to UART1. When functioning as a timer, the counter/timer registers are incremented on each clock tick. Clock ticks are derived from the system clock divided by either one or twelve as specified by the Timer Clock Select bits (T4M-T0M) in CKCON, shown in Figure 22.1. The twelve-clocks-per-tick option provides compatibility with the older generation of the 8051 family. Applications that require a faster timer can use the one-clock-per-tick option. When functioning as a counter, a counter/timer register is incremented on each high-to-low transition at the selected input pin. Events with a frequency of up to one-fourth the system clock's frequency can be counted. The input signal need not be periodic, but it should be held at a given level for at least two full system clock cycles to ensure the level is sampled. Timer 0 and Timer 1: Timer 2: Timer 3: Timer 4 13-bit counter/timer 16-bit counter/timer with auto-reload 16-bit timer with auto- reload 16-bit counter/timer with auto-reload 16-bit counter/timer 16-bit counter/timer with capture 16-bit counter/timer with capture 8-bit counter/timer with auto-reload Baud rate generator for UART0 Baud rate generator for UART1 Two 8-bit counter/timers (Timer 0 only)
Background image of page 2
Ch. 4 - C8051 EVB: System Clock (SYSCLK) Embedded Control Lab Manual 36 waveforms, some of the properties of these waveforms can also be studied using the timer functions in the microcontroller. Some of the timer functions capabilities provided by the C8051 are discussed in the following sections. System Clock (SYSCLK) The system clock can be used to time actions to occur at fixed periodic intervals, or to measure the time between actions or events. The C8051F020 can use either an internal oscillator or an external oscillator as its system clock source. The internal oscillator operates at a frequency of 2 MHz by default, but can be configured by software to operate at other frequencies. The external oscillator operates at 22.1184 MHz. Timers
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

Lecture05_Timer_Interrupt_notes - Embedded Control Lab...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online