Lab Task 11 (Timer As A Counter)
Lab Task 11 (Timer As A Counter)
Theory Microcontroller:
A microcontroller is a compact integrated circuit designed to govern a specific operation in
an embedded system. A typical microcontroller includes a processor, memory and input/output
(I/O) peripherals on a single chip.
Microcontroller 8051:
8051 microcontrollers are designed by Intel in 1981. It is an 8-bit microcontroller. It is built with
40 pins DIP (dual inline package), 4kb of ROM storage and 128 bytes of RAM storage, 2 16-bit
timers. It consists of are four parallel 8-bit ports, which are programmable as well as addressable
as per the requirement. An on-chip crystal oscillator is integrated in the microcontroller having
crystal frequency of 12 MHz.
Counter Programming:
Timers can also be used as counters counting events happening outside the 8051. When it is used
as a counter, however, it is a pulse outside the 8051 that increments the TH, TL registers. In
counter mode, notice that the TMOD and TH, TL registers are the same as for the timer.
Diagram:
Connection Diagram:
Results and
Conclusions